13 #include "G4TiMemory.hh"
14 #include "G4UImanager.hh"
19 TIMEMORY_AUTO_TIMER(
"");
20 InitializeEventLoop(n_event, macroFile, n_select);
23 for (G4int i_event = 0; i_event < n_event; i_event++) {
31 if (runManagerType == sequentialRM)
36 TIMEMORY_AUTO_TIMER(
"");
37 currentEvent = _SetupRandomNumbers(i_event);
39 userPrimaryGeneratorAction->GeneratePrimaries(currentEvent);
44 eventManager->ProcessOneEvent(currentEvent);
47 G4Event *newEvent =
new G4Event(currentEvent->GetEventID());
49 currentEvent = newEvent;
50 userPrimaryGeneratorAction->GeneratePrimaries(newEvent);
53 AnalyzeEvent(currentEvent);
55 if (i_event < n_select_msg)
56 G4UImanager::GetUIpointer()->ApplyCommand(msgText);
59 G4Event *GGSRunManager::_SetupRandomNumbers(G4int i_event) {
64 TIMEMORY_AUTO_TIMER(
"");
65 if (!userPrimaryGeneratorAction) {
66 G4Exception(
"G4RunManager::GenerateEvent()",
"Run0032", FatalException,
67 "G4VUserPrimaryGeneratorAction is not defined!");
73 G4Event *anEvent =
new G4Event(i_event);
75 if (storeRandomNumberStatusToG4Event == 1 || storeRandomNumberStatusToG4Event == 3) {
76 std::ostringstream oss;
77 G4Random::saveFullState(oss);
78 randomNumberStatusForThisEvent = oss.str();
79 anEvent->SetRandomNumberStatus(randomNumberStatusForThisEvent);
82 if (printModulo > 0 && anEvent->GetEventID() % printModulo == 0) {
83 G4cout <<
"--> Event " << anEvent->GetEventID() <<
" starts." << G4endl;
bool IsKilledAndToBeSimulatedAgain(const G4Event *ev)
Checks if the event has been killed and has to be re-simulated.
void ProcessOneEvent(G4int i_event)
Process a single event.
void DoEventLoop(G4int n_event, const char *macroFile, G4int n_select)
Run the event loop.
void HandleEventRngStateFile(int runID, int eventID)
Handles the read/write operations to/from the random generator state file for each event...
void DumpStatus(G4int eventID)
Prints the status of the random number generator.
void BeginOfEventSimulation()
Reset the internal flags at the beginning of event simulation.
void BeginOfEventProcessing()
Method for storing the random engine state and resetting the internal flags at the beginning event ge...