GSI Helmholtzzentrum für Schwerionenforschung
Problem: implementing/using PndGeoHandling in the SciTil simulation
Hi all, at the moment I am working on an update of the implementation of the SciTil detector (barrel TOF) in pandaroot. Therefore I want to use the PndGeoHandling class to generate shortIDs for my sensitive Sensors. I tried to get an idea how to implement the class from the code of other sub detector groups which are using the class, but at least for me it seams that its not running in my code in the same way. As a first step i just tried to implement the class in the (event based) simulation stage. Therefor i defined a new variable in the PndSciT.h file PndGeoHandling* fGeoH; and modified the PndSciT.cxx file e.g. adding the following lines to the constructor if ( fGeoH == NULL ) fGeoH = PndGeoHandling::Instance(); originally i also tried to make use out of the class, but since my code was not working i reduced it now to just these 3 lines, which already cause a problem. so whats the problem: When i run the simulation (using the macro provided by macro/run/sim_complete.C) the simulation runs till the end and produces an output, but i get the following warnings at the end of the simulation. [WARNING] Function FairRun::GetWriteRunInfoFile() is depcrecated and will vanish in future versions of FairRoot. Please use FairRun::IsRunInfoGenerated() instead. [INFO ] *** PndEmcGeoPar written to ROOT file version: 4 [INFO ] *** PndSensorNamePar written to ROOT file version: 4 [INFO ] *** PndEmcDigiPar written to ROOT file version: 4 [INFO ] *** PndEmcDigiNonuniformityPar written to ROOT file version: 4 Warning in <TBufferFile::WriteObjectAny>: since FairRuntimeDb has no public constructor which can be called without argument, objects of this class can not be read with the current library. You will need to add a default constructor before attempting to read it. [INFO ] *** FairBaseParSet written to ROOT file version: 4 [INFO ] *** FairGeoParSet written to ROOT file version: 3 [INFO ] *** PndMultiFieldPar written to ROOT file version: 3 [INFO ] *** PndGeoPassivePar written to ROOT file version: 3 [INFO ] *** PndGeoSttPar written to ROOT file version: 3 [INFO ] *** PndGeoFtsPar written to ROOT file version: 3 [INFO ] *** PndRichGeoPar written to ROOT file version: 3 [INFO ] *** PndGeoSciTPar written to ROOT file version: 3 [INFO ] *** PndGeoFtofPar written to ROOT file version: 3 RealTime=46.662729 seconds, CpuTime=46.570000 seconds Test passed All ok When I now try to start the digitization stage, in which I don't changed anything (using the macro/run/digi_complete.C macro) it fails with an segmentation violation. initialisation for run id 1429623803 ************************************************************* -I- FairRunTimeDB::InitContainer() FairGeoParSet Info in <TGeoManager::CloseGeometry>: Geometry loaded from file... Info in <TGeoManager::SetTopVolume>: Top volume is cave. Master volume is cave Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100 Info in <TGeoManager::Voxelize>: Voxelizing... Info in <TGeoManager::CountLevels>: max level = 12, max placements = 4550 Info in <TGeoManager::CloseGeometry>: 2016457 nodes/ 5646 volume UID's in FAIR geometry Info in <TGeoManager::CloseGeometry>: ----------------modeler ready---------------- Container FairGeoParSet initialized from ROOT file. -I- FairRunTimeDB::InitContainer() FairBaseParSet Info in (PndGeoHandling::Instance): Making a new instance using the framework. Container FairBaseParSet initialized from ROOT file. -I container name PndGeoSttPar *** Break *** segmentation violation =========================================================== There was a crash. This is the entire stack trace of all threads: =========================================================== #0 0x00007fd4e1e5bb4c in __libc_waitpid (pid=9468, stat_loc=stat_loc entry=0x7ffdc2605080, options=options entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:31 #1 0x00007fd4e1de12e2 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148 #2 0x00007fd4e2b11723 in TUnixSystem::StackTrace() () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #3 0x00007fd4e2b1341c in TUnixSystem::DispatchSignals(ESignals) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #4 <signal handler called> #5 0x00007fd4e2ac2d61 in TCollection::RemoveAll(TCollection*) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #6 0x00007fd4d57044a5 in PndSdsHybridHitProducer::SetParContainers (this=0x2e4fc70) at /home/dominik/simulationen/pandaroot/trunk_test/sds/SdsDigi/PndSdsHybridHitProducer.cxx:156 #7 0x00007fd4d53cbc71 in PndMvdHybridHitProducer::SetParContainers (this=0x2e4fc70) at /home/dominik/simulationen/pandaroot/trunk_test/mvd/MvdDigi/PndMvdHybridHitProducer.cxx:63 #8 0x00007fd4d78f34d9 in FairTask::SetParTask (this=0x2e4fc70) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:91 #9 0x00007fd4d78f3475 in FairTask::SetParTasks (this=0xffffffff) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:155 #10 0x00007fd4d78f3475 in FairTask::SetParTasks (this=0xffffffff) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:155 #11 0x00007fd4d78f34e2 in FairTask::SetParTask (this=<optimized out>) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:92 #12 0x00007fd4d78eca22 in FairRunAna::Init (this=0x2782a80) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairRunAna.cxx:244 #13 0x00007fd4d7961b55 in G__G__BaseDict_785_0_5 (result7=0x7ffdc2608760, funcname=<optimized out>, libp=<optimized out>, hash=<optimized out>) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/build/base/G__BaseDict.cxx:13233 #14 0x00007fd4e146495d in Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #15 0x00007fd4e1508ba7 in G__execute_call () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #16 0x00007fd4e1508f65 in G__call_cppfunc () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #17 0x00007fd4e14e850f in G__interpret_func () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #18 0x00007fd4e14d5c99 in G__getfunction () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #19 0x00007fd4e15befb5 in G__getstructmem(int, G__FastAllocString&, char*, int, char*, int*, G__var_array*, int) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #20 0x00007fd4e15b64ae in G__getvariable () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #21 0x00007fd4e14afb1f in G__getitem () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #22 0x00007fd4e14b54c5 in G__getexpr () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #23 0x00007fd4e153846d in G__exec_statement () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #24 0x00007fd4e14e9a6c in G__interpret_func () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #25 0x00007fd4e14d5cf7 in G__getfunction () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #26 0x00007fd4e14b0022 in G__getitem () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #27 0x00007fd4e14b54c5 in G__getexpr () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #28 0x00007fd4e14c0d9b in G__calc_internal () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #29 0x00007fd4e1547b7f in G__process_cmd () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCint.so.5.34 #30 0x00007fd4e2ad5640 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #31 0x00007fd4e2ad1d0b in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #32 0x00007fd4e2a3fb7c in TApplication::ExecuteFile(char const*, int*, bool) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #33 0x00007fd4e2a3f0b0 in TApplication::ProcessLine(char const*, bool, int*) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #34 0x00007fd4e268c209 in TRint::HandleTermInput() () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libRint.so.5.34 #35 0x00007fd4e2b12be5 in TUnixSystem::CheckDescriptors() () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #36 0x00007fd4e2b1370a in TUnixSystem::DispatchOneEvent(bool) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #37 0x00007fd4e2a96cf6 in TSystem::InnerLoop() () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #38 0x00007fd4e2a97900 in TSystem::Run() () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #39 0x00007fd4e2a3d2af in TApplication::Run(bool) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #40 0x00007fd4e268d3be in TRint::Run(bool) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libRint.so.5.34 #41 0x0000000000400fdc in main () =========================================================== The lines below might hint at the cause of the crash. If they do not help you then please submit a bug report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace from above as an attachment in addition to anything else that might help us fixing this issue. =========================================================== #5 0x00007fd4e2ac2d61 in TCollection::RemoveAll(TCollection*) () from /home/dominik/simulationen/pandaroot/fairsoft/mar15/lib/root/libCore.so.5.34 #6 0x00007fd4d57044a5 in PndSdsHybridHitProducer::SetParContainers (this=0x2e4fc70) at /home/dominik/simulationen/pandaroot/trunk_test/sds/SdsDigi/PndSdsHybridHitProducer.cxx:156 #7 0x00007fd4d53cbc71 in PndMvdHybridHitProducer::SetParContainers (this=0x2e4fc70) at /home/dominik/simulationen/pandaroot/trunk_test/mvd/MvdDigi/PndMvdHybridHitProducer.cxx:63 #8 0x00007fd4d78f34d9 in FairTask::SetParTask (this=0x2e4fc70) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:91 #9 0x00007fd4d78f3475 in FairTask::SetParTasks (this=0xffffffff) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:155 #10 0x00007fd4d78f3475 in FairTask::SetParTasks (this=0xffffffff) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:155 #11 0x00007fd4d78f34e2 in FairTask::SetParTask (this=<optimized out>) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairTask.cxx:92 #12 0x00007fd4d78eca22 in FairRunAna::Init (this=0x2782a80) at /home/dominik/simulationen/pandaroot/fairsoft/fairroot/v-15.03_source/base/steer/FairRunAna.cxx:244 =========================================================== I'm now trying since half a week to fix this, but i still have now Idea. so maybe someone who knows how to use the PndGeoHandling Class can explain me how to implement it in the code. kind regards Dominik Steinschaden
Re: Problem: implementing/using PndGeoHandling in the SciTil simulation
I implemented the lines in the constructor of the PndSciT class, which is loaded in the simulation stage // ----- Default constructor ------------------------------------------- PndSciT::PndSciT() : FairDetector(), fSciTCollection(0), fGeoH(NULL) { fSciTCollection = new TClonesArray("PndSciTPoint"); fVerboseLevel = 0; fListOfSensitives.push_back("SENSOR");//Root_Test.root // Volumes containing "SENSOR" in the name will be processed in the process hit funktion if ( fGeoH == NULL ) fGeoH = PndGeoHandling::Instance(); } // ------------------------------------------------------------------------- // ----- Standard constructor ------------------------------------------ PndSciT::PndSciT(const char* name, Bool_t active) : FairDetector(name, active), fSciTCollection(0), fGeoH(NULL) { fSciTCollection = new TClonesArray("PndSciTPoint"); fVerboseLevel = 0; fListOfSensitives.push_back("SENSOR");//Root_Test.root // Volumes containing "SENSOR" in the name will be processed in the process hit funktion if ( fGeoH == NULL ) fGeoH = PndGeoHandling::Instance(); } But this is already causing problems even if I'm not using the PndGeoHandling in the Initialation() or the processHits() funktion to produce the shortIDs.
I have just tried and it worked. sim and digi run fine. Maybe you messed up something. If you prefer I can commit my version so that you can use it as starting point.
I installed a complete new Trunk version of pandaroot now, and just implemented the lines i posted before. In addition to be able to compile the code I included #include "PndGeoHandling.h" to the header file and I modified the "CMakeLists.txt" in the SciTil folder to Include the PndGeoHandling as shown below.Set (INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/field ${CMAKE_SOURCE_DIR}/pnddata ${CMAKE_SOURCE_DIR}/pnddata/SciTData ${CMAKE_SOURCE_DIR}/scitil ${CMAKE_SOURCE_DIR}/genfit ${CMAKE_SOURCE_DIR}/PndTools/generalTools # <------------------- Added for PndGeoHandling ) set(DEPENDENCIES Base GeoBase ParBase PndData AnalysisTools generalTools) # <------------- added generalTools Maybe i have done anything wrong here. So if the code is running fine in your test, could you be so kind and commit it to the trunk, so i can just download it and have a look what is wrong in my code, and use your code as a starting point as you suggested. kind regards Dominik Steinschaden
Tank you. As you said your code is working fine. the strange thing is, that for me your code seems to be exactly the same as my code. Edit: i see now that you also did some changes to the CMakelists.tx Thanks for the help i will take the last Trunk version now as a starting point. And if i find my the error i will post it.
Without the files you are using, it is hard to understand what could be gone wrong.