GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Full sim: all detected particles have PDG ID zero
Full sim: all detected particles have PDG ID zero [message #9366] Thu, 10 September 2009 10:09 Go to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Hello,

sorry to bother you again, but there is still one very serious problem left in our simulation. We produce events with PndDpmDirect, and then do the full chain with digi, reco, kalman and makeTCands. For analysis, we use PndEventReader, and here comes the problem: All detected particles have a PDG ID of zero, of course very contrary to the McTruth values. Thus, all other selectors than Neutral, Charged, All or McTruth of the FillList method produce empty lists. So, what could be the reason for that behaviour?

Kind regards
Christian
Re: Full sim: all detected particles have PDG ID zero [message #9367 is a reply to message #9366] Thu, 10 September 2009 10:21 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ext.kfa-juelich.de
As I have said in some other thread and at the meeting,
at the moment the PndEvtReader is not working properly due to the recent changes in the code.

This means that if you want to use makeTCands.C then you have to go to the svn release of the Torino tutorial.
If you want the use latter versions if the trunk, then you have to wait for the fix, in order to have rho working properly.
Re: Full sim: all detected particles have PDG ID zero [message #9368 is a reply to message #9366] Thu, 10 September 2009 10:27 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
We already use the svn revision of the Torino tutorial, since the simulation did not run properly at all due to the recent changes with the latest revisions ...
Re: Full sim: all detected particles have PDG ID zero [message #9369 is a reply to message #9366] Thu, 10 September 2009 10:48 Go to previous messageGo to next message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: 78.176.155*
Hi Christian,

unfortunately I'm on a conference and therefore most likely am not able to take a closer look until end of next week.

What I just can tell is that particles from the full sim don't have a reasonable PDG code out of the box. The idea is that the selectors set the corresponding mass when a particle is accepted. The selector of course does not take a look to a PDG code, and it doesn't set one I think. The PDG code in the interface is only used by mc truth particles as far as I remember.

That the lists are empty obviosly has a different reason, but I cannot tell at the moment. I was working on the PndEventReader just before I left and checked in new stuff, but you told that you are anyway using an older revision.

I'll take a look as soon as possible.

Cheers and sorry for the inconvenience,

Klaus

Re: Full sim: all detected particles have PDG ID zero [message #9370 is a reply to message #9366] Thu, 10 September 2009 10:57 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Alright, then the fact that the lists are empty has another cause. It just seemed reasonable since the charges of the particles are there with +1 / -1 while the PDG IDs are all 0 ...

Kind regards
Christian
Re: Full sim: all detected particles have PDG ID zero [message #9371 is a reply to message #9370] Thu, 10 September 2009 11:06 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ext.kfa-juelich.de
COuld you please attach the log output of your reco/fit/makeTCands macro? Just to see if maybe some messages could help to udnerstand what is going on... maybe launched with few events.
Re: Full sim: all detected particles have PDG ID zero [message #9372 is a reply to message #9366] Thu, 10 September 2009 11:15 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
The original log file would be huge (more than 10.000 events), so I have cut out most of the middle part, but the essential information should be still there.

EDIT: Sorry, I have forgotten the other two, they'll follow in a moment!

[Updated on: Thu, 10 September 2009 11:22]

Report message to a moderator

Re: Full sim: all detected particles have PDG ID zero [message #9373 is a reply to message #9366] Thu, 10 September 2009 11:29 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Again most of the middle part "headed" / "tailed" out ...

Still, we have all those fitter exceptions in the kalman. That might be related to the problem.
Re: Full sim: all detected particles have PDG ID zero [message #9374 is a reply to message #9372] Thu, 10 September 2009 12:00 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ext.kfa-juelich.de
Hi,
I can see different strange things in your log files:

Warning in <TStreamerInfo::BuildCheck>: 
   The StreamerInfo of class PndDpmDirect read from file data_0/params_sttcombi.root
   has the same version (=1) as the active class but a different checksum.
   You should update the version to ClassDef(PndDpmDirect,2).
   Do not try to write objects with the current class definition,
   the files will not be readable.


It seems you are using for the reconstruction a svn release different from the one used for the simulation. Is it possible?
Or maybe you have first done a test with some other svn version, then you have updated your system to a different version of pandaroot and you have restarted the macros without cleaning the old files (therefore, you are still using the old params_sttcombi.root).

Warning in <TClass::TClass>: no dictionary for class PndGemDetector is available


This should be related to the files with the "old" pandaroot, like in the previous case.

-------------------Warning---------------------------
 -W FairRunAna : File has less events than requested!!
 File contains : 5221 Events
 Requested number of events = 12500 Events
 The number of events is set to 5221 Events
-----------------------------------------------------


Maybe you have produced a too big file in simulation, which is split into more files. The macros are tuned to run a single file, you are not using the "add" method and then you are reconstructing only a part of the event. You could try to run 5000 events, which stay in only a single file, to check if it works or not.

Then...

 ***  Event # 1
 =====   PndLheHitsMaker   =====
  Total number of hits for tracking:     0
Total number of tracks in TPC:     0
           Good tracks in TPC:     0
 Working with 0 hits
 found     0 tracks 
finder    : Real Time =   0.00 seconds Cpu Time =   0.00 seconds
 =====   PndTpcLheTrackFitter   ===== 
 Number of tracks for fitting 0
 =====   PndLhePidMaker:  Number of tracks for pid 0


There is some problem in the digitization, you have no hits and then no tracks are created -> the lists are empty after makeTCands.
The log files of sim and digi could be helpful to understand what is wrong.

Then, I would suggest to run fewer events, checking the pandaroot version and being sure that the old files are removed.
Then, if the error persists, please attach the log file also for sim and digi. I think that for this "release" mismatch the digi macro is not able to read properly the sim file, and then some hit containers could be read as empty or not properly filled.

If this is not the case... I don't know...
Re: Full sim: all detected particles have PDG ID zero [message #9375 is a reply to message #9366] Thu, 10 September 2009 13:36 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Thanks for your help. You were right about concerning the old root files -- I had those files from the other revision still in the directory.

Unfortunately, the result is not really better now. Contrary, I now get a total crash already in the reco macro, which happens at the initialization. I have included the reco log with the error output, and also the sim and digi log, just did 20 events this time. The revision is definitely that from the Torino tutorial.

Just to be sure, would that be correct procedure for updating and compiling the code:

cd trunk
svn update -r XXX
rm -r CMakeCache.txt CMakeFiles
cd ../build
cmake ../trunk
make

Have I forgotten anything? Maybe a make clean somewhere? Or anything else?

My collegue Paul Bühler has installed indenpendently from me his own version of Panda ROOT (on the same machine, but in his directory). He uses the current revision. The weird thing is, that his reco task crashes at exactly the same point as mine, and we have so far no clue why.
  • Attachment: 3-reco.log
    (Size: 6.01KB, Downloaded 252 times)
  • Attachment: 1-sim.log
    (Size: 29.66KB, Downloaded 245 times)
  • Attachment: 2-digi.log
    (Size: 39.01KB, Downloaded 254 times)

[Updated on: Thu, 10 September 2009 15:20]

Report message to a moderator

Re: Full sim: all detected particles have PDG ID zero [message #9378 is a reply to message #9375] Thu, 10 September 2009 15:17 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ext.kfa-juelich.de
You mean:

cmake ../trunk


isn't it?
Re: Full sim: all detected particles have PDG ID zero [message #9379 is a reply to message #9366] Thu, 10 September 2009 15:19 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Of course,

cmake ../trunk

it should be.
Re: Full sim: all detected particles have PDG ID zero [message #9381 is a reply to message #9366] Fri, 11 September 2009 11:51 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
I have just rerun the simulation and corrected some errors concerning the GEM detectors, and the revision is now 5858 (needed for GEM). It does not make a difference anyway. The sim still crashes at the reco task. Logs are included. Any idea?
  • Attachment: 1-sim.log
    (Size: 14.30KB, Downloaded 234 times)
  • Attachment: 2-digi.log
    (Size: 36.95KB, Downloaded 234 times)
  • Attachment: 3-reco.log
    (Size: 5.83KB, Downloaded 232 times)
icon2.gif  Re: Full sim: all detected particles have PDG ID zero [message #9382 is a reply to message #9366] Fri, 11 September 2009 12:34 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *to.infn.it
Hello Christian,

I suggest you rerun the reco with a debugger.
~/pandaroot/mystuff/analysis> gdb --args root.exe run_reco_sttcombi.C\(5,0\)

Type r (run) to start the program and on the segfault use bt (backtrace) the problem (to quit use q).
You might want to post the output here.

Kind regards, Ralf.
Re: Full sim: all detected particles have PDG ID zero [message #9383 is a reply to message #9366] Fri, 11 September 2009 14:15 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Alright, thanks a lot, but before using gdb, there is somesthing important Paul Bühler hast just found out: As I have mentioned before, we slightly modified the class PndDpmDirect for our needs. Basically, I have overloaded the constructor of the class, so that it is possible to pass a TF1 pointer to the class, representing an axial gas density distribution. However, the "untouched" original constructor is still there as well, taking only two arguments, pbar momentum and mode.

Now comes the weird thing: If we use the unmodified original source code from the svn, everything runs fine. If we, however, compile the code with our modified PndDpmDirect, the crash occurs even when we call PndDpmDirect with the two arguments only.

So, what is it we have forgotten in implementing our changes to the class?
Re: Full sim: all detected particles have PDG ID zero [message #9384 is a reply to message #9366] Fri, 11 September 2009 15:15 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *to.infn.it
Hello,

In fact it is really hard to tell without being able to look at the code. I suggest you create a folder in the development branch where you put the changes.
For more hints see here.

Kind regards, Ralf.
Re: Full sim: all detected particles have PDG ID zero [message #9385 is a reply to message #9366] Fri, 11 September 2009 15:26 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
The problem is now gone -- Paul has changed the code a little bit, so that the TF1 object is not a data element of the class any more. Instead, it is only a global variable within the class implementation. I will still put the two different versions in a directory in the development branch since I'm really interested what the actual problem was.

Kind regards
Christian
Re: Full sim: all detected particles have PDG ID zero [message #9386 is a reply to message #9366] Fri, 11 September 2009 16:06 Go to previous messageGo to next message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Wouldn't I need a login for the svn to add anything? At least my svn prompts me for login / password when trying to add a new folder in development.

Anyway, I have attached old (crashing) and new (not crashing) version of PndDpmDirect to the message.

Kind regards
Christian
Re: Full sim: all detected particles have PDG ID zero [message #9387 is a reply to message #9383] Fri, 11 September 2009 22:14 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *0-87-r.retail.telecomitalia.it
First of all, have you added a TF1 or a TF1* ?
The main problem is that the code is not able to delete this TF1. maybe because it is not a pointer. Try to use the "*" if it is not in this way.
If not, try to delete this object by yourself in the destructor of your PndDpmDirect.

[ADDED]
I had not read the other posts. I have seen that the TF1* is already a pointer. Then try the second option, try to delete the histo in the destructor.

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

Report message to a moderator

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 next 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

Re: Full sim: all detected particles have PDG ID zero [message #9390 is a reply to message #9366] Mon, 14 September 2009 11:17 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *to.infn.it
Hi,

You're right. When calling TF1 * fDensityFunction = new TF1(); you create a new object which is not deleted, when assinging the other object in the constructor. As far as I see it you don't need the new command. Just providing a pointer which is not stored in the class.
I would add a fDensityFunction = new TF1(); in the other constructor to be sure to have at least one object there.

You should also protect your code from crashing when trying to access the external TF1* by checking it before using a functionality i.e. line 152:

if(fDensityFunction) fZ=fDensityFunction->GetRandom();
else fz=SomeOtherRandom();


Kind Regards, Ralf.
Re: Full sim: all detected particles have PDG ID zero [message #9391 is a reply to message #9366] Mon, 14 September 2009 11:28 Go to previous message
Christian Leitold is currently offline  Christian Leitold
Messages: 35
Registered: August 2009
Location: Stefan Meyer Institute
continuous participant
From: *smi.oeaw.ac.at
Thanks for your suggestions. Why would you add a fDensityFunction = new TF1(); in the "without density" constructor? If my PndDpmDirect is created with that constructor, a TF1 is never accessed at all.

Kind regards
Christian
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 Apr 26 17:28:10 CEST 2024

Total time taken to generate the page: 0.01104 seconds