GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Problems with FairRootManager
Problems with FairRootManager [message #11638] Fri, 08 April 2011 14:32 Go to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Dear framework specialists,

I have problems running my macros since I updated the base folder in the trunk. Downgrading to revision 11176 solves the problems.

Specifically, I get a segfault when adding my MC output file as a friend in the digi or reco macro:

#9  <signal handler called>
#10 0xb393a8c3 in FairRootManager::AddFriendsToChain (this=0xa5eb9f8) at /home/date/pandaroot/trunk_new/base/FairRootManager.cxx:1019
#11 0xb394bc0f in FairRunAna::Init (this=0xa0b8be8) at /home/date/pandaroot/trunk_new/base/FairRunAna.cxx:107


Looking into it I found that in the loop over the items in "friendList" in AddFriendsToChain():

  • It finds my MC-file as first entry in the list
  • The only inputlevel is "InputChain"
  • The TChain* of fFriendTypeList["InputChain"] is NULL
  • Consequently, the following addFile() gives a segfault


What is going on? Surely something is wrong in my macros, since nobody else seems to have problems. However, as I mentioned, downgrading the base folder solves the problem. Maybe somebody of the experts can give me a hint here?

Cheers

Felix

Re: Problems with FairRootManager [message #11641 is a reply to message #11638] Fri, 08 April 2011 14:58 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Felix

Could you please attach your macro or send it by mail or if it is in the repository tell me where to find it. Then i will have a look.

Ciao

Florian
Re: Problems with FairRootManager [message #11642 is a reply to message #11641] Fri, 08 April 2011 15:29 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Hi Florian,

thanks for the quick reply. Please find attached my macros. The error occurs in the Reco and the Digi as soon as I try to add the MC file as friend (which is needed to obtain the geometry)...

Cheers


Felix
Re: Problems with FairRootManager [message #11643 is a reply to message #11642] Fri, 08 April 2011 15:43 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Felix

I don't know what you want to do here (runDigiFOPI.C), but I think it does not make sense to define an input file and add the same file as friend. Anyway I think for the
digitization you only need to define the MC file as input.

// -----   Digitization run   -------------------------------------------
  FairRunAna *fRun= new FairRunAna();
  fRun->SetInputFile(inFile);

  fRun->AddFriend(inFile);
  
  fRun->SetOutputFile(outFile);
  // ------------------------------------------------------------------------


For the reconstruction please define the mc file as input and add the digi file as friend. In principle there should be no difference but this was the way I did the tests. Before running the reconstruction please rerun the digitization without adding the input file also as friend.

Ciao

Florian

Re: Problems with FairRootManager [message #11644 is a reply to message #11643] Fri, 08 April 2011 15:59 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Hi Florian,

the addFriend statement in the digi was just to test if the crash occurs also there - I forgot to remove it.

Setting the mc file as input and the (fresh) digi file as friend does not help - the crash is still there.


Cheers

Felix
Re: Problems with FairRootManager [message #11646 is a reply to message #11644] Fri, 08 April 2011 17:07 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Felix

I did a quick check with the routines which are in the repository. I could confirm the crash during the reconstruction. In the moment I don't understand what's going on, so
I have to check this carefully. Unfortunately I can start only next week. Is it okay for you to work with the old version of the base directory?

The produced mc file looks okay, but the digi file is empty (no branch inside). Is this the expected result?

Ciao

Florian
Re: Problems with FairRootManager [message #11647 is a reply to message #11646] Fri, 08 April 2011 17:30 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Felix

I think I found the reason why it crashes but I have to understand why the Framework comes into this state.

Is it correct that you don't produce any digis during the runDigiFOPI.C, because this is what I see in the output file and what is in my opinion causing the crash.

Ciao

Florian
Re: Problems with FairRootManager [message #11648 is a reply to message #11647] Fri, 08 April 2011 17:40 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Hi Florian,

I probably should have mentioned this earlier... the macros are not supposed to work in the ordinary way:
What I actually do is process real data read in from an external ROOT tree in the reco macro (DataReaderTask). Here I work on existing sample objects, that is why I don't need any data being produced up to that point AT ALL.

The MC and digi macro are just there to define a reasonably large number of events and transport the parameter and geometry information through the framework.

I have used this workaround for quite a long time now to process our detector data, it was never beautiful, but also never a problem...

Does the framework support the direct processing of an (event-based) external data structure in some way that I am not aware of? Do you think this is the problem due to some recent change in the file I/O?


Cheers

Felix
Re: Problems with FairRootManager [message #11649 is a reply to message #11648] Fri, 08 April 2011 17:54 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip.t-dialin.net
Hi Felix,

in such a case like what you describe,

1. Create a FairRunAna

2. The geometry is simply introduced via:

void FairRunAna::SetGeomFile(const char* GeoFileName)

3. Do not set any input file.

4. You should introduce a task that read your input tree, or list mode file. (This task should be added as first one in the list)

5. then you run normally


regards

Mohammad
Re: Problems with FairRootManager [message #11650 is a reply to message #11649] Fri, 08 April 2011 18:34 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Hi Mohammad,

thanks for the reply.
I am afraid I don't quite understand how this should work: I have an ASCII geometry file of the chamber and we have the materials definitions file.

The materials are usually set in the FairRunSim which can't be instantiated at the same time as the FairRunAna (singleton), and FairRunAna has no method for this. On top of that, FairRunAna only takes a root file as material file ...

Can you be a bit more specific, please? Is there an example?


Cheers

Felix
Re: Problems with FairRootManager [message #11651 is a reply to message #11650] Fri, 08 April 2011 18:52 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *pools.arcor-ip.net
Hi Felix

You can adapt and use the attached file to create the geometry file. I use it for the CBM TRD geometry.

Ciao

Florian



Re: Problems with FairRootManager [message #11652 is a reply to message #11650] Fri, 08 April 2011 19:01 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip.t-dialin.net
Hi Felix,


In the FairRunAna as you have seen we only support ROOT geometry, What you can do is to create a simulation macro, set your ascii geometry as usual and then call FairRun::CreateGeometryFile(const char* geofile). with this work around you will create a TGeo Geometry of your detector and then you can use what I wrote in the last mail for the rest.

Reading the ASCII geometry from FairRunAna, this could be implemented if its really needed, the MVD group is using what I described before but they have only ROOT geometry even in the MC.

regards

Mohammad
Re: Problems with FairRootManager [message #11653 is a reply to message #11649] Sat, 09 April 2011 12:18 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Dear Mohammad, Dear Florian,

thank you very much for your prompt help!

I got the macro running again using FairRun::CreateGeometryFile() and setting it up as Mohammad explained.

However, to make it finally work, I had to hack FairRunAna:
FairRunAna::SetGeomFile() does NOT instantly set the gGeoManager pointer, instead it sets the fInputGeoFile. This is then used in FairRunAna::Init() to load the actual TGeoManager into memory.

The problem with this approach is that Init() can only be called once,
if(fIsInitialized) {
    fLogger->Fatal(MESSAGE_ORIGIN,"Error Init is already called before!");
    exit(-1);
  } else {
    fIsInitialized=kTRUE;
  }
  ...
and this has to happen after all Tasks have been added to FairRunAna in order to call the tasks' Init() - but reco tasks may require the geometry to be present during construction already (e.g. the KalmanTask)! One would have to call FairRunAna::Init() twice ...

Maybe I am overlooking some already present method to do this properly, but for now to make it work I hacked the setting of the gGeoManager pointer into the SetGeomFile() method of FairRunAna. I don't see a conceptual problem of doing that there, so maybe this should be changed ... what is your opinion?


Cheers and have a nice weekend!

Felix

Re: Problems with FairRootManager [message #11654 is a reply to message #11653] Sat, 09 April 2011 12:28 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Hi again,

Actually it was only the Kalman task accessing the TGeoManager before the calling of Init(), so for now I moved this from the constructor to Init() and we have no problem anymore. I checked it in...

This is probably cleaner... but maybe you see other cases where this might be a problem.

Enjoy the weekend!


Re: Problems with FairRootManager [message #11655 is a reply to message #11654] Mon, 11 April 2011 11:13 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Dear base developers,

apparently there still is something going wrong with initializing the gGeoManager with the external geometry...

Actually, after calling FairRunAna::Init(), the gGeoManager pointer is still invalid. I did have to use the change in FairRunAna described above to make it work after all.

Apart from that I am very happy that I can work with only one macro now, so thanks again Smile


Cheers

Felix
Re: Problems with FairRootManager [message #11656 is a reply to message #11655] Mon, 11 April 2011 11:27 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Hi,
checking mdt/MdtDigi/PndMdtDigiProducer.cxx, I am using gGeoManager inside the Init and everything is fine.
Have you added before your gGeoManager the following calls?

 FairRun* sim = FairRun::Instance();
 FairRuntimeDb* rtdb=sim->GetRuntimeDb();


In theory this should load the params and also the geometry.
(or maybe I have not well understood the problem).
Re: Problems with FairRootManager [message #11660 is a reply to message #11656] Tue, 12 April 2011 10:57 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi,

Stefano: Here the geometry comes from external file and not from the parameter container.

Felix:

We found a bug in the load geometry, it is corrected now in "r 11486".

regards.


Mohammad
Re: Problems with FairRootManager [message #11661 is a reply to message #11660] Tue, 12 April 2011 13:11 Go to previous messageGo to next message
Felix Boehmer is currently offline  Felix Boehmer
Messages: 149
Registered: May 2007
Location: Munich
first-grade participant

From: *gsi.de
Dear Mohammad,

thanks for the fix! I am glad my real data adventure lead to something useful Smile


Cheers

Felix
Re: Problems with FairRootManager [message #11662 is a reply to message #11638] Tue, 12 April 2011 13:22 Go to previous messageGo to next message
Dima Melnychuk is currently offline  Dima Melnychuk
Messages: 213
Registered: April 2004
Location: National Centre for Nucle...
first-grade participant
From: *fuw.edu.pl
Hi Mohammad,

After update to "r 11486" I have the following compilation error:
[ 88%] Building CXX object eventdisplay/CMakeFiles/EventDisplay.dir/FairEventManager.cxx.o
/home/dimam/pandaroot/pandaroot/eventdisplay/FairEventManager.cxx: In member function ‘virtual void FairEventManager::Init()’:
/home/dimam/pandaroot/pandaroot/eventdisplay/FairEventManager.cxx:48: error: ‘class FairRunAna’ has no member named ‘LoadGeometry’
make[2]: *** [eventdisplay/CMakeFiles/EventDisplay.dir/FairEventManager.cxx.o] Error 1
make[1]: *** [eventdisplay/CMakeFiles/EventDisplay.dir/all] Error 2
make: *** [all] Error 2


You have removed method FairRunAna::LoadGeometry() but it's called inside FairEventManager::Init().

Dima

Re: Problems with FairRootManager [message #11663 is a reply to message #11662] Tue, 12 April 2011 13:35 Go to previous message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Dima

The problem is fixed now.

Ciao

Florian


Previous Topic: Warnings from TPC libraries
Next Topic: Bug in LHE (fixed) and MC propagation for tracks
Goto Forum:
  


Current Time: Thu Mar 28 18:26:00 CET 2024

Total time taken to generate the page: 0.00787 seconds