LDMX Software
UserTrackInformation.h
1#ifndef SIMCORE_USERTRACKINFORMATION_H
2#define SIMCORE_USERTRACKINFORMATION_H
3
4#include "G4ThreeVector.hh"
5#include "G4Track.hh"
6#include "G4VUserTrackInformation.hh"
7
8namespace simcore {
9
16class UserTrackInformation : public G4VUserTrackInformation {
17 public:
20
21 virtual ~UserTrackInformation() = default;
33 static UserTrackInformation* get(const G4Track* track);
34
48 void initialize(const G4Track* track);
49
51 void Print() const override;
52
59 bool getSaveFlag() const { return saveFlag_; }
60
67 void setSaveFlag(bool saveFlag) { saveFlag_ = saveFlag; }
68
74 bool isBremCandidate() const { return isBremCandidate_; }
75
85
91 bool isRecoilElectron() const { return isRecoilElectron_; }
92
102
110 bool isPNGamma() const { return isPNGamma_; }
111
119 void tagPNGamma(bool isPNGamma = true) { isPNGamma_ = isPNGamma; }
120
126 const G4ThreeVector& getInitialMomentum() const { return initialMomentum_; }
127
131 std::string getVertexVolume() const { return vertexVolume_; }
132
136 double getVertexTime() const { return vertex_time_; }
137
138 private:
146 bool saveFlag_{false};
147
149 bool isBremCandidate_{false};
150
152 bool isRecoilElectron_{false};
153
158 bool isPNGamma_{false};
159
161 std::string vertexVolume_{""};
162
164 double vertex_time_{0.};
165
167 G4ThreeVector initialMomentum_;
168};
169} // namespace simcore
170
171#endif
Provides user defined information to associate with a Geant4 track.
std::string vertexVolume_
Volume the track was created in.
static UserTrackInformation * get(const G4Track *track)
get
bool isRecoilElectron() const
Check whether this track is a recoil electron.
std::string getVertexVolume() const
Get the name of the volume that this track was created in.
void Print() const override
Print the information associated with the track.
const G4ThreeVector & getInitialMomentum() const
Get the initial momentum 3-vector of the track [MeV].
void tagBremCandidate(bool isBremCandidate=true)
Tag this track as a brem candidate by the biasing filters.
bool saveFlag_
Flag for saving the track as a Trajectory.
void initialize(const G4Track *track)
Initialize the track information with the passed track.
void setSaveFlag(bool saveFlag)
Set the save flag so the associated track will be persisted as a Trajectory.
bool isRecoilElectron_
Flag indicating whether this track is a recoil electron.
bool isPNGamma() const
Check whether this track is a photon that has undergone a photo-nuclear reaction.
bool isBremCandidate() const
Check whether this track is a brem candidate.
UserTrackInformation()=default
Constructor.
G4ThreeVector initialMomentum_
The initial momentum of the track.
bool getSaveFlag() const
Get the flag which indicates whether this track should be saved as a Trajectory.
double vertex_time_
Global Time of Creation.
bool isBremCandidate_
Flag indicating whether this track is a brem candidate.
void tagRecoilElectron(bool isRecoilElectron=true)
Tag this track as a recoil electron by the biasing filters.
void tagPNGamma(bool isPNGamma=true)
Tag this track as a photon that has undergone a photo-nuclear reaction.
bool isPNGamma_
Flag indicating whether this track has undergone a photo-nuclear reaction.
double getVertexTime() const
Get the global time at which this track was created.