LDMX Software
SimTrackerHit.h
Go to the documentation of this file.
1
9#ifndef SIMCORE_EVENT_SIMTRACKERHIT_H_
10#define SIMCORE_EVENT_SIMTRACKERHIT_H_
11
12// ROOT
13#include "TObject.h" //For ClassDef
14
15// STL
16#include <iostream>
17
18namespace ldmx {
19
25 public:
29 SimTrackerHit() = default;
30
34 virtual ~SimTrackerHit();
35
39 void Print() const;
40
44 void Clear();
45
50 int getID() const { return id_; };
51
56 int getLayerID() const { return layerID_; };
57
63 int getModuleID() const { return moduleID_; };
64
69 std::vector<float> getPosition() const { return {x_, y_, z_}; };
70
75 float getEdep() const { return edep_; };
76
81 float getEnergy() const { return energy_; };
82
87 float getTime() const { return time_; };
88
94 float getPathLength() const { return pathLength_; };
95
101 std::vector<double> getMomentum() const { return {px_, py_, pz_}; };
102
107 int getTrackID() const { return trackID_; };
108
113 int getPdgID() const { return pdgID_; };
114
119 void setID(const long id) { this->id_ = id; };
120
125 void setLayerID(const int layerID) { this->layerID_ = layerID; };
126
132 void setModuleID(const int moduleID) { this->moduleID_ = moduleID; };
133
140 void setPosition(const float x, const float y, const float z);
141
146 void setEdep(const float edep) { this->edep_ = edep; };
147
152 void setEnergy(const float energy) { energy_ = energy; };
153
158 void setTime(const float time) { this->time_ = time; };
159
164 void setPathLength(const float pathLength) {
165 this->pathLength_ = pathLength;
166 };
167
175 void setMomentum(const float px, const float py, const float pz);
176
181 void setTrackID(const int simTrackID) { this->trackID_ = simTrackID; };
182
187 void setPdgID(const int simPdgID) { this->pdgID_ = simPdgID; };
188
192 bool operator<(const ldmx::SimTrackerHit &rhs) const {
193 return this->getTime() < rhs.getTime();
194 }
195
196 private:
200 int id_{0};
201
205 int layerID_{0};
206
208 int moduleID_{0};
209
213 float edep_{0};
214
218 float time_{0};
219
223 float px_{0};
224
228 float py_{0};
229
233 float pz_{0};
234
238 float energy_{0};
239
243 float x_{0};
244
248 float y_{0};
249
253 float z_{0};
254
258 float pathLength_{0};
259
263 int trackID_{0};
264
268 int pdgID_{0};
269
274
275}; // SimTrackerHit
276} // namespace ldmx
277
278#endif // EVENT_SIMTRACKERHIT_H_
Represents a simulated tracker hit in the simulation.
void setEdep(const float edep)
Set the energy deposited on the hit [MeV].
float getPathLength() const
Get the path length between the start and end points of the hit [mm].
int getModuleID() const
Get the module ID associated with a hit.
SimTrackerHit()=default
Class constructor.
ClassDef(SimTrackerHit, 3)
The ROOT class definition.
float z_
The Z position.
float pz_
The Z momentum.
float pathLength_
The path length of the hit.
void setModuleID(const int moduleID)
Set the module ID associated with a hit.
int trackID_
The Sim Track ID.
float time_
The global time of the hit.
float px_
The X momentum.
float edep_
The energy deposited on the hit.
int layerID_
The layer ID.
float x_
The X position.
void setTime(const float time)
Set the global time of the hit [ns].
void Clear()
Reset the SimTrackerHit object.
float getEdep() const
Get the energy deposited on the hit [MeV].
void setID(const long id)
Set the detector ID of the hit.
void setPosition(const float x, const float y, const float z)
Set the position of the hit [mm].
int getPdgID() const
Get the Sim particle track ID of the hit.
float y_
The Y position.
void setLayerID(const int layerID)
Set the geometric layer ID of the hit.
std::vector< float > getPosition() const
Get the XYZ position of the hit [mm].
int pdgID_
The Sim PDG ID.
virtual ~SimTrackerHit()
Class destructor.
float getEnergy() const
Get the energy.
void setPathLength(const float pathLength)
Set the path length of the hit [mm].
float py_
The Y momentum.
void setEnergy(const float energy)
Set the energy of the hit.
void Print() const
Print a description of this object.
int getID() const
Get the detector ID of the hit.
int id_
The detector ID.
float getTime() const
Get the global time of the hit [ns].
float energy_
The total energy.
bool operator<(const ldmx::SimTrackerHit &rhs) const
Sort by time of hit.
int moduleID_
The module ID.
void setPdgID(const int simPdgID)
Set the Sim particle track ID of the hit.
std::vector< double > getMomentum() const
Get the XYZ momentum of the particle at the position at which the hit took place [MeV].
void setTrackID(const int simTrackID)
Set the Sim particle track ID of the hit.
int getLayerID() const
Get the geometric layer ID of the hit.
void setMomentum(const float px, const float py, const float pz)
Set the momentum of the particle at the position at which the hit took place [GeV].
int getTrackID() const
Get the Sim particle track ID of the hit.