Problem 925

Summary: G4RunManager::SetNumberOfEventsToBeStored doesn't work anymore.
Product: Geant4 Reporter: Paulo Mora de Freitas <mora>
Component: runAssignee: Makoto.Asai
Status: RESOLVED FIXED    
Severity: normal CC: Gabriele.Cosmo
Priority: P2    
Version: other   
Hardware: PC   
OS: Linux   

Description Paulo Mora de Freitas 2007-01-19 02:29:15 CET
With G4 8.2 the old SetNumberOfEventsToBeStored run manager facility doesn't
work anymore. The raison, someone moved the previousEvents array
initialization from the G4RunManager::RunInitialization() method, lines 199-203
in 8.1.p02 release:

  for(size_t itr=0;itr<previousEvents->size();itr++)
  { delete (*previousEvents)[itr]; }
  previousEvents->clear();
  for(G4int i_prev=0;i_prev<n_perviousEventsToBeStored;i_prev++)
  { previousEvents->push_back((G4Event*)0); }

to inside the G4RunManager::RunTermination(), lines 288-290 in the 8.2 release.
So this array is never initialized before the first event, so the first event is
never stored, so it lets our application (MOKKA, the simulation for ILC and
Calice detectors) to crash. Obviously its a bug to be fixed in Geant4, as
people working with pileups will have the same problem.
Comment 1 asai 2007-01-19 08:46:59 CET
Thanks Paulo for finding this.
I will fix it soon.
Comment 2 asai 2007-01-19 13:25:59 CET
Fixed and tagged. To be included in the next (patch) release.