LDMX Software
|
Provides user defined information to associate with a Geant4 track. More...
#include <UserTrackInformation.h>
Public Member Functions | |
UserTrackInformation ()=default | |
Constructor. | |
void | initialize (const G4Track *track) |
Initialize the track information with the passed track. | |
void | Print () const override |
Print the information associated with the track. | |
bool | getSaveFlag () const |
Get the flag which indicates whether this track should be saved as a Trajectory. | |
void | setSaveFlag (bool saveFlag) |
Set the save flag so the associated track will be persisted as a Trajectory. | |
bool | isBremCandidate () const |
Check whether this track is a brem candidate. | |
void | tagBremCandidate (bool isBremCandidate=true) |
Tag this track as a brem candidate by the biasing filters. | |
bool | isRecoilElectron () const |
Check whether this track is a recoil electron. | |
void | tagRecoilElectron (bool isRecoilElectron=true) |
Tag this track as a recoil electron by the biasing filters. | |
bool | isPNGamma () const |
Check whether this track is a photon that has undergone a photo-nuclear reaction. | |
void | tagPNGamma (bool isPNGamma=true) |
Tag this track as a photon that has undergone a photo-nuclear reaction. | |
const G4ThreeVector & | getInitialMomentum () const |
Get the initial momentum 3-vector of the track [MeV]. | |
std::string | getVertexVolume () const |
Get the name of the volume that this track was created in. | |
double | getVertexTime () const |
Get the global time at which this track was created. | |
Static Public Member Functions | |
static UserTrackInformation * | get (const G4Track *track) |
get | |
Private Attributes | |
bool | saveFlag_ {false} |
Flag for saving the track as a Trajectory. | |
bool | isBremCandidate_ {false} |
Flag indicating whether this track is a brem candidate. | |
bool | isRecoilElectron_ {false} |
Flag indicating whether this track is a recoil electron. | |
bool | isPNGamma_ {false} |
Flag indicating whether this track has undergone a photo-nuclear reaction. | |
std::string | vertexVolume_ {""} |
Volume the track was created in. | |
double | vertex_time_ {0.} |
Global Time of Creation. | |
G4ThreeVector | initialMomentum_ |
The initial momentum of the track. | |
Provides user defined information to associate with a Geant4 track.
This is helpful for keeping track of information we care about that Geant4 doesn't persist by default.
Definition at line 16 of file UserTrackInformation.h.
|
static |
get
A static helper function for getting the track information from the passed G4Track. If the track doesn't have an information attached, a new one is created.
[in] | track | G4Track to get information from |
Definition at line 10 of file UserTrackInformation.cxx.
Referenced by simcore::g4user::TrackingAction::PostUserTrackingAction(), biasing::EcalDarkBremFilter::PostUserTrackingAction(), biasing::utility::DecayChildrenKeeper::PostUserTrackingAction(), biasing::utility::TrackProcessFilter::PostUserTrackingAction(), simcore::g4user::TrackingAction::PreUserTrackingAction(), simcore::TrackMap::save(), biasing::MidShowerDiMuonBkgdFilter::save(), biasing::MidShowerNuclearBkgdFilter::save(), biasing::DeepEcalProcessFilter::stepping(), biasing::EcalProcessFilter::stepping(), biasing::NonFiducialFilter::stepping(), biasing::PhotoNuclearProductsFilter::stepping(), biasing::PhotoNuclearTopologyFilter::stepping(), biasing::TargetBremFilter::stepping(), and biasing::TargetProcessFilter::stepping().
|
inline |
Get the initial momentum 3-vector of the track [MeV].
Definition at line 126 of file UserTrackInformation.h.
References initialMomentum_.
Referenced by simcore::TrackMap::save().
|
inline |
Get the flag which indicates whether this track should be saved as a Trajectory.
Definition at line 59 of file UserTrackInformation.h.
References saveFlag_.
|
inline |
Get the global time at which this track was created.
Definition at line 136 of file UserTrackInformation.h.
References vertex_time_.
|
inline |
Get the name of the volume that this track was created in.
Definition at line 131 of file UserTrackInformation.h.
References vertexVolume_.
void simcore::UserTrackInformation::initialize | ( | const G4Track * | track | ) |
Initialize the track information with the passed track.
We assume the passed track is newly created so we can copy its "current" kinematics and define those kinematics to be the "vertex" kinematics.
Even though we are "initializing" the track, we only change the kinematic values. The boolean flags may have been edited prior to the track reaching its own processing phase (where it is initialized), so those flags should (and are) not changed here.
Definition at line 17 of file UserTrackInformation.cxx.
References initialMomentum_, vertex_time_, and vertexVolume_.
Referenced by simcore::g4user::TrackingAction::PreUserTrackingAction().
|
inline |
Check whether this track is a brem candidate.
Definition at line 74 of file UserTrackInformation.h.
References isBremCandidate_.
Referenced by tagBremCandidate().
|
inline |
Check whether this track is a photon that has undergone a photo-nuclear reaction.
Definition at line 110 of file UserTrackInformation.h.
References isPNGamma_.
Referenced by tagPNGamma().
|
inline |
Check whether this track is a recoil electron.
Definition at line 91 of file UserTrackInformation.h.
References isRecoilElectron_.
Referenced by tagRecoilElectron().
|
override |
Print the information associated with the track.
Definition at line 22 of file UserTrackInformation.cxx.
References isBremCandidate_, and saveFlag_.
|
inline |
Set the save flag so the associated track will be persisted as a Trajectory.
[in] | saveFlag | True to save the associated track. |
Definition at line 67 of file UserTrackInformation.h.
References saveFlag_.
Referenced by biasing::EcalDarkBremFilter::PostUserTrackingAction(), biasing::utility::DecayChildrenKeeper::PostUserTrackingAction(), biasing::utility::TrackProcessFilter::PostUserTrackingAction(), biasing::MidShowerDiMuonBkgdFilter::save(), and biasing::MidShowerNuclearBkgdFilter::save().
|
inline |
Tag this track as a brem candidate by the biasing filters.
[in] | isBremCandidate | flag indicating whether this track is a candidate or not. |
Definition at line 82 of file UserTrackInformation.h.
References isBremCandidate(), and isBremCandidate_.
Referenced by biasing::DeepEcalProcessFilter::stepping(), biasing::EcalProcessFilter::stepping(), and biasing::TargetBremFilter::stepping().
|
inline |
Tag this track as a photon that has undergone a photo-nuclear reaction.
[in] | isPNGamma | flag indicating whether this track has undergone a photo-nuclear reaction or not. |
Definition at line 119 of file UserTrackInformation.h.
References isPNGamma(), and isPNGamma_.
Referenced by biasing::PhotoNuclearProductsFilter::stepping(), and biasing::PhotoNuclearTopologyFilter::stepping().
|
inline |
Tag this track as a recoil electron by the biasing filters.
[in] | isRecoilElectron | flag indicating whether this track is a recoil electron or not. |
Definition at line 99 of file UserTrackInformation.h.
References isRecoilElectron(), and isRecoilElectron_.
Referenced by biasing::NonFiducialFilter::stepping().
|
private |
The initial momentum of the track.
Definition at line 167 of file UserTrackInformation.h.
Referenced by getInitialMomentum(), and initialize().
|
private |
Flag indicating whether this track is a brem candidate.
Definition at line 149 of file UserTrackInformation.h.
Referenced by isBremCandidate(), Print(), and tagBremCandidate().
|
private |
Flag indicating whether this track has undergone a photo-nuclear reaction.
Definition at line 158 of file UserTrackInformation.h.
Referenced by isPNGamma(), and tagPNGamma().
|
private |
Flag indicating whether this track is a recoil electron.
Definition at line 152 of file UserTrackInformation.h.
Referenced by isRecoilElectron(), and tagRecoilElectron().
|
private |
Flag for saving the track as a Trajectory.
Default value is false because we want to save space in the output file. We assume everywhere else that the save flag is false unless some other part changes it.
Definition at line 146 of file UserTrackInformation.h.
Referenced by getSaveFlag(), Print(), and setSaveFlag().
|
private |
Global Time of Creation.
Definition at line 164 of file UserTrackInformation.h.
Referenced by getVertexTime(), and initialize().
|
private |
Volume the track was created in.
Definition at line 161 of file UserTrackInformation.h.
Referenced by getVertexVolume(), and initialize().