| Summary: | G4RunManager::SetNumberOfEventsToBeStored doesn't work anymore. | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Paulo Mora de Freitas <mora> |
| Component: | run | Assignee: | Makoto.Asai |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | Gabriele.Cosmo |
| Priority: | P2 | ||
| Version: | other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Thanks Paulo for finding this. I will fix it soon. Fixed and tagged. To be included in the next (patch) release. |
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.