LDMX Software
RawSiStripHit.h
1
2#ifndef TRACKING_EVENT_RAWSISTRIPHIT_H_
3#define TRACKING_EVENT_RAWSISTRIPHIT_H_
4
5//----------------------//
6// C++ Standard Lib //
7//----------------------//
8#include <iostream>
9#include <vector>
10
11//----------//
12// ROOT //
13//----------//
14#include "TObject.h"
15
16namespace ldmx {
17
27 public:
29 RawSiStripHit() = default;
30
44 RawSiStripHit(int layer_id, int strip_id, std::vector<short> samples,
45 long time, int track_id = -1, int pdg_id = 0,
46 int sim_hit_id = -1, float edep = 0.f);
47
53 virtual ~RawSiStripHit(){};
54
60 void clear();
61
67 friend std::ostream &operator<<(std::ostream &o, const RawSiStripHit &d);
68
80 std::vector<short> getSamples() const { return samples_; }
81
83 int getLayerID() const { return layer_id_; }
84
86 int getStripID() const { return strip_id_; }
87
96 long getTime() const { return time_; }
97
100 int getTrackID() const { return track_id_; }
101
104 int getPdgID() const { return pdg_id_; }
105
107 int getSimHitID() const { return sim_hit_id_; }
108
110 float getEdep() const { return edep_; }
111
121 bool operator<(const RawSiStripHit &rhs) const {
122 return getTime() < rhs.getTime();
123 }
124
136 friend std::ostream &operator<<(std::ostream &output,
137 const RawSiStripHit &hit);
138
139 protected:
141 int layer_id_{-1};
142
144 int strip_id_{-1};
145
147 std::vector<short> samples_;
148
150 long time_{0};
151
152 // Truth information (for MC truth matching; -1/0 means not set)
154 int track_id_{-1};
156 int pdg_id_{0};
158 int sim_hit_id_{-1};
160 float edep_{0.f};
161
164
165}; // RawSiStripHit
166} // namespace ldmx
167
168#endif // TRACKING_EVENT_RAWSISTRIPHIT_H_
Implementation of a raw digitized hit from a silicon strip detector.
long getTime() const
Get the time stamp of this hit.
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.
RawSiStripHit()=default
Default constructor.
void clear()
Clear the vector of samples and set the timestamp to 0.
virtual ~RawSiStripHit()
Destructor.
int getSimHitID() const
Get the detector ID of the originating SimTrackerHit (-1 if unknown).
int sim_hit_id_
Detector ID of the originating SimTrackerHit.
int getLayerID() const
Get the sensor layer identifier.
std::vector< short > samples_
16 bit ADC samples associated with this hit.
int strip_id_
Readout strip index within the sensor.
std::vector< short > getSamples() const
Get the digitized (ADC) samples composing this hit.
int getTrackID() const
Get the Geant4 track ID of the particle that created this hit (-1 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 h...
float edep_
Energy deposited by the parent SimTrackerHit [MeV].
ClassDef(RawSiStripHit, 3)
Class declaration needed by the ROOT dictionary.
friend std::ostream & operator<<(std::ostream &o, const RawSiStripHit &d)
Print the string representation of this object.
int pdg_id_
PDG particle ID of the particle that created this hit.
int getPdgID() const
Get the PDG particle ID of the particle that created this hit (0 if unknown).
int getStripID() const
Get the readout strip index within the sensor.
float getEdep() const
Get the energy deposited by the parent SimTrackerHit [MeV] (0 if unknown).