AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
47 stars 93 forks source link

[ddsim] Get total number of events and time per event right #1257

Closed BrieucF closed 2 months ago

BrieucF commented 2 months ago

I realized while running on an externally generated file, with the option -N -1, that the total number of event and the time per event were wrong.

There is one too many event in e.g. m_evtTotal: https://github.com/AIDASoft/DD4hep/blob/master/DDG4/src/Geant4GeneratorActionInit.cpp#L48

Geant4Output2EDM4hep INFO  +++ Saving EDM4hep event 0 run 0.
GenerationInit   INFO  +++ Initializing event 2. Within run:0 event 2.
UI               INFO  ++ End of file reached, ending run...
GenerationInit   WARN  +++ Finished run 0 after 2 events (2 events in total)

while I have only one event.

And the time per event is reported as negative due to the -1 flag:

DDSim            INFO DDSim            INFO  StartUp Time: 8.60 s, Event Processing: 351.13 s (-351.13 s/Event)

Here is a reproducer [1], let me know if you need a more streamlined one.

[1]

source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh
ddsim --compactFile $K4GEO/FCCee/IDEA/compact/IDEA_o1_v02/IDEA_o1_v02.xml --inputFiles /afs/cern.ch/user/b/brfranco/work/public/background_studies/k4geo/pairs_1.pairs --outputFile IDEA_01_v03_pairs_1.root -N -1
andresailer commented 2 months ago

Thanks for reporting this @BrieucF , it is fixed now.

BrieucF commented 2 months ago

Thanks to you!