#include "B2RunAction.hh" #include "G4Run.hh" #include "G4RunManager.hh"
These lines include necessary Geant4 headers and the header for this class.
B2RunAction::B2RunAction() : G4UserRunAction()
{
// set printing event number per each 100 events
G4RunManager::GetRunManager()->SetPrintProgress(1000);
}
G4UserRunAction
.SetPrintProgress(1000)
.B2RunAction::~B2RunAction() {}
The destructor is empty, indicating no special cleanup is needed.
void B2RunAction::BeginOfRunAction(const G4Run*) { //inform the runManager to save random number seed G4RunManager::GetRunManager()->SetRandomNumberStore(false); }
This method is called at the beginning of each run:
SetRandomNumberStore(false)
.void B2RunAction::EndOfRunAction(const G4Run* ) {}
This method is called at the end of each run, but it's currently empty. You could add code here to perform actions or analysis at the end of a run.
Key points about this class: