File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,14 +44,20 @@ class O2MCApplication : public FairMCApplication
4444 /* * Define actions at the end of event */
4545 void FinishEvent () override
4646 {
47+ // update the stack
48+ fStack ->FillTrackArray ();
49+ fStack ->UpdateTrackIndex (fActiveDetectors );
50+
4751 // This special finish event version does not fill the output tree of FairRootManager
4852 // but forwards the data to the HitMerger
4953 SendData ();
5054
5155 // call end of event on active detectors
5256 for (auto det : listActiveDetectors) {
57+ det->FinishEvent ();
5358 det->EndOfEvent ();
5459 }
60+ fStack ->Reset ();
5561 }
5662
5763 /* * Define actions at the end of run */
Original file line number Diff line number Diff line change 1010
1111#include " ../macro/o2sim.C"
1212#include < SimConfig/SimConfig.h>
13+ #include < TStopwatch.h>
14+ #include < FairLogger.h>
1315
1416int main (int argc, char * argv[])
1517{
18+ TStopwatch timer;
19+ timer.Start ();
1620 auto & conf = o2::conf::SimConfig::Instance ();
1721 if (!conf.resetFromArguments (argc, argv)) {
1822 return 1 ;
@@ -21,6 +25,9 @@ int main(int argc, char* argv[])
2125 // call o2sim "macro"
2226 o2sim (false );
2327
28+ // print total time
29+ LOG (INFO) << " Simulation process took " << timer.RealTime () << " s" ;
30+
2431 // We do this instead of return 0
2532 // for the reason that we see lots of problems
2633 // with TROOTs atexit mechanism often triggering double-free or delete symptoms.
Original file line number Diff line number Diff line change 2121#include < vector>
2222#include < thread>
2323#include < signal.h>
24+ #include " TStopwatch.h"
25+ #include " FairLogger.h"
2426
2527const char * serverlogname = " serverlog" ;
2628const char * workerlogname = " workerlog" ;
@@ -30,6 +32,8 @@ const char* mergerlogname = "mergerlog";
3032// for parallel simulation
3133int main (int argc, char * argv[])
3234{
35+ TStopwatch timer;
36+ timer.Start ();
3337 std::string rootpath (getenv (" O2_ROOT" ));
3438 std::string installpath = rootpath + " /bin" ;
3539
@@ -151,7 +155,9 @@ int main(int argc, char* argv[])
151155 // wait just blocks and waits until any child returns; make sure that we wait until merger is here
152156 while ((cpid = wait (&status)) != mergerpid) {
153157 }
154- std::cout << " Merger process " << mergerpid << " returned\n " ;
158+ // This marks the actual end of the computation (since results are available)
159+ LOG (INFO) << " Merger process " << mergerpid << " returned" ;
160+ LOG (INFO) << " Simulation process took " << timer.RealTime () << " s" ;
155161
156162 // make sure the rest shuts down
157163 for (auto p : childpids) {
You can’t perform that action at this time.
0 commit comments