LDMX Software
ldmx::SimTrackerHit Class Reference

Represents a simulated tracker hit in the simulation. More...

#include <SimTrackerHit.h>

Public Member Functions

 SimTrackerHit ()=default
 Class constructor.
 
virtual ~SimTrackerHit ()
 Class destructor.
 
void clear ()
 Reset the SimTrackerHit object.
 
int getID () const
 Get the detector ID of the hit.
 
int getLayerID () const
 Get the geometric layer ID of the hit.
 
int getModuleID () const
 Get the module ID associated with a hit.
 
std::vector< float > getPosition () const
 Get the XYZ position of the hit [mm].
 
float getEdep () const
 Get the energy deposited on the hit [MeV].
 
float getEnergy () const
 Get the energy.
 
float getTime () const
 Get the global time of the hit [ns].
 
float getPathLength () const
 Get the path length between the start and end points of the hit [mm].
 
std::vector< double > getMomentum () const
 Get the XYZ momentum of the particle at the position at which the hit took place [MeV].
 
int getTrackID () const
 Get the Sim particle track ID of the hit.
 
int getPdgID () const
 Get the Sim particle track ID of the hit.
 
void setID (const long id)
 Set the detector ID of the hit.
 
void setLayerID (const int layerID)
 Set the geometric layer ID of the hit.
 
void setModuleID (const int moduleID)
 Set the module ID associated with a hit.
 
void setPosition (const float x_, const float y_, const float z_)
 Set the position of the hit [mm].
 
void setEdep (const float edep)
 Set the energy deposited on the hit [MeV].
 
void setEnergy (const float energy)
 Set the energy of the hit.
 
void setTime (const float time)
 Set the global time of the hit [ns].
 
void setPathLength (const float pathLength)
 Set the path length of the hit [mm].
 
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].
 
void setTrackID (const int simTrackID)
 Set the Sim particle track ID of the hit.
 
void setPdgID (const int simPdgID)
 Set the Sim particle track ID of the hit.
 
bool operator< (const ldmx::SimTrackerHit &rhs) const
 Sort by time of hit.
 

Private Member Functions

 ClassDef (SimTrackerHit, 4)
 The ROOT class definition.
 

Private Attributes

int id_ {0}
 The detector ID.
 
int layer_id_ {0}
 The layer ID.
 
int module_id_ {0}
 The module ID.
 
float edep_ {0}
 The energy deposited on the hit.
 
float time_ {0}
 The global time of the hit.
 
float px_ {0}
 The X momentum.
 
float py_ {0}
 The Y momentum.
 
float pz_ {0}
 The Z momentum.
 
float energy_ {0}
 The total energy.
 
float x_ {0}
 The X position.
 
float y_ {0}
 The Y position.
 
float z_ {0}
 The Z position.
 
float path_length_ {0}
 The path length of the hit.
 
int track_id_ {0}
 The Sim Track ID.
 
int pdg_id_ {0}
 The Sim PDG ID.
 

Friends

std::ostream & operator<< (std::ostream &o, const SimTrackerHit &d)
 Print a description of this object.
 

Detailed Description

Represents a simulated tracker hit in the simulation.

Definition at line 24 of file SimTrackerHit.h.

Constructor & Destructor Documentation

◆ ~SimTrackerHit()

ldmx::SimTrackerHit::~SimTrackerHit ( )
virtual

Class destructor.

Definition at line 7 of file SimTrackerHit.cxx.

7{ clear(); }
void clear()
Reset the SimTrackerHit object.

References clear().

Member Function Documentation

◆ clear()

void ldmx::SimTrackerHit::clear ( )

Reset the SimTrackerHit object.

Definition at line 19 of file SimTrackerHit.cxx.

19 {
20 id_ = 0;
21 layer_id_ = 0;
22 module_id_ = 0;
23 edep_ = 0;
24 time_ = 0;
25 px_ = 0;
26 py_ = 0;
27 pz_ = 0;
28 x_ = 0;
29 y_ = 0;
30 z_ = 0;
31 energy_ = 0;
32 path_length_ = 0;
33 track_id_ = -1;
34 pdg_id_ = 0;
35}
float z_
The Z position.
float pz_
The Z momentum.
float time_
The global time of the hit.
float px_
The X momentum.
float edep_
The energy deposited on the hit.
float x_
The X position.
int pdg_id_
The Sim PDG ID.
float y_
The Y position.
float py_
The Y momentum.
int module_id_
The module ID.
int id_
The detector ID.
float energy_
The total energy.
int track_id_
The Sim Track ID.
int layer_id_
The layer ID.
float path_length_
The path length of the hit.

References edep_, energy_, id_, layer_id_, module_id_, path_length_, pdg_id_, px_, py_, pz_, time_, track_id_, x_, y_, and z_.

Referenced by ~SimTrackerHit().

◆ getEdep()

float ldmx::SimTrackerHit::getEdep ( ) const
inline

Get the energy deposited on the hit [MeV].

Returns
The energy deposited on the hit.

Definition at line 75 of file SimTrackerHit.h.

75{ return edep_; };

References edep_.

Referenced by ldmx::Measurement::Measurement().

◆ getEnergy()

float ldmx::SimTrackerHit::getEnergy ( ) const
inline

Get the energy.

Returns
The energy of the hit.

Definition at line 81 of file SimTrackerHit.h.

81{ return energy_; };

References energy_.

◆ getID()

int ldmx::SimTrackerHit::getID ( ) const
inline

Get the detector ID of the hit.

Returns
The detector ID of the hit.

Definition at line 50 of file SimTrackerHit.h.

50{ return id_; };

References id_.

Referenced by ldmx::Measurement::Measurement().

◆ getLayerID()

int ldmx::SimTrackerHit::getLayerID ( ) const
inline

Get the geometric layer ID of the hit.

Returns
The layer ID of the hit.

Definition at line 56 of file SimTrackerHit.h.

56{ return layer_id_; };

References layer_id_.

Referenced by eventdisplay::DetectorGeometry::getBoundingBox().

◆ getModuleID()

int ldmx::SimTrackerHit::getModuleID ( ) const
inline

Get the module ID associated with a hit.

This is used to uniquely identify a sensor within a layer_.

Returns
The module ID associated with a hit.

Definition at line 63 of file SimTrackerHit.h.

63{ return module_id_; };

References module_id_.

Referenced by eventdisplay::DetectorGeometry::getBoundingBox().

◆ getMomentum()

std::vector< double > ldmx::SimTrackerHit::getMomentum ( ) const
inline

Get the XYZ momentum of the particle at the position at which the hit took place [MeV].

Returns
The momentum of the particle.

Definition at line 101 of file SimTrackerHit.h.

101{ return {px_, py_, pz_}; };

References px_, py_, and pz_.

Referenced by tracking::reco::TruthSeedProcessor::createTruthTrack(), ecal::EcalPnetVetoProcessor::produce(), recon::ParticleFlow::produce(), tracking::reco::TruthSeedProcessor::produce(), and tracking::reco::TruthSeedProcessor::scoringPlaneHitFilter().

◆ getPathLength()

float ldmx::SimTrackerHit::getPathLength ( ) const
inline

Get the path length between the start and end points of the hit [mm].

Returns
The path length of the hit.

Definition at line 94 of file SimTrackerHit.h.

94{ return path_length_; };

References path_length_.

◆ getPdgID()

int ldmx::SimTrackerHit::getPdgID ( ) const
inline

Get the Sim particle track ID of the hit.

Returns
The Sim particle track ID of the hit.

Definition at line 113 of file SimTrackerHit.h.

113{ return pdg_id_; };

References pdg_id_.

Referenced by tracking::reco::TruthSeedProcessor::createTruthTrack(), and tracking::reco::TruthSeedProcessor::scoringPlaneHitFilter().

◆ getPosition()

std::vector< float > ldmx::SimTrackerHit::getPosition ( ) const
inline

◆ getTime()

float ldmx::SimTrackerHit::getTime ( ) const
inline

Get the global time of the hit [ns].

Returns
The global time of the hit.

Definition at line 87 of file SimTrackerHit.h.

87{ return time_; };

References time_.

Referenced by ldmx::Measurement::Measurement(), and operator<().

◆ getTrackID()

int ldmx::SimTrackerHit::getTrackID ( ) const
inline

Get the Sim particle track ID of the hit.

Returns
The Sim particle track ID of the hit.

Definition at line 107 of file SimTrackerHit.h.

107{ return track_id_; };

References track_id_.

Referenced by tracking::reco::TruthSeedProcessor::createTruthTrack(), ldmx::Measurement::Measurement(), tracking::reco::TruthSeedProcessor::produce(), and tracking::reco::TruthSeedProcessor::scoringPlaneHitFilter().

◆ operator<()

bool ldmx::SimTrackerHit::operator< ( const ldmx::SimTrackerHit & rhs) const
inline

Sort by time of hit.

Definition at line 192 of file SimTrackerHit.h.

192 {
193 return this->getTime() < rhs.getTime();
194 }
float getTime() const
Get the global time of the hit [ns].

References getTime().

◆ setEdep()

void ldmx::SimTrackerHit::setEdep ( const float edep)
inline

Set the energy deposited on the hit [MeV].

Parameters
edepThe energy deposited on the hit.

Definition at line 146 of file SimTrackerHit.h.

146{ this->edep_ = edep; };

References edep_.

◆ setEnergy()

void ldmx::SimTrackerHit::setEnergy ( const float energy)
inline

Set the energy of the hit.

Parameters
eThe energy of the hit.

Definition at line 152 of file SimTrackerHit.h.

152{ energy_ = energy; };

References energy_.

◆ setID()

void ldmx::SimTrackerHit::setID ( const long id)
inline

Set the detector ID of the hit.

Parameters
idThe detector ID of the hit.

Definition at line 119 of file SimTrackerHit.h.

119{ this->id_ = id; };

References id_.

◆ setLayerID()

void ldmx::SimTrackerHit::setLayerID ( const int layerID)
inline

Set the geometric layer ID of the hit.

Parameters
layerIDThe layer ID of the hit.

Definition at line 125 of file SimTrackerHit.h.

125{ this->layer_id_ = layerID; };

References layer_id_.

◆ setModuleID()

void ldmx::SimTrackerHit::setModuleID ( const int moduleID)
inline

Set the module ID associated with a hit.

This is used to uniquely identify a sensor within a layer_.

Returns
moduleID The module ID associated with a hit.

Definition at line 132 of file SimTrackerHit.h.

132{ this->module_id_ = moduleID; };

References module_id_.

◆ setMomentum()

void ldmx::SimTrackerHit::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].

Parameters
pxThe X momentum.
pyThe Y momentum.
pzThe Z momentum.

Definition at line 44 of file SimTrackerHit.cxx.

45 {
46 this->px_ = px;
47 this->py_ = py;
48 this->pz_ = pz;
49}

References px_, py_, and pz_.

◆ setPathLength()

void ldmx::SimTrackerHit::setPathLength ( const float pathLength)
inline

Set the path length of the hit [mm].

Parameters
pathLengthThe path length of the hit.

Definition at line 164 of file SimTrackerHit.h.

164 {
165 this->path_length_ = pathLength;
166 };

References path_length_.

◆ setPdgID()

void ldmx::SimTrackerHit::setPdgID ( const int simPdgID)
inline

Set the Sim particle track ID of the hit.

Returns
The Sim particle track ID of the hit.

Definition at line 187 of file SimTrackerHit.h.

187{ this->pdg_id_ = simPdgID; };

References pdg_id_.

◆ setPosition()

void ldmx::SimTrackerHit::setPosition ( const float x_,
const float y_,
const float z_ )

Set the position of the hit [mm].

Parameters
x_The X position.
y_The Y position.
z_The Z position.

Definition at line 37 of file SimTrackerHit.cxx.

38 {
39 this->x_ = x_;
40 this->y_ = y_;
41 this->z_ = z_;
42}

References x_, y_, and z_.

◆ setTime()

void ldmx::SimTrackerHit::setTime ( const float time)
inline

Set the global time of the hit [ns].

Parameters
timeThe global time of the hit.

Definition at line 158 of file SimTrackerHit.h.

158{ this->time_ = time; };

References time_.

◆ setTrackID()

void ldmx::SimTrackerHit::setTrackID ( const int simTrackID)
inline

Set the Sim particle track ID of the hit.

Returns
The Sim particle track ID of the hit.

Definition at line 181 of file SimTrackerHit.h.

181{ this->track_id_ = simTrackID; };

References track_id_.

Referenced by simcore::ScoringPlaneSD::ProcessHits(), and simcore::TrackerSD::ProcessHits().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const SimTrackerHit & d )
friend

Print a description of this object.

Definition at line 9 of file SimTrackerHit.cxx.

9 {
10 return o << "SimTrackerHit { " << "id: " << hit.id_ << ", "
11 << "layerID: " << hit.layer_id_ << ", "
12 << "moduleID: " << hit.module_id_ << ", " << "position: ( " << hit.x_
13 << ", " << hit.y_ << ", " << hit.z_ << " ), "
14 << "edep: " << hit.edep_ << ", " << "time: " << hit.time_ << ", "
15 << "momentum: ( " << hit.px_ << ", " << hit.py_ << ", " << hit.pz_
16 << " )" << " }";
17}

Member Data Documentation

◆ edep_

float ldmx::SimTrackerHit::edep_ {0}
private

The energy deposited on the hit.

Definition at line 213 of file SimTrackerHit.h.

213{0};

Referenced by clear(), getEdep(), and setEdep().

◆ energy_

float ldmx::SimTrackerHit::energy_ {0}
private

The total energy.

Definition at line 238 of file SimTrackerHit.h.

238{0};

Referenced by clear(), getEnergy(), and setEnergy().

◆ id_

int ldmx::SimTrackerHit::id_ {0}
private

The detector ID.

Definition at line 200 of file SimTrackerHit.h.

200{0};

Referenced by clear(), getID(), and setID().

◆ layer_id_

int ldmx::SimTrackerHit::layer_id_ {0}
private

The layer ID.

Definition at line 205 of file SimTrackerHit.h.

205{0};

Referenced by clear(), getLayerID(), and setLayerID().

◆ module_id_

int ldmx::SimTrackerHit::module_id_ {0}
private

The module ID.

Definition at line 208 of file SimTrackerHit.h.

208{0};

Referenced by clear(), getModuleID(), and setModuleID().

◆ path_length_

float ldmx::SimTrackerHit::path_length_ {0}
private

The path length of the hit.

Definition at line 258 of file SimTrackerHit.h.

258{0};

Referenced by clear(), getPathLength(), and setPathLength().

◆ pdg_id_

int ldmx::SimTrackerHit::pdg_id_ {0}
private

The Sim PDG ID.

Definition at line 268 of file SimTrackerHit.h.

268{0};

Referenced by clear(), getPdgID(), and setPdgID().

◆ px_

float ldmx::SimTrackerHit::px_ {0}
private

The X momentum.

Definition at line 223 of file SimTrackerHit.h.

223{0};

Referenced by clear(), getMomentum(), and setMomentum().

◆ py_

float ldmx::SimTrackerHit::py_ {0}
private

The Y momentum.

Definition at line 228 of file SimTrackerHit.h.

228{0};

Referenced by clear(), getMomentum(), and setMomentum().

◆ pz_

float ldmx::SimTrackerHit::pz_ {0}
private

The Z momentum.

Definition at line 233 of file SimTrackerHit.h.

233{0};

Referenced by clear(), getMomentum(), and setMomentum().

◆ time_

float ldmx::SimTrackerHit::time_ {0}
private

The global time of the hit.

Definition at line 218 of file SimTrackerHit.h.

218{0};

Referenced by clear(), getTime(), and setTime().

◆ track_id_

int ldmx::SimTrackerHit::track_id_ {0}
private

The Sim Track ID.

Definition at line 263 of file SimTrackerHit.h.

263{0};

Referenced by clear(), getTrackID(), and setTrackID().

◆ x_

float ldmx::SimTrackerHit::x_ {0}
private

The X position.

Definition at line 243 of file SimTrackerHit.h.

243{0};

Referenced by clear(), getPosition(), and setPosition().

◆ y_

float ldmx::SimTrackerHit::y_ {0}
private

The Y position.

Definition at line 248 of file SimTrackerHit.h.

248{0};

Referenced by clear(), getPosition(), and setPosition().

◆ z_

float ldmx::SimTrackerHit::z_ {0}
private

The Z position.

Definition at line 253 of file SimTrackerHit.h.

253{0};

Referenced by clear(), getPosition(), and setPosition().


The documentation for this class was generated from the following files: