GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSStatusDumpAction.cpp
Go to the documentation of this file.
1 /*
2  * GGSStatusDumpAction.cpp
3  *
4  * Created on: 29 Dec 2011
5  * Author: Nicola mori
6  */
7 
12 
13 #include "G4GenericMessenger.hh"
14 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
15 
16 GGSStatusDumpAction::GGSStatusDumpAction() : _printModulo(500), _lastPrinted(-1) {
17 
18  _messenger = new G4GenericMessenger(this, "/GGS/");
19  _messenger->DeclareProperty("rndmPrintModulo", _printModulo,
20  "Set the number of events between two dumps on screen of the random engine status "
21  "(set to 0 to disable the dump).");
22 }
23 
24 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
25 
27 
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 
30 void GGSStatusDumpAction::BeginOfEventAction(const G4Event *event) {
31  if (_printModulo != 0) {
32  G4int evtNb = event->GetEventID();
33  if (evtNb % _printModulo == 0 && evtNb > _lastPrinted) {
34  std::cout << "\n---> Begin of event: " << evtNb << std::endl;
35  std::cout << "\n--------- Random engine status --------- " << std::endl;
36  std::cout << " Seeds at begin of event generation = "
39  std::cout << " Seeds at begin of event tracking = " << CLHEP::HepRandom::getTheSeeds()[0] << ", "
40  << CLHEP::HepRandom::getTheSeeds()[1] << std::endl;
41  std::cout << "---------------------------------------- " << std::endl;
42  _lastPrinted = evtNb;
43  }
44  }
45 }
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
49 void GGSStatusDumpAction::BeginOfRunAction(const G4Run *run) {
50  std::cout << "\n #### Begin of run " << run->GetRunID() << " ####" << std::endl;
51  _lastPrinted = -1;
52 }
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void BeginOfRunAction(const G4Run *run)
Dumps the run number.
const long int * GetRandomSeedsAtBeginOfEvent()
Getter methos for random seeds at the beginning of the current event.
virtual ~GGSStatusDumpAction()
Destructor.
void BeginOfEventAction(const G4Event *event)
Dumps the simulation status every N events.
GGSStatusDumpAction()
Constructor.
static GGSRunManager * GetRunManager()
Static getter function the run manager.