LDMX Software
ldmx::RawSiStripHit Class Reference

Implementation of a raw digitized hit from a silicon strip detector. More...

#include <RawSiStripHit.h>

Public Member Functions

 RawSiStripHit ()=default
 Default constructor.
 
 RawSiStripHit (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 ~RawSiStripHit ()
 Destructor.
 
void clear ()
 Clear the vector of samples and set the timestamp to 0.
 
std::vector< short > getSamples () const
 Get the digitized (ADC) samples composing this hit.
 
int getLayerID () const
 Get the sensor layer identifier.
 
int getStripID () const
 Get the readout strip index within the sensor.
 
long getTime () const
 Get the time stamp of this hit.
 
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).
 
bool operator< (const RawSiStripHit &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

 ClassDef (RawSiStripHit, 3)
 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.
 
std::vector< short > samples_
 16 bit ADC samples associated with this hit.
 
long time_ {0}
 The hit time stamp in units of ns.
 
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].
 

Friends

std::ostream & operator<< (std::ostream &o, const RawSiStripHit &d)
 Print the string representation of this object.
 
std::ostream & operator<< (std::ostream &output, const RawSiStripHit &hit)
 Overload the stream insertion operator to output a string representation of this RawStripHit.
 

Detailed Description

Implementation of a raw digitized hit from a silicon strip detector.

This class is meant to encapsulate the raw data coming from a silicon strip detector prior to any additional processing. Typically, the raw data will contain a header with ID information and timestamp, a tail with error info and multiple 32 bit data samples.

Definition at line 26 of file RawSiStripHit.h.

Constructor & Destructor Documentation

◆ RawSiStripHit()

ldmx::RawSiStripHit::RawSiStripHit ( 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.

Definition at line 6 of file RawSiStripHit.cxx.

10 : layer_id_(layer_id),
11 strip_id_(strip_id),
12 samples_(samples),
13 time_(time),
14 track_id_(track_id),
15 pdg_id_(pdg_id),
16 sim_hit_id_(sim_hit_id),
17 edep_(edep) {}
long time_
The hit time stamp in units of ns.
int layer_id_
Sensor layer identifier (from tracking geometry).
int track_id_
Geant4 track ID of the particle that created this hit.
int sim_hit_id_
Detector ID of the originating SimTrackerHit.
std::vector< short > samples_
16 bit ADC samples associated with this hit.
int strip_id_
Readout strip index within the sensor.
float edep_
Energy deposited by the parent SimTrackerHit [MeV].
int pdg_id_
PDG particle ID of the particle that created this hit.

◆ ~RawSiStripHit()

virtual ldmx::RawSiStripHit::~RawSiStripHit ( )
inlinevirtual

Destructor.

Currently, the destructor does nothing.

Definition at line 53 of file RawSiStripHit.h.

53{};

Member Function Documentation

◆ clear()

void ldmx::RawSiStripHit::clear ( )

Clear the vector of samples and set the timestamp to 0.

This class is needed by ROOT when building the dictionary.

Definition at line 19 of file RawSiStripHit.cxx.

19 {
20 layer_id_ = -1;
21 strip_id_ = -1;
22 samples_.clear();
23 time_ = 0;
24 track_id_ = -1;
25 pdg_id_ = 0;
26 sim_hit_id_ = -1;
27 edep_ = 0.f;
28}

References edep_, layer_id_, pdg_id_, samples_, sim_hit_id_, strip_id_, time_, and track_id_.

◆ getEdep()

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

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

Definition at line 110 of file RawSiStripHit.h.

110{ return edep_; }

References edep_.

◆ getLayerID()

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

Get the sensor layer identifier.

Definition at line 83 of file RawSiStripHit.h.

83{ return layer_id_; }

References layer_id_.

◆ getPdgID()

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

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

Definition at line 104 of file RawSiStripHit.h.

104{ return pdg_id_; }

References pdg_id_.

◆ getSamples()

std::vector< short > ldmx::RawSiStripHit::getSamples ( ) const
inline

Get the digitized (ADC) samples composing this hit.

This can be a single value or multiple values depending on the readout being used.

Parameters
[in]samples_The ADC values composing this hit. For now, the size of a sample is assumed to be 16 bits.
Returns
[out] A std::vector of 16 bit samples.

Definition at line 80 of file RawSiStripHit.h.

80{ return samples_; }

References samples_.

◆ getSimHitID()

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

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

Definition at line 107 of file RawSiStripHit.h.

107{ return sim_hit_id_; }

References sim_hit_id_.

◆ getStripID()

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

Get the readout strip index within the sensor.

Definition at line 86 of file RawSiStripHit.h.

86{ return strip_id_; }

References strip_id_.

◆ getTime()

long ldmx::RawSiStripHit::getTime ( ) const
inline

Get the time stamp of this hit.

This is the time stamp as set by the data aquisition system. This will typically be in units of ns.

Returns
[out] The timestamp of this hit in ns.

Definition at line 96 of file RawSiStripHit.h.

96{ return time_; }

References time_.

Referenced by operator<().

◆ getTrackID()

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

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

Definition at line 100 of file RawSiStripHit.h.

100{ return track_id_; }

References track_id_.

◆ operator<()

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

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.

Parameters
[in]rhsThe RawStripHit on the right side of the comparison.
Returns
[out] True if the timestamp of this hit is less than the hit being compared against.

Definition at line 121 of file RawSiStripHit.h.

121 {
122 return getTime() < rhs.getTime();
123 }
long getTime() const
Get the time stamp of this hit.

References getTime().

Friends And Related Symbol Documentation

◆ operator<< [1/2]

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

Print the string representation of this object.

This class is needed by ROOT when building the dictionary.

Definition at line 30 of file RawSiStripHit.cxx.

30 {
31 output << "[ RawSiStripHit ]: 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}

◆ operator<< [2/2]

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

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

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

This class is needed by ROOT when building the dictionary.

Definition at line 30 of file RawSiStripHit.cxx.

30 {
31 output << "[ RawSiStripHit ]: 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::RawSiStripHit::edep_ {0.f}
protected

Energy deposited by the parent SimTrackerHit [MeV].

Definition at line 160 of file RawSiStripHit.h.

160{0.f};

Referenced by clear(), and getEdep().

◆ layer_id_

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

Sensor layer identifier (from tracking geometry).

Definition at line 141 of file RawSiStripHit.h.

141{-1};

Referenced by clear(), and getLayerID().

◆ pdg_id_

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

PDG particle ID of the particle that created this hit.

Definition at line 156 of file RawSiStripHit.h.

156{0};

Referenced by clear(), and getPdgID().

◆ samples_

std::vector<short> ldmx::RawSiStripHit::samples_
protected

16 bit ADC samples associated with this hit.

Definition at line 147 of file RawSiStripHit.h.

Referenced by clear(), and getSamples().

◆ sim_hit_id_

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

Detector ID of the originating SimTrackerHit.

Definition at line 158 of file RawSiStripHit.h.

158{-1};

Referenced by clear(), and getSimHitID().

◆ strip_id_

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

Readout strip index within the sensor.

Definition at line 144 of file RawSiStripHit.h.

144{-1};

Referenced by clear(), and getStripID().

◆ time_

long ldmx::RawSiStripHit::time_ {0}
protected

The hit time stamp in units of ns.

Definition at line 150 of file RawSiStripHit.h.

150{0};

Referenced by clear(), and getTime().

◆ track_id_

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

Geant4 track ID of the particle that created this hit.

Definition at line 154 of file RawSiStripHit.h.

154{-1};

Referenced by clear(), and getTrackID().


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