This repository was archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserTrackInformation.h
More file actions
117 lines (96 loc) · 2.93 KB
/
Copy pathUserTrackInformation.h
File metadata and controls
117 lines (96 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef SIMCORE_USERTRACKINFORMATION_H
#define SIMCORE_USERTRACKINFORMATION_H
#include "G4ThreeVector.hh"
#include "G4VUserTrackInformation.hh"
namespace simcore {
/**
* Provides user defined information to associate with a Geant4 track.
*/
class UserTrackInformation : public G4VUserTrackInformation {
public:
/// Constructor
UserTrackInformation();
/// Destructor
~UserTrackInformation();
/// Print the information associated with the track.
void Print() const final override;
/**
* Get the flag which indicates whether this track should be saved
* as a Trajectory.
*
* @return The save flag.
*/
bool getSaveFlag() { return saveFlag_; }
/**
* Set the save flag so the associated track will be persisted
* as a Trajectory.
*
* @param[in] saveFlag True to save the associated track.
*/
void setSaveFlag(bool saveFlag) { saveFlag_ = saveFlag; }
/**
* Check whether this track is a brem candidate.
*
* @return True if this track is a brem candidate, false otherwise.
*/
bool isBremCandidate() { return isBremCandidate_; }
/**
* Tag this track as a brem candidate by the biasing filters.
*
* @param[in] isBremCandidate flag indicating whether this track is
* a candidate or not.
*/
void tagBremCandidate(bool isBremCandidate = true) {
isBremCandidate_ = isBremCandidate;
}
/**
* Check whether this track is a photon that has undergone a
* photo-nuclear reaction.
*
* @return True if this track is a photon that has undergone a
* photo-nuclear reaction, false otherwise.
*/
bool isPNGamma() { return isPNGamma_; }
/**
* Tag this track as a photon that has undergone a photo-nuclear
* reaction.
*
* @param[in] isPNGamma flag indicating whether this track has
* undergone a photo-nuclear reaction or not.
*/
void tagPNGamma(bool isPNGamma = true) { isPNGamma_ = isPNGamma; }
/**
* Get the initial momentum 3-vector of the track [MeV].
*
* @return The initial momentum of the track.
*/
const G4ThreeVector& getInitialMomentum() { return initialMomentum_; }
/**
* Set the initial momentum of the associated track.
*
* @param[in] p The initial momentum of the track.
*/
void setInitialMomentum(const G4ThreeVector& p) {
initialMomentum_.set(p.x(), p.y(), p.z());
}
void setVertexVolume(const std::string vertexVolume) {
vertexVolume_ = vertexVolume;
}
std::string getVertexVolume() const { return vertexVolume_; }
private:
/// Flag for saving the track as a Trajectory.
bool saveFlag_{false};
/// Flag indicating whether this track is a brem candidate
bool isBremCandidate_{false};
/**
* Flag indicating whether this track has undergone a photo-nuclear
* reaction.
*/
bool isPNGamma_{false};
/// Volume the track was created in.
std::string vertexVolume_{""};
/// The initial momentum of the track.
G4ThreeVector initialMomentum_;
};
} // namespace simcore
#endif