GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSRunManager.h
Go to the documentation of this file.
1 /*
2  * GGSRunManager.h
3  *
4  * Created on: 19 Oct 2013
5  * Author: Nicola Mori
6  */
7 
10 #ifndef GGSRUNMANAGER_H_
11 #define GGSRUNMANAGER_H_
12 
14 
15 #include "G4RunManager.hh"
16 class G4GenericMessenger;
17 
23 class GGSRunManager : public G4RunManager {
24 public:
29  static GGSRunManager *GetRunManager();
30 
32  GGSRunManager();
33 
36 
47  void DoEventLoop(G4int n_event, const char *macroFile, G4int n_select);
48 
65  void SetGGSGeneratorAction(G4VUserPrimaryGeneratorAction *userAction) {
66  _ggsGeneratorAction = dynamic_cast<GGSGeneratorAction *>(userAction);
67  G4RunManager::SetUserAction(userAction);
68  }
69 
71  void PrintLogVols();
72 
86  if (_ggsGeneratorAction)
87  return _nDiscardedEvsInKilledEvs + _ggsGeneratorAction->GetNDiscarded();
88  return 0;
89  }
90 
98  int GetNKilledEvents() { return _nKilledEvs; }
99 
111  void KillEvent();
112 
121 
129  bool IsCurrentEventKilled();
130 
135  const long int *GetRandomSeedsAtBeginOfEvent() { return _currEvSeeds; }
136 
137 private:
138  static GGSRunManager *_runManager;
139  G4GenericMessenger *_messenger;
140 
141  GGSGeneratorAction *_ggsGeneratorAction;
142  int _nDiscardedEvsInKilledEvs; // Total discarded events in killed events
143  int _nKilledEvs;
144  bool _isCurrEvKilled;
145  bool _simAgainKilledEv;
146  long int _currEvSeeds[2];
147 };
148 
149 #endif /* GGSRUNMANAGER_H_ */
Base class for GGS generator actions.
const long int * GetRandomSeedsAtBeginOfEvent()
Getter methos for random seeds at the beginning of the current event.
~GGSRunManager()
Destructor.
void DoEventLoop(G4int n_event, const char *macroFile, G4int n_select)
Override of G4RunManager::DoEventLoop.
GGSRunManager()
Constructor.
void SetGGSGeneratorAction(G4VUserPrimaryGeneratorAction *userAction)
Replacement of the SetUserAction method.
Definition: GGSRunManager.h:65
void PrintLogVols()
Print a list of logical volumes in current geometries.
void SimulateAgainKilledEvent()
Simulates again a killed event.
bool IsCurrentEventKilled()
Getter method for killed event flag.
static GGSRunManager * GetRunManager()
Static getter function the run manager.
int GetNDiscardedEvents()
Getter method for number of discarded events.
Definition: GGSRunManager.h:85
void KillEvent()
Kills the current event.
unsigned int GetNDiscarded() const
Returns the number of discarded events for the current event generation.
A run manager for GGS simulations.
Definition: GGSRunManager.h:23
int GetNKilledEvents()
Getter method for number of killed events.
Definition: GGSRunManager.h:98