GGS(GenericGEANT4Simulation)Software  2.6.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:
25 
30  static GGSRunManager* GetRunManager();
31 
33  GGSRunManager();
34 
37 
48  void DoEventLoop(G4int n_event, const char* macroFile, G4int n_select);
49 
66  void SetGGSGeneratorAction(G4VUserPrimaryGeneratorAction* userAction) {
67  _ggsGeneratorAction = dynamic_cast<GGSGeneratorAction*>(userAction);
68  G4RunManager::SetUserAction(userAction);
69  }
70 
72  void PrintLogVols();
73 
87  if (_ggsGeneratorAction)
88  return _nDiscardedEvsInKilledEvs + _ggsGeneratorAction->GetNDiscarded();
89  return 0;
90  }
91 
100  return _nKilledEvs;
101  }
102 
114  void KillEvent();
115 
124 
132  bool IsCurrentEventKilled();
133 
138  const long int *GetRandomSeedsAtBeginOfEvent(){
139  return _currEvSeeds;
140  }
141 
142 
143 private:
144 
145  static GGSRunManager* _runManager;
146  G4GenericMessenger *_messenger;
147 
148  GGSGeneratorAction *_ggsGeneratorAction;
149  int _nDiscardedEvsInKilledEvs; // Total discarded events in killed events
150  int _nKilledEvs;
151  bool _isCurrEvKilled;
152  bool _simAgainKilledEv;
153  long int _currEvSeeds[2];
154 
155 };
156 
157 #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:66
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:86
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:99