key4hep/k4geo

DDSim error when exiting from G4 command line

Closed this issue · 1 comments

When exiting from the Geant4 command line there is an error

Idle> exit
Graphics systems deleted.
Visualization Manager deleting...
Geant4Kernel     INFO  ++ Terminate Geant4 and delete associated actions.
Traceback (most recent call last):
  File "/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc7-opt/lcgeo/HEAD/bin/ddsim", line 16, in <module>
    RUNNER.run()
  File "/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc7-opt/lcgeo/HEAD/lib/python/DDSim/DD4hepSimulation.py", line 503, in run
    perEventTime =  eventTime / float(self.numberOfEvents)
ZeroDivisionError: float division by zero

because no events have been processed.

The problem isn't that no events have been processed. Even if you were to run some events via the command line "/run/beamOn 10" the exception would happen. Should just print "N/A" for the time, when self.numberOfEvents is 0