LDMX Software
FittedSiStripHit.h
1#pragma once
2
3#include <iostream>
4
5#include "TObject.h"
6
7namespace ldmx {
8
24 public:
25 FittedSiStripHit() = default;
26
27 FittedSiStripHit(int layer_id, int strip_id, float amplitude, float t0,
28 float chi2, int ndf, int track_id = -1, int pdg_id = 0,
29 int sim_hit_id = -1, float edep = 0.f, float noise = 0.f)
30 : layer_id_(layer_id),
31 strip_id_(strip_id),
32 amplitude_(amplitude),
33 t0_(t0),
34 chi2_(chi2),
35 ndf_(ndf),
36 track_id_(track_id),
37 pdg_id_(pdg_id),
38 sim_hit_id_(sim_hit_id),
39 edep_(edep),
40 noise_(noise) {}
41
42 virtual ~FittedSiStripHit() = default;
43
44 void clear() {
45 layer_id_ = -1;
46 strip_id_ = -1;
47 amplitude_ = 0;
48 t0_ = 0;
49 chi2_ = 0;
50 ndf_ = 0;
51 track_id_ = -1;
52 pdg_id_ = 0;
53 sim_hit_id_ = -1;
54 edep_ = 0.f;
55 noise_ = 0.f;
56 }
57
58 // --- Getters ---
59 int getLayerID() const { return layer_id_; }
60 int getStripID() const { return strip_id_; }
62 float getAmplitude() const { return amplitude_; }
64 float getT0() const { return t0_; }
65 float getChi2() const { return chi2_; }
66 int getNDF() const { return ndf_; }
67 float getReducedChi2() const { return (ndf_ > 0) ? chi2_ / ndf_ : 0.f; }
69 int getTrackID() const { return track_id_; }
71 int getPdgID() const { return pdg_id_; }
73 int getSimHitID() const { return sim_hit_id_; }
75 float getEdep() const { return edep_; }
78 float getNoise() const { return noise_; }
79
80 // --- Setters ---
81 void setLayerID(int v) { layer_id_ = v; }
82 void setStripID(int v) { strip_id_ = v; }
83 void setAmplitude(float v) { amplitude_ = v; }
84 void setT0(float v) { t0_ = v; }
85 void setChi2(float v) { chi2_ = v; }
86 void setNDF(int v) { ndf_ = v; }
87 void setTrackID(int v) { track_id_ = v; }
88 void setPdgID(int v) { pdg_id_ = v; }
89 void setSimHitID(int v) { sim_hit_id_ = v; }
90 void setEdep(float v) { edep_ = v; }
91 void setNoise(float v) { noise_ = v; }
92
93 friend std::ostream& operator<<(std::ostream& o, const FittedSiStripHit& h) {
94 o << "[ FittedSiStripHit ]: layer=" << h.layer_id_
95 << " strip=" << h.strip_id_ << " amp=" << h.amplitude_ << " ADC"
96 << " t0=" << h.t0_ << " ns" << " chi2/ndf=" << h.chi2_ << "/" << h.ndf_
97 << " track_id=" << h.track_id_ << " pdg_id=" << h.pdg_id_
98 << " sim_hit_id=" << h.sim_hit_id_ << " edep=" << h.edep_ << " MeV"
99 << " noise=" << h.noise_ << " ADC";
100 return o;
101 }
102
103 protected:
104 int layer_id_{-1};
105 int strip_id_{-1};
107 0};
108 float t0_{0};
109 float chi2_{0};
110 int ndf_{0};
111
112 // Truth information (for MC truth matching; -1/0 means not set)
114 int track_id_{-1};
116 int pdg_id_{0};
118 int sim_hit_id_{-1};
120 float edep_{0.f};
122 float noise_{0.f};
123
124 ClassDef(FittedSiStripHit, 2);
125};
126
127} // namespace ldmx
Result of fitting a pulse shape to the ADC samples of a single readout strip.
int getPdgID() const
PDG particle ID of the particle that created this hit (0 if unknown).
int getSimHitID() const
Detector ID of the originating SimTrackerHit (-1 if unknown).
float noise_
Per-strip noise RMS [ADC counts]; 0 means unset.
int track_id_
Geant4 track ID of the particle that created this hit.
float edep_
Energy deposited by the parent SimTrackerHit [MeV].
float t0_
Fitted hit time [ns] in sample-window frame.
int pdg_id_
PDG particle ID of the particle that created this hit.
int getTrackID() const
Geant4 track ID of the particle that created this hit (-1 if unknown).
int sim_hit_id_
Detector ID of the originating SimTrackerHit.
float getEdep() const
Energy deposited by the parent SimTrackerHit [MeV] (0 if unknown).
float getAmplitude() const
Fitted pedestal-subtracted peak amplitude [ADC counts].
float getNoise() const
Per-strip noise RMS [ADC counts] (0 if unknown; clustering then falls back to the global StripCluster...
float amplitude_
Fitted peak amplitude [ADC counts], pedestal-subtracted.
float getT0() const
Fitted hit arrival time [ns] in the sample-window reference frame.