GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Full sim: all detected particles have PDG ID zero
Re: Full sim: all detected particles have PDG ID zero [message #9388 is a reply to message #9366] Fri, 11 September 2009 22:56 Go to previous messageGo to previous message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *adsl.highway.telekom.at
Yes, as you say, it is passed as a pointer. The TF1 object itself is created in the sim macro. So I don't think it would be a good idea to delete it in the PndDpmDirect class, would it? So, the memory already gets allocated in the sim macro, and should also be freed there, in my opinion. Paul has changed our PndDpmDirect from the "*.old" version (see above) to the current one, that at least does not crash.

But when looking at it again, I think it is a little bit strange as well. There is that bit of code in the .cxx file:

TF1 * fDensityFunction = new TF1();

Thus, memory is allocated here for a second time. Then, in the constructor:

fDensityFunction = DensityFunction;

where DensityFunction is the argument of the constructor. So, the pointer is now directed at the "original" object from the simulation. Isn't that a memory leak or am I completely misinterpreting the code?

Kind regards
Christian

[Updated on: Fri, 11 September 2009 22:56]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon2.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simulation crashes after "singular matrix" in digitization macro
Next Topic: Analyse MC hits per event in different detectors
Goto Forum:
  


Current Time: Fri Mar 29 08:11:12 CET 2024

Total time taken to generate the page: 0.00990 seconds