GGS(GenericGEANT4Simulation)Software
2.6.0
|
Action which finds the hadronic interaction points for each primary particle. More...
#include <GGSHadrIntAction.h>
Public Member Functions | |
GGSHadrIntAction () | |
Constructor. | |
virtual | ~GGSHadrIntAction () |
Destructor. | |
void | PreUserTrackingAction (const G4Track *track) |
Initialization of primary track. More... | |
void | PostUserTrackingAction (const G4Track *track) |
Check the track end for a hadronic interaction. More... | |
void | BeginOfEventAction (const G4Event *event) |
Clears the interaction arrays. More... | |
void | EndOfEventAction (const G4Event *event) |
Fills the output tree. More... | |
void | BeginOfRunAction (const G4Run *run) |
Opens the output file for the current run and prepares the output tree. More... | |
void | EndOfRunAction (const G4Run *run) |
Closes the output file for the current run. More... | |
void | SetOutputFileBase (const std::string &outFileBase) |
Sets the output file base name. More... | |
void | SetOutputTreeName (const std::string &outTreeName) |
Sets the output tree name. More... | |
void | SetEnergyFraction (double fraction) |
Sets the maximum secondary energy fraction for hadronic interactions. More... | |
void | SetOutputOfProducts (bool output) |
Toggles the output of hadronic interaction products. More... | |
![]() | |
GGSUserAction () | |
Constructor. More... | |
virtual | ~GGSUserAction () |
Destructor. | |
G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *) |
Override of the ClassifyNewTrack method. More... | |
Action which finds the hadronic interaction points for each primary particle.
This class distinguish quasi-elastic interactions from inelastic ones, providing a list of information for both interactions categories for each primary particle.
Definition at line 39 of file GGSHadrIntAction.h.
void GGSHadrIntAction::BeginOfEventAction | ( | const G4Event * | event | ) |
Clears the interaction arrays.
event | The current event. |
Definition at line 148 of file GGSHadrIntAction.cpp.
void GGSHadrIntAction::BeginOfRunAction | ( | const G4Run * | run | ) |
Opens the output file for the current run and prepares the output tree.
run | The current run. |
Definition at line 168 of file GGSHadrIntAction.cpp.
void GGSHadrIntAction::EndOfEventAction | ( | const G4Event * | event | ) |
Fills the output tree.
event | The current event. |
Definition at line 156 of file GGSHadrIntAction.cpp.
void GGSHadrIntAction::EndOfRunAction | ( | const G4Run * | run | ) |
Closes the output file for the current run.
run | The current run. |
Definition at line 187 of file GGSHadrIntAction.cpp.
void GGSHadrIntAction::PostUserTrackingAction | ( | const G4Track * | track | ) |
Check the track end for a hadronic interaction.
For each followed particle, this routine will check if a hadronic interaction has happened. If no particle identical to the primary and carrying more than a specified fraction of the energy of the primary is produced, the interaction point is recorded as "inelastic". Otherwise, it is recorded as "quasi-elastic", the secondary carrying most of the energy is tagged as the new primary and followed until an inelastic interaction or the end of the event.
track | The current track. |
Definition at line 57 of file GGSHadrIntAction.cpp.
void GGSHadrIntAction::PreUserTrackingAction | ( | const G4Track * | track | ) |
Initialization of primary track.
This routine checks if the current track belongs to a primary particle, and in affirmative case it adds it to the followed particles vector
track | The current track. |
Definition at line 44 of file GGSHadrIntAction.cpp.
|
inline |
Sets the maximum secondary energy fraction for hadronic interactions.
To to tag "inelastic" interactions, the produced secondaries which are identical to the primary are requested to carry less than a fraction of the primary's energy. This routine sets this fraction, which default value is set in constructor.
fraction | The maximum secondary energy fraction. |
Definition at line 126 of file GGSHadrIntAction.h.
|
inline |
Sets the output file base name.
The file base name can be with or without extension (.root will be automatically used as extension). For each run, the run number will be appended to the base name before the .root extension. If no value is provided the file base name will fallback to the default value set in GSRootFileservice. *
outFileBase | The output file base name. |
Definition at line 104 of file GGSHadrIntAction.h.
|
inline |
Toggles the output of hadronic interaction products.
output | If true the products of the interaction will be saved in the file. |
Definition at line 134 of file GGSHadrIntAction.h.
|
inline |
Sets the output tree name.
This name will be used for the TTree object where the hits for each event will be stored. By default, this value is set to "HadrInt" in constructor.
outTreeName | The output tree name. |
Definition at line 114 of file GGSHadrIntAction.h.