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
14// STL
15#include <Rtypes.h>
16
17#include <iostream>
18
19namespace ldmx {
20
26 public:
30 SimTrackerHit() = default;
31
35 virtual ~SimTrackerHit();
36
40 friend std::ostream& operator<<(std::ostream& o, const SimTrackerHit& d);
41
45 void clear();
46
51 int getID() const { return id_; };
52
57 int getLayerID() const { return layer_id_; };
58
64 int getModuleID() const { return module_id_; };
65
70 std::vector<float> getPosition() const { return {x_, y_, z_}; };
71
76 float getEdep() const { return edep_; };
77
82 float getEnergy() const { return energy_; };
83
88 float getTime() const { return time_; };
89
95 float getPathLength() const { return path_length_; };
96
102 std::vector<double> getMomentum() const { return {px_, py_, pz_}; };
103
108 int getTrackID() const { return track_id_; };
109
114 int getPdgID() const { return pdg_id_; };
115
120 void setID(const long id) { this->id_ = id; };
121
126 void setLayerID(const int layerID) { this->layer_id_ = layerID; };
127
133 void setModuleID(const int moduleID) { this->module_id_ = moduleID; };
134
141 void setPosition(const float x_, const float y_, const float z_);
142
147 void setEdep(const float edep) { this->edep_ = edep; };
148
153 void setEnergy(const float energy) { energy_ = energy; };
154
159 void setTime(const float time) { this->time_ = time; };
160
165 void setPathLength(const float pathLength) {
166 this->path_length_ = pathLength;
167 };
168
176 void setMomentum(const float px, const float py, const float pz);
177
182 void setTrackID(const int simTrackID) { this->track_id_ = simTrackID; };
183
188 void setPdgID(const int simPdgID) { this->pdg_id_ = simPdgID; };
189
193 bool operator<(const ldmx::SimTrackerHit& rhs) const {
194 return this->getTime() < rhs.getTime();
195 }
196
197 private:
201 int id_{0};
202
206 int layer_id_{0};
207
210
214 float edep_{0};
215
219 float time_{0};
220
224 float px_{0};
225
229 float py_{0};
230
234 float pz_{0};
235
239 float energy_{0};
240
244 float x_{0};
245
249 float y_{0};
250
254 float z_{0};
255
259 float path_length_{0};
260
264 int track_id_{0};
265
269 int pdg_id_{0};
270
275
276}; // SimTrackerHit
277} // namespace ldmx
278
279#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.