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 friend std::ostream &operator<<(std::ostream &o, const SimTrackerHit &d);
40
44 void clear();
45
50 int getID() const { return id_; };
51
56 int getLayerID() const { return layer_id_; };
57
63 int getModuleID() const { return module_id_; };
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 path_length_; };
95
101 std::vector<double> getMomentum() const { return {px_, py_, pz_}; };
102
107 int getTrackID() const { return track_id_; };
108
113 int getPdgID() const { return pdg_id_; };
114
119 void setID(const long id) { this->id_ = id; };
120
125 void setLayerID(const int layerID) { this->layer_id_ = layerID; };
126
132 void setModuleID(const int moduleID) { this->module_id_ = 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->path_length_ = pathLength;
166 };
167
175 void setMomentum(const float px, const float py, const float pz);
176
181 void setTrackID(const int simTrackID) { this->track_id_ = simTrackID; };
182
187 void setPdgID(const int simPdgID) { this->pdg_id_ = 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 layer_id_{0};
206
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 path_length_{0};
259
263 int track_id_{0};
264
268 int pdg_id_{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.
float z_
The Z position.
float pz_
The Z momentum.
void setModuleID(const int moduleID)
Set the module ID associated with a hit.
ClassDef(SimTrackerHit, 4)
The ROOT class definition.
float time_
The global time of the hit.
void setPosition(const float x_, const float y_, const float z_)
Set the position of the hit [mm].
float px_
The X momentum.
float edep_
The energy deposited on the hit.
float x_
The X position.
void setTime(const float time)
Set the global time of the hit [ns].
float getEdep() const
Get the energy deposited on the hit [MeV].
void setID(const long id)
Set the detector ID of the hit.
void clear()
Reset the SimTrackerHit object.
int pdg_id_
The Sim PDG ID.
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].
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.
int module_id_
The module ID.
void setEnergy(const float energy)
Set the energy of the hit.
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.
void setPdgID(const int simPdgID)
Set the Sim particle track ID of the hit.
int track_id_
The Sim Track ID.
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.
friend std::ostream & operator<<(std::ostream &o, const SimTrackerHit &d)
Print a description of this object.
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.
int layer_id_
The layer ID.
float path_length_
The path length of the hit.