GGS(GenericGEANT4Simulation)Software
2.7.0
|
Computes the lost energy due to particles escaping the world volume. More...
#include <GGSLostEnergyAction.h>
Public Member Functions | |
GGSLostEnergyAction () | |
Constructor. | |
virtual | ~GGSLostEnergyAction () |
Destructor. | |
void | PostUserTrackingAction (const G4Track *track) |
Check the track end. More... | |
void | BeginOfEventAction (const G4Event *event) |
Resets the GGSTLostEnergyInfo buffer. More... | |
void | EndOfEventAction (const G4Event *event) |
Converts energies to GeV and fills the 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 | SetKineticAsLostEnergy () |
Sets the kinetic energy as lost energy. More... | |
void | SetTotalAsLostEnergy () |
Sets the total energy as lost energy. More... | |
![]() | |
GGSUserAction () | |
Constructor. More... | |
virtual | ~GGSUserAction () |
Destructor. | |
G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *) |
Override of the ClassifyNewTrack method. More... | |
Computes the lost energy due to particles escaping the world volume.
At the end of each track, this action checks if the particle reached the borders of the world volume. If so, its kinetic energy is recorded as "missing", in the sense that it escapes from the world volume. It is also possible to use total energy instead of kinetic (using the SetTotalAsLostEnergy method). This action assumes that the solid of the world volume is G4Box and that the physical world is non-rotated (but possibly translated). Note that energy deposited in non-sensitive volumes is NOT taken into account. The output will be written on a ROOT file, in a tree with one branch containing a GGSTLostEnergyInfo object. All the energies will be in GeV.
Definition at line 45 of file GGSLostEnergyAction.h.
void GGSLostEnergyAction::BeginOfEventAction | ( | const G4Event * | event | ) |
Resets the GGSTLostEnergyInfo buffer.
event | The current event. |
Definition at line 136 of file GGSLostEnergyAction.cpp.
void GGSLostEnergyAction::BeginOfRunAction | ( | const G4Run * | run | ) |
Opens the output file for the current run and prepares the output tree.
run | The current run. |
Definition at line 165 of file GGSLostEnergyAction.cpp.
void GGSLostEnergyAction::EndOfEventAction | ( | const G4Event * | event | ) |
Converts energies to GeV and fills the tree.
event | The current event. |
Definition at line 140 of file GGSLostEnergyAction.cpp.
void GGSLostEnergyAction::EndOfRunAction | ( | const G4Run * | run | ) |
Closes the output file for the current run.
run | The current run. |
Definition at line 179 of file GGSLostEnergyAction.cpp.
void GGSLostEnergyAction::PostUserTrackingAction | ( | const G4Track * | track | ) |
Check the track end.
At the end of the track, this routine checks if the track's end is due to transportation process. If so, it adds its energy to the lost energy counter if the end of the track is on a side of the world volume.
track | The current track. |
Definition at line 56 of file GGSLostEnergyAction.cpp.
|
inline |
Sets the kinetic energy as lost energy.
Invoking this method, kinetic energy will be tracked as lost energy. This is the default behavior.
Definition at line 116 of file GGSLostEnergyAction.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 99 of file GGSLostEnergyAction.h.
|
inline |
Sets the output tree name.
This name will be used for the TTree object where th hits for each event will be stored. By default, this value is set to "GCDG4" in constructor.
outTreeName | The output tree name. |
Definition at line 107 of file GGSLostEnergyAction.h.
|
inline |
Sets the total energy as lost energy.
If this method is called, total energy of escaping particles will be considered as lost energy. Note that this may lead to energy unbalance when summing up detected and lost energies, since eg. masses of nuclear fragments coming from detector's material will not be produced by the primary's energy. This is not the default behavior and has to be explicitly set.
Definition at line 127 of file GGSLostEnergyAction.h.