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 pathSimTrackerHit.h
More file actions
278 lines (229 loc) · 5.64 KB
/
Copy pathSimTrackerHit.h
File metadata and controls
278 lines (229 loc) · 5.64 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
/**
* @file SimTrackerHit.h
* @brief Class which encapsulates information from a hit in a simulated
* tracking detector
* @author Omar Moreno, SLAC National Accelerator Laboratory
* @author Jeremy McCormick, SLAC National Accelerator Laboratory
*/
#ifndef SIMCORE_EVENT_SIMTRACKERHIT_H_
#define SIMCORE_EVENT_SIMTRACKERHIT_H_
// ROOT
#include "TObject.h" //For ClassDef
// STL
#include <iostream>
namespace ldmx {
/**
* @class SimTrackerHit
* @brief Represents a simulated tracker hit in the simulation
*/
class SimTrackerHit {
public:
/**
* Class constructor.
*/
SimTrackerHit();
/**
* Class destructor.
*/
virtual ~SimTrackerHit();
/**
* Print a description of this object.
*/
void Print() const;
/**
* Reset the SimTrackerHit object.
*/
void Clear();
/**
* Get the detector ID of the hit.
* @return The detector ID of the hit.
*/
int getID() const { return id_; };
/**
* Get the geometric layer ID of the hit.
* @return The layer ID of the hit.
*/
int getLayerID() const { return layerID_; };
/**
* Get the module ID associated with a hit. This is used to
* uniquely identify a sensor within a layer.
* @return The module ID associated with a hit.
*/
int getModuleID() const { return moduleID_; };
/**
* Get the XYZ position of the hit [mm].
* @return The position of the hit.
*/
std::vector<float> getPosition() const { return {x_, y_, z_}; };
/**
* Get the energy deposited on the hit [MeV].
* @return The energy deposited on the hit.
*/
float getEdep() const { return edep_; };
/**
* Get the energy
* @return The energy of the hit.
*/
float getEnergy() const { return energy_; };
/**
* Get the global time of the hit [ns].
* @return The global time of the hit.
*/
float getTime() const { return time_; };
/**
* Get the path length between the start and end points of the
* hit [mm].
* @return The path length of the hit.
*/
float getPathLength() const { return pathLength_; };
/**
* Get the XYZ momentum of the particle at the position at which
* the hit took place [MeV].
* @return The momentum of the particle.
*/
std::vector<double> getMomentum() const { return {px_, py_, pz_}; };
/**
* Get the Sim particle track ID of the hit.
* @return The Sim particle track ID of the hit.
*/
int getTrackID() const { return trackID_; };
/**
* Get the Sim particle track ID of the hit.
* @return The Sim particle track ID of the hit.
*/
int getPdgID() const { return pdgID_; };
/**
* Set the detector ID of the hit.
* @param id The detector ID of the hit.
*/
void setID(const long id) { this->id_ = id; };
/**
* Set the geometric layer ID of the hit.
* @param layerID The layer ID of the hit.
*/
void setLayerID(const int layerID) { this->layerID_ = layerID; };
/**
* Set the module ID associated with a hit. This is used to
* uniquely identify a sensor within a layer.
* @return moduleID The module ID associated with a hit.
*/
void setModuleID(const int moduleID) { this->moduleID_ = moduleID; };
/**
* Set the position of the hit [mm].
* @param x The X position.
* @param y The Y position.
* @param z The Z position.
*/
void setPosition(const float x, const float y, const float z);
/**
* Set the energy deposited on the hit [MeV].
* @param edep The energy deposited on the hit.
*/
void setEdep(const float edep) { this->edep_ = edep; };
/**
* Set the energy of the hit.
* @param e The energy of the hit.
*/
void setEnergy(const float energy) { energy_ = energy; };
/**
* Set the global time of the hit [ns].
* @param time The global time of the hit.
*/
void setTime(const float time) { this->time_ = time; };
/**
* Set the path length of the hit [mm].
* @param pathLength The path length of the hit.
*/
void setPathLength(const float pathLength) {
this->pathLength_ = pathLength;
};
/**
* Set the momentum of the particle at the position at which
* the hit took place [GeV].
* @param px The X momentum.
* @param py The Y momentum.
* @param pz The Z momentum.
*/
void setMomentum(const float px, const float py, const float pz);
/**
* Set the Sim particle track ID of the hit.
* @return The Sim particle track ID of the hit.
*/
void setTrackID(const int simTrackID) { this->trackID_ = simTrackID; };
/**
* Set the Sim particle track ID of the hit.
* @return The Sim particle track ID of the hit.
*/
void setPdgID(const int simPdgID) { this->pdgID_ = simPdgID; };
/**
* Sort by time of hit
*/
bool operator<(const ldmx::SimTrackerHit &rhs) const {
return this->getTime() < rhs.getTime();
}
private:
/**
* The detector ID.
*/
int id_{0};
/**
* The layer ID.
*/
int layerID_{0};
/** The module ID. */
int moduleID_{0};
/**
* The energy deposited on the hit.
*/
float edep_{0};
/**
* The global time of the hit.
*/
float time_{0};
/**
* The X momentum.
*/
float px_{0};
/**
* The Y momentum.
*/
float py_{0};
/**
* The Z momentum.
*/
float pz_{0};
/**
* The total energy.
*/
float energy_{0};
/**
* The X position.
*/
float x_{0};
/**
* The Y position.
*/
float y_{0};
/**
* The Z position.
*/
float z_{0};
/**
* The path length of the hit.
*/
float pathLength_{0};
/**
* The Sim Track ID.
*/
int trackID_{0};
/**
* The Sim PDG ID.
*/
int pdgID_{0};
/**
* The ROOT class definition.
*/
ClassDef(SimTrackerHit, 3);
}; // SimTrackerHit
} // namespace ldmx
#endif // EVENT_SIMTRACKERHIT_H_