GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Fast Simulations » Running analysis task in simfast macro
Running analysis task in simfast macro [message #16852] Fri, 27 June 2014 16:09 Go to next message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *gsi.de
Hi all,


as discussed today in the meeting, Ralf and I just fixed the issue with adding the analysis task in the simfast_opt.C macro. Please update fsim and PndTools/AnalysisTools. The only thing you need to change in the Exec routine of the analysis task is to replace

  fAnalysis->GetEvent();  -->  fAnalysis->GetEventInTask();

and in order to switch off the output, change in simfast.C/simfast_opt.C
PndFastSim* fastSim = new PndFastSim();  -->  PndFastSim* fastSim = new PndFastSim(false);

(boolean parameter steers persistency) and everything should work as expected.


Best,
Klaus
Re: Running analysis task in simfast macro [message #16853 is a reply to message #16852] Fri, 27 June 2014 16:31 Go to previous messageGo to next message
donghee is currently offline  donghee
Messages: 385
Registered: January 2009
Location: Germnay
first-grade participant
From: *dip0.t-ipconnect.de
Hi Klaus,

I think that the feature looks quite useful.
But still I am wondering one thing.
I am using PndScrutAnaTask which is needed to compile the code. because it would be faster than root script.
If I want to combine analysis task in fastsim, then I have to put below line into the simfast_opt.C with switch off option as you mentioned.

PndScrutAnaTask *scrutTask = new PndScrutAnaTask();
fRun->AddTask(scrutTask);

Is it correct way?

Have a nice weekend,
Donghee
Re: Running analysis task in simfast macro [message #16854 is a reply to message #16852] Fri, 27 June 2014 16:41 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: *gsi.de
Hi Donghee,


exactly. The structure of my macro looks like

  
  ...
  PndFastSim* fastSim = new PndFastSim(false);
        
  // ... lots of stuff
  
  fRun->AddTask(fastSim);
	
  PndScrutAnaTask *scrutTask = new PndScrutAnaTask(pbarmom, outfile);
  fRun->AddTask(scrutTask);
  
  fRun->Init();
  fRun->Run(nEvents);
  ...


Best,
Klaus
Re: Running analysis task in simfast macro [message #16855 is a reply to message #16854] Fri, 27 June 2014 16:42 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
Thanks guys for the fast fix.
Re: Running analysis task in simfast macro [message #16858 is a reply to message #16854] Fri, 27 June 2014 16:52 Go to previous messageGo to next message
donghee is currently offline  donghee
Messages: 385
Registered: January 2009
Location: Germnay
first-grade participant
From: *dip0.t-ipconnect.de
Hi Klaus,

This is really good application.

Best wishes,
Donghee
Re: Running analysis task in simfast macro [message #16888 is a reply to message #16852] Tue, 01 July 2014 12:03 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 140.181.11*
Hi,
I haver just tried with the latest trunk, I modified the fAnalysis->GetEventInTime, I wrote the PndScrutTask in the simfast_opt macro, together with the ForceField line. But the output file has still an empty tuple.
What I did wrong? or maybe you introduced the change only in the scrut?
Re: Running analysis task in simfast macro [message #16893 is a reply to message #16888] Wed, 02 July 2014 10:55 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 140.181.11*
Ok, my fault, now it works (I forgot to read the scrut folder in the macro cmakelist, and I was using an old library without the last changes).

However, at present we can skip the storage of fastsim TClonesArrays, but not the MCTrack TCLonesArray, with substantially no gain at all.
I asked Florian how to switch off the storage of MCTrack, let's see... maybe this will require a modification of the base packages.
Re: Running analysis task in simfast macro [message #16949 is a reply to message #16893] Sun, 06 July 2014 19:37 Go to previous messageGo to next message
Malte Albrecht is currently offline  Malte Albrecht
Messages: 11
Registered: May 2012
occasional visitor
From: *adsl.alicedsl.de
Hi,

I also tried it using the PndScrutAnaTask and simfast_opt.C with the changes Klaus posted here. It works fine, but besides the (nicely small!) output file of the analysis task i get an output file of FastSim, which is about 180Mb/1Mio DPM events. I guess that is the MCTrack TClonesArrays Stefano mentioned...
Are there any news on the issue how to get rid of this output?

Best regards,
Malte
Re: Running analysis task in simfast macro [message #16950 is a reply to message #16949] Sun, 06 July 2014 19:53 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 140.181.11*
At present, the only think you can do is to change the PndStack and hardcode a kFALSE instead of a kTRUE:

MacBook-Pro-di-Stefano:run spataro$ svn diff ../../pnddata/PndStack.cxx 
Index: ../../pnddata/PndStack.cxx
===================================================================
--- ../../pnddata/PndStack.cxx	(revision 25514)
+++ ../../pnddata/PndStack.cxx	(working copy)
@@ -384,7 +384,7 @@
 
 // -----   Public method Register   ----------------------------------------
 void PndStack::Register() {
-  FairRootManager::Instance()->Register("MCTrack", "Stack", fTracks,kTRUE);
+  FairRootManager::Instance()->Register("MCTrack", "Stack", fTracks,kFALSE);
 }
 // -------------------------------------------------------------------------


Other changes need a modification of the base packages, which is something we cannot do directly and in a short time.
Re: Running analysis task in simfast macro [message #16951 is a reply to message #16950] Mon, 07 July 2014 02:03 Go to previous messageGo to next message
Malte Albrecht is currently offline  Malte Albrecht
Messages: 11
Registered: May 2012
occasional visitor
From: *adsl.alicedsl.de
Hi Stefano,

i changed the line you suggested and ran the job again:

Now it crashes after several thousand events, leaving me with the following stacktrace:

evt 60200
evt: 60300
evt 60300
evt: 60400
evt 60400
evt: 60500
evt 60500

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
    stat_loc=0x7fff77f96e9c, options=<value optimized out>)
    at ../sysdeps/unix/sysv/linux/waitpid.c:32
#0  0x00007f009768483e in __libc_waitpid (pid=<value optimized out>, 
    stat_loc=0x7fff77f96e9c, options=<value optimized out>)
    at ../sysdeps/unix/sysv/linux/waitpid.c:32
#1  0x00007f00976222c9 in do_system (line=<value optimized out>)
    at ../sysdeps/posix/system.c:149
#2  0x00007f009853ddb8 in TUnixSystem::StackTrace() ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#3  0x00007f009853d6a3 in TUnixSystem::DispatchSignals(ESignals) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#4  <signal handler called>
#5  0x00007f008e46aa33 in RhoCalculationTools::GetBz (pos=...)
    at /hera/panda/malte/scrut14/rho/RhoTools/RhoCalculationTools.cxx:35
#6  0x00007f008ed0a9e6 in PndKinFitter::SetOutput (this=0x7fff77f99c30)
    at /hera/panda/malte/scrut14/PndTools/AnalysisTools/Fitter/PndKinFitter.cxx:190
#7  0x00007f008ed09b0a in PndKinFitter::Fit (this=0x7fff77f99c30)
    at /hera/panda/malte/scrut14/PndTools/AnalysisTools/Fitter/PndKinFitter.cxx:93
#8  0x00007f008da608c6 in PndScrutAnaTask::Exec (this=0x1297d70, 
    opt=0x7f008ff740e0 "")
    at /hera/panda/malte/scrut14/macro/scrut/PndScrutAnaTask.cxx:168
#9  0x00007f00984c4fea in TTask::ExecuteTasks(char const*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#10 0x00007f00984c4ffe in TTask::ExecuteTasks(char const*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#11 0x00007f00984c434e in TTask::ExecuteTask(char const*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#12 0x00007f008fe74db2 in FairMCApplication::FinishEvent (this=0x19b9810)
    at /hera/panda/malte/scrut14/base/sim/FairMCApplication.cxx:521
#13 0x00007f008bfe5e62 in TGeant3::ProcessRun(int) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/libgeant321.so
#14 0x00007f008fe73870 in FairMCApplication::RunMC (this=0x19b9810, 
    nofEvents=100000)
    at /hera/panda/malte/scrut14/base/sim/FairMCApplication.cxx:246
#15 0x00007f008fe63e60 in FairRunSim::Run (this=0x13e0ec0, NEvents=100000, 
    NotUsed=0) at /hera/panda/malte/scrut14/base/steer/FairRunSim.cxx:372
#16 0x00007f008fed4ba1 in G__G__BaseDict_775_0_7 (result7=0x7fff77fa6b00, 
    funcname=0x13dcc50 "", libp=0x7fff77f9c0f0, hash=0)
    at /hera/panda/malte/scrut14/buildPanda/base/G__BaseDict.cxx:11663
#17 0x00007f0096a9e369 in Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#18 0x00007f0096b42331 in G__execute_call ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#19 0x00007f0096b43192 in G__call_cppfunc ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#20 0x00007f0096b203a8 in G__interpret_func ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#21 0x00007f0096b0e030 in G__getfunction ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#22 0x00007f0096bffbda in G__getstructmem(int, G__FastAllocString&, char*, int, char*, int*, G__var_array*, int) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#23 0x00007f0096bf8394 in G__getvariable ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#24 0x00007f0096aeaf6d in G__getitem ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#25 0x00007f0096af0288 in G__getexpr ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#26 0x00007f0096b701f7 in G__exec_statement ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#27 0x00007f0096b21773 in G__interpret_func ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#28 0x00007f0096b0e08f in G__getfunction ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#29 0x00007f0096aeb6ee in G__getitem ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#30 0x00007f0096af0288 in G__getexpr ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#31 0x00007f0096af97b8 in G__calc_internal ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#32 0x00007f0096b7f91e in G__process_cmd ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCint.so.5.34
#33 0x00007f00984fa046 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#34 0x00007f00984f79c3 in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#35 0x00007f009844f558 in TApplication::ExecuteFile(char const*, int*, bool) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#36 0x00007f009844ce53 in TApplication::ProcessLine(char const*, bool, int*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#37 0x00007f00980a0328 in TRint::Run(bool) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libRint.so.5.34
#38 0x000000000040115c in main ()
#39 0x00007f0097602c8d in __libc_start_main (main=<value optimized out>, 
    argc=<value optimized out>, ubp_av=<value optimized out>, 
    init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=0x7fff77fbcab8)
    at libc-start.c:228
#40 0x0000000000401029 in _start ()
===========================================================


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  0x00007f008e46aa33 in RhoCalculationTools::GetBz (pos=...)
    at /hera/panda/malte/scrut14/rho/RhoTools/RhoCalculationTools.cxx:35
#6  0x00007f008ed0a9e6 in PndKinFitter::SetOutput (this=0x7fff77f99c30)
    at /hera/panda/malte/scrut14/PndTools/AnalysisTools/Fitter/PndKinFitter.cxx:190
#7  0x00007f008ed09b0a in PndKinFitter::Fit (this=0x7fff77f99c30)
    at /hera/panda/malte/scrut14/PndTools/AnalysisTools/Fitter/PndKinFitter.cxx:93
#8  0x00007f008da608c6 in PndScrutAnaTask::Exec (this=0x1297d70, 
    opt=0x7f008ff740e0 "")
    at /hera/panda/malte/scrut14/macro/scrut/PndScrutAnaTask.cxx:168
#9  0x00007f00984c4fea in TTask::ExecuteTasks(char const*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#10 0x00007f00984c4ffe in TTask::ExecuteTasks(char const*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#11 0x00007f00984c434e in TTask::ExecuteTask(char const*) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/root/libCore.so.5.34
#12 0x00007f008fe74db2 in FairMCApplication::FinishEvent (this=0x19b9810)
    at /hera/panda/malte/scrut14/base/sim/FairMCApplication.cxx:521
#13 0x00007f008bfe5e62 in TGeant3::ProcessRun(int) ()
   from /cvmfs/fairroot.gsi.de/fairsoft/apr13/lib/libgeant321.so
#14 0x00007f008fe73870 in FairMCApplication::RunMC (this=0x19b9810, 
    nofEvents=100000)
    at /hera/panda/malte/scrut14/base/sim/FairMCApplication.cxx:246
#15 0x00007f008fe63e60 in FairRunSim::Run (this=0x13e0ec0, NEvents=100000, 
    NotUsed=0) at /hera/panda/malte/scrut14/base/steer/FairRunSim.cxx:372
===========================================================


Root > Function simfast_opt() busy flag cleared


Every time I run it, the crash occurs after a different number of events. This may be due to the fact that I cannot generate the _same_ events again, using exactly the same random seed (can I??).

How to deal with this error?

Best regards,
Malte
Re: Running analysis task in simfast macro [message #16952 is a reply to message #16951] Mon, 07 July 2014 09:04 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: *gsi.de
Hi Malte,

You need the following line in your macro:
        RhoCalculationTools::ForceConstantBz(20.0);


The reason is that FairRunAna would be required from RhoCalculationTools to get the magnetic field. However in simulation it tis FairRunSim.

Cheers
Ralf
Re: Running analysis task in simfast macro [message #16953 is a reply to message #16952] Mon, 07 July 2014 09:11 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 140.181.11*
However, if you put a gRandom->SetSeed(XXXXX), where XXXXX is your seed number, in theory you should be able to have exactly the same numbers from the simulation.
Re: Running analysis task in simfast macro [message #17281 is a reply to message #16953] Fri, 12 September 2014 10:27 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *lnf.infn.it
And? Did it work?
Previous Topic: One technical problem for vertex or 4c fitter in the analysis task
Next Topic: Mc Truth Match
Goto Forum:
  


Current Time: Thu Mar 28 17:18:10 CET 2024

Total time taken to generate the page: 0.00737 seconds