LDMX Software
ldmx::SimSiStripHit Class Reference

Truth (Monte Carlo) representation of a digitized silicon strip detector hit. More...

#include <SimSiStripHit.h>

Public Member Functions

 SimSiStripHit ()=default
 Default constructor.
 
 SimSiStripHit (int layer_id, int strip_id, std::vector< short > samples, long time, int track_id=-1, int pdg_id=0, int sim_hit_id=-1, float edep=0.f)
 Constructor.
 
virtual ~SimSiStripHit ()=default
 Destructor.
 
void clear () override
 Clear the samples, time stamp, sensor position and truth fields.
 
int getLayerID () const
 Get the sensor layer identifier.
 
int getStripID () const
 Get the readout strip index within the sensor.
 
int getTrackID () const
 Get the Geant4 track ID of the particle that created this hit (-1 if unknown).
 
int getPdgID () const
 Get the PDG particle ID of the particle that created this hit (0 if unknown).
 
int getSimHitID () const
 Get the detector ID of the originating SimTrackerHit (-1 if unknown).
 
float getEdep () const
 Get the energy deposited by the parent SimTrackerHit [MeV] (0 if unknown).
 
void setLayerID (int v)
 Set the sensor layer identifier.
 
void setStripID (int v)
 Set the readout strip index within the sensor.
 
void setTrackID (int v)
 Set the Geant4 track ID of the particle that created this hit.
 
void setPdgID (int v)
 Set the PDG particle ID of the particle that created this hit.
 
void setSimHitID (int v)
 Set the detector ID of the originating SimTrackerHit.
 
void setEdep (float v)
 Set the energy deposited by the parent SimTrackerHit [MeV].
 
- Public Member Functions inherited from ldmx::SiStripHit
 SiStripHit ()=default
 Default constructor.
 
virtual ~SiStripHit ()=default
 Destructor.
 
std::vector< short > getSamples () const
 Get the digitized (ADC) samples composing this hit.
 
long getTime () const
 Get the time stamp of this hit.
 
bool operator< (const SiStripHit &rhs) const
 When the less than operator is used for comparison, return true if this hit's time is less than the hit we are comparing against.
 

Protected Member Functions

 ClassDefOverride (SimSiStripHit, 1)
 Class declaration needed by the ROOT dictionary.
 
- Protected Member Functions inherited from ldmx::SiStripHit
 SiStripHit (std::vector< short > samples, long time)
 Constructor used by derived classes to initialize the shared fields.
 
void clearBase ()
 Clear the fields owned by the base class.
 
 ClassDef (SiStripHit, 1)
 Class declaration needed by the ROOT dictionary.
 

Protected Attributes

int layer_id_ {-1}
 Sensor layer identifier (from tracking geometry).
 
int strip_id_ {-1}
 Readout strip index within the sensor.
 
int track_id_ {-1}
 Geant4 track ID of the particle that created this hit.
 
int pdg_id_ {0}
 PDG particle ID of the particle that created this hit.
 
int sim_hit_id_ {-1}
 Detector ID of the originating SimTrackerHit.
 
float edep_ {0.f}
 Energy deposited by the parent SimTrackerHit [MeV].
 
- Protected Attributes inherited from ldmx::SiStripHit
std::vector< short > samples_
 16 bit ADC samples associated with this hit.
 
long time_ {0}
 The hit time stamp in units of ns.
 

Friends

std::ostream & operator<< (std::ostream &output, const SimSiStripHit &hit)
 Overload the stream insertion operator to output a string representation of this SimSiStripHit.
 

Detailed Description

Truth (Monte Carlo) representation of a digitized silicon strip detector hit.

This is the output of the realistic tracker digitization of simulated data. In addition to the ADC samples and time stamp held by the SiStripHit base class, it carries the sensor position (layer/strip) and the MC-truth matching information (originating track, particle, SimTrackerHit and deposited energy). The reco-level (real data) counterpart is RawSiStripHit.

Definition at line 27 of file SimSiStripHit.h.

Constructor & Destructor Documentation

◆ SimSiStripHit()

ldmx::SimSiStripHit::SimSiStripHit ( int layer_id,
int strip_id,
std::vector< short > samples,
long time,
int track_id = -1,
int pdg_id = 0,
int sim_hit_id = -1,
float edep = 0.f )

Constructor.

Parameters
[in]layer_idSensor layer identifier (from tracking geometry).
[in]strip_idReadout strip index within the sensor.
[in]samplesThe ADC samples composing this hit (16-bit each).
[in]timeHit timestamp [ns].
[in]track_idGeant4 track ID of the particle that created this hit.
[in]pdg_idPDG particle ID of the particle that created this hit.
[in]sim_hit_idDetector ID of the originating SimTrackerHit.
[in]edepEnergy deposited by the parent SimTrackerHit [MeV].

Definition at line 8 of file SimSiStripHit.cxx.

12 : SiStripHit(samples, time),
13 layer_id_(layer_id),
14 strip_id_(strip_id),
15 track_id_(track_id),
16 pdg_id_(pdg_id),
17 sim_hit_id_(sim_hit_id),
18 edep_(edep) {}
SiStripHit()=default
Default constructor.
float edep_
Energy deposited by the parent SimTrackerHit [MeV].
int strip_id_
Readout strip index within the sensor.
int track_id_
Geant4 track ID of the particle that created this hit.
int layer_id_
Sensor layer identifier (from tracking geometry).
int pdg_id_
PDG particle ID of the particle that created this hit.
int sim_hit_id_
Detector ID of the originating SimTrackerHit.

◆ ~SimSiStripHit()

virtual ldmx::SimSiStripHit::~SimSiStripHit ( )
virtualdefault

Destructor.

Currently, the destructor does nothing.

Member Function Documentation

◆ clear()

void ldmx::SimSiStripHit::clear ( )
overridevirtual

Clear the samples, time stamp, sensor position and truth fields.

This method is needed by ROOT when building the dictionary.

Implements ldmx::SiStripHit.

Definition at line 20 of file SimSiStripHit.cxx.

20 {
21 clearBase();
22 layer_id_ = -1;
23 strip_id_ = -1;
24 track_id_ = -1;
25 pdg_id_ = 0;
26 sim_hit_id_ = -1;
27 edep_ = 0.f;
28}
void clearBase()
Clear the fields owned by the base class.
Definition SiStripHit.h:94

References ldmx::SiStripHit::clearBase(), edep_, layer_id_, pdg_id_, sim_hit_id_, strip_id_, and track_id_.

◆ getEdep()

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

Get the energy deposited by the parent SimTrackerHit [MeV] (0 if unknown).

Definition at line 82 of file SimSiStripHit.h.

82{ return edep_; }

References edep_.

◆ getLayerID()

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

Get the sensor layer identifier.

Definition at line 65 of file SimSiStripHit.h.

65{ return layer_id_; }

References layer_id_.

◆ getPdgID()

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

Get the PDG particle ID of the particle that created this hit (0 if unknown).

Definition at line 76 of file SimSiStripHit.h.

76{ return pdg_id_; }

References pdg_id_.

◆ getSimHitID()

int ldmx::SimSiStripHit::getSimHitID ( ) const
inline

Get the detector ID of the originating SimTrackerHit (-1 if unknown).

Definition at line 79 of file SimSiStripHit.h.

79{ return sim_hit_id_; }

References sim_hit_id_.

◆ getStripID()

int ldmx::SimSiStripHit::getStripID ( ) const
inline

Get the readout strip index within the sensor.

Definition at line 68 of file SimSiStripHit.h.

68{ return strip_id_; }

References strip_id_.

◆ getTrackID()

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

Get the Geant4 track ID of the particle that created this hit (-1 if unknown).

Definition at line 72 of file SimSiStripHit.h.

72{ return track_id_; }

References track_id_.

◆ setEdep()

void ldmx::SimSiStripHit::setEdep ( float v)
inline

Set the energy deposited by the parent SimTrackerHit [MeV].

Definition at line 95 of file SimSiStripHit.h.

95{ edep_ = v; }

References edep_.

◆ setLayerID()

void ldmx::SimSiStripHit::setLayerID ( int v)
inline

Set the sensor layer identifier.

Definition at line 85 of file SimSiStripHit.h.

85{ layer_id_ = v; }

References layer_id_.

◆ setPdgID()

void ldmx::SimSiStripHit::setPdgID ( int v)
inline

Set the PDG particle ID of the particle that created this hit.

Definition at line 91 of file SimSiStripHit.h.

91{ pdg_id_ = v; }

References pdg_id_.

◆ setSimHitID()

void ldmx::SimSiStripHit::setSimHitID ( int v)
inline

Set the detector ID of the originating SimTrackerHit.

Definition at line 93 of file SimSiStripHit.h.

93{ sim_hit_id_ = v; }

References sim_hit_id_.

◆ setStripID()

void ldmx::SimSiStripHit::setStripID ( int v)
inline

Set the readout strip index within the sensor.

Definition at line 87 of file SimSiStripHit.h.

87{ strip_id_ = v; }

References strip_id_.

◆ setTrackID()

void ldmx::SimSiStripHit::setTrackID ( int v)
inline

Set the Geant4 track ID of the particle that created this hit.

Definition at line 89 of file SimSiStripHit.h.

89{ track_id_ = v; }

References track_id_.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & output,
const SimSiStripHit & hit )
friend

Overload the stream insertion operator to output a string representation of this SimSiStripHit.

Parameters
[in]outputThe output stream where the string representation will be inserted.
[in]hitThe SimSiStripHit to output.
Returns
An ostream object with the string representation of SimSiStripHit inserted.

Definition at line 30 of file SimSiStripHit.cxx.

30 {
31 output << "[ SimSiStripHit ]: layer=" << hit.layer_id_
32 << " strip=" << hit.strip_id_ << " Samples: { ";
33 for (auto isample{0}; isample < (int)(hit.samples_.size() - 1); ++isample)
34 output << hit.samples_[isample] << ", ";
35 output << hit.samples_[hit.samples_.size() - 1] << " } "
36 << "Time: " << hit.time_ << " track_id=" << hit.track_id_
37 << " pdg_id=" << hit.pdg_id_ << " sim_hit_id=" << hit.sim_hit_id_
38 << " edep=" << hit.edep_ << " MeV" << std::endl;
39
40 return output;
41}

Member Data Documentation

◆ edep_

float ldmx::SimSiStripHit::edep_ {0.f}
protected

Energy deposited by the parent SimTrackerHit [MeV].

Definition at line 126 of file SimSiStripHit.h.

126{0.f};

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

◆ layer_id_

int ldmx::SimSiStripHit::layer_id_ {-1}
protected

Sensor layer identifier (from tracking geometry).

Definition at line 113 of file SimSiStripHit.h.

113{-1};

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

◆ pdg_id_

int ldmx::SimSiStripHit::pdg_id_ {0}
protected

PDG particle ID of the particle that created this hit.

Definition at line 122 of file SimSiStripHit.h.

122{0};

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

◆ sim_hit_id_

int ldmx::SimSiStripHit::sim_hit_id_ {-1}
protected

Detector ID of the originating SimTrackerHit.

Definition at line 124 of file SimSiStripHit.h.

124{-1};

Referenced by clear(), getSimHitID(), and setSimHitID().

◆ strip_id_

int ldmx::SimSiStripHit::strip_id_ {-1}
protected

Readout strip index within the sensor.

Definition at line 116 of file SimSiStripHit.h.

116{-1};

Referenced by clear(), getStripID(), and setStripID().

◆ track_id_

int ldmx::SimSiStripHit::track_id_ {-1}
protected

Geant4 track ID of the particle that created this hit.

Definition at line 120 of file SimSiStripHit.h.

120{-1};

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


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