#include "G4Timer.hh" #include "G4Run.hh" #include "G4ios.hh" #include "LGRunAction.hh" #include "LGEventAction.hh" #include "LGDetectorConstruction.hh" LGRunAction::LGRunAction(LGDetectorConstruction* detector_Con, LGEventAction* event_Act) : timer(new G4Timer), detector_Construction(detector_Con), event_Action(event_Act) {} LGRunAction::~LGRunAction() { delete timer; } void LGRunAction::BeginOfRunAction(const G4Run* aRun) { event_Action->resetCounters(); // reset both 'total_Photons' and 'detected_Photons' per every event G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl; // print the run id timer->Start(); } void LGRunAction::EndOfRunAction(const G4Run* aRun) { timer->Stop(); G4cout << "Number of event = " << aRun->GetNumberOfEvent() << G4endl; }