GGS(GenericGEANT4Simulation)Software  2.6.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 
17  _printModulo(500), _lastPrinted(-1) {
18 
19  _messenger = new G4GenericMessenger(this, "/GGS/");
20  _messenger->DeclareProperty("rndmPrintModulo", _printModulo,
21  "Set the number of events between two dumps on screen of the random engine status "
22  "(set to 0 to disable the dump).");
23 }
24 
25 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
26 
28  delete _messenger;
29 }
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 
33 void GGSStatusDumpAction::BeginOfEventAction(const G4Event *event) {
34  if (_printModulo != 0) {
35  G4int evtNb = event->GetEventID();
36  if (evtNb % _printModulo == 0 && evtNb > _lastPrinted) {
37  std::cout << "\n---> Begin of event: " << evtNb << std::endl;
38  std::cout << "\n--------- Random engine status --------- " << std::endl;
39  std::cout << " Seeds at begin of event generation = "
42  std::cout << " Seeds at begin of event tracking = "
43  << CLHEP::HepRandom::getTheSeeds()[0] << ", "
44  << CLHEP::HepRandom::getTheSeeds()[1] << std::endl;
45  std::cout << "---------------------------------------- " << std::endl;
46  _lastPrinted = evtNb;
47  }
48  }
49 }
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
53 void GGSStatusDumpAction::BeginOfRunAction(const G4Run *run) {
54  std::cout << "\n #### Begin of run " << run->GetRunID() << " ####" << std::endl;
55  _lastPrinted = -1;
56 }
57 
58 //....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 500 events.
GGSStatusDumpAction()
Constructor.
static GGSRunManager * GetRunManager()
Static getter function the run manager.