Problem 925 - G4RunManager::SetNumberOfEventsToBeStored doesn't work anymore.
Summary: G4RunManager::SetNumberOfEventsToBeStored doesn't work anymore.
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: run (show other problems)
Version: other
Hardware: PC Linux
: P2 normal
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2007-01-19 02:29 CET by Paulo Mora de Freitas
Modified: 2007-01-19 13:25 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.