GGS(GenericGEANT4Simulation)Software
2.7.0
|
A run manager for GGS simulations. More...
#include <GGSRunManager.h>
Public Member Functions | |
GGSRunManager () | |
Constructor. | |
~GGSRunManager () | |
Destructor. | |
void | DoEventLoop (G4int n_event, const char *macroFile, G4int n_select) |
Override of G4RunManager::DoEventLoop. More... | |
void | SetGGSGeneratorAction (G4VUserPrimaryGeneratorAction *userAction) |
Replacement of the SetUserAction method. More... | |
void | PrintLogVols () |
Print a list of logical volumes in current geometries. | |
int | GetNDiscardedEvents () |
Getter method for number of discarded events. More... | |
int | GetNKilledEvents () |
Getter method for number of killed events. More... | |
void | KillEvent () |
Kills the current event. More... | |
void | SimulateAgainKilledEvent () |
Simulates again a killed event. More... | |
bool | IsCurrentEventKilled () |
Getter method for killed event flag. More... | |
const long int * | GetRandomSeedsAtBeginOfEvent () |
Getter methos for random seeds at the beginning of the current event. More... | |
Static Public Member Functions | |
static GGSRunManager * | GetRunManager () |
Static getter function the run manager. More... | |
A run manager for GGS simulations.
This class inherits from G4RunManager and adds some GGS-specific features.
Definition at line 23 of file GGSRunManager.h.
void GGSRunManager::DoEventLoop | ( | G4int | n_event, |
const char * | macroFile, | ||
G4int | n_select | ||
) |
Override of G4RunManager::DoEventLoop.
This override adds the possibility of re-generate and re-simulate a killed event when the killer routine calls #RedoKilled. No other change is made with respect to G4RunManager::DoEventLoop.
n_event | |
macroFile | |
n_select |
Definition at line 53 of file GGSRunManager.cpp.
|
inline |
Getter method for number of discarded events.
This method returns the number of discarded events. Discarded events are events which are generated but not simulated because they do not fulfill the acceptance criterion defined by the geometry. The counter is reset every time an event is successfully generated inside acceptance and simulated (i.e. not killed). This method will always return 0 if the particle generator does not inherit from GGSGeneratorAction.
Definition at line 85 of file GGSRunManager.h.
|
inline |
Getter method for number of killed events.
This method returns the number of killed events since the last non-killed one.
Definition at line 98 of file GGSRunManager.h.
|
inline |
Getter methos for random seeds at the beginning of the current event.
Definition at line 135 of file GGSRunManager.h.
|
static |
Static getter function the run manager.
Definition at line 22 of file GGSRunManager.cpp.
bool GGSRunManager::IsCurrentEventKilled | ( | ) |
Getter method for killed event flag.
This method returns true if SetEventAsKilled has been called during current event.
Definition at line 140 of file GGSRunManager.cpp.
void GGSRunManager::KillEvent | ( | ) |
Kills the current event.
This method can be called by user actions to kill an event. The difference between this method and G4EventManager::AbortCurrentEvent is that calling KillEvent and then SimulateAgainKilledEvent it is possible to simulate a new event without increasing the number of simulated events. In other words, when using KillEvent and SimulateAgainKilledEvent killed events won't contribute to the count of total simulated events.
Definition at line 122 of file GGSRunManager.cpp.
|
inline |
Replacement of the SetUserAction method.
This version checks whether the generator action inherits from GGSGeneratorAction and then registers it in the parent G4RunManager. The GGSGeneratorAction can then be retrieved by means of the GetGGSGeneratorAction method.
Note: use this method to register a generator action inheriting from GGSGeneratorAction (instead of the standard SetUserAction method) to take advantage of the mechanism to avoid dynamic_cast described in GetGGSGeneratorAction; that mechanism will not work if SetUserAction is used to register the generator action in the run manager, but all other functionalities will not be affected.
userAction | The user defined primary generator action. |
Definition at line 65 of file GGSRunManager.h.
void GGSRunManager::SimulateAgainKilledEvent | ( | ) |
Simulates again a killed event.
This method must be called by user actions after killing an event if the killed event has to be re-generated and re-simulated. The method #SetEventAsKilled must be called before, in order to enable re-generation and simulation, otherwise a warning message is displayed and the event is not re-generated and simulated.
Definition at line 136 of file GGSRunManager.cpp.