LArSoft  v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
Hit.h
Go to the documentation of this file.
1 
21 #ifndef LARDATAOBJ_RECOBASE_HIT_H
22 #define LARDATAOBJ_RECOBASE_HIT_H
23 
24 // C/C++ standard librraies
25 #include <iosfwd>
26 
27 // LArSoft libraries
28 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
29 #include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // geo::View_t, geo::SignalType, geo::WireID
30 
31 namespace recob {
32 
46  class Hit {
47  public:
49  Hit();
50 
51  private:
55  float fPeakTime;
57  float fRMS;
59  float
61  float fROISummedADC;
62  float fHitSummedADC;
63  float
65  float
67  short int fMultiplicity;
68  short int fLocalIndex;
70  int fNDF;
74 
75  friend class HitCreator; // helper to create hits
76 
77  public:
103  Hit(raw::ChannelID_t channel,
104  raw::TDCtick_t start_tick,
105  raw::TDCtick_t end_tick,
106  float peak_time,
107  float sigma_peak_time,
108  float rms,
109  float peak_amplitude,
110  float sigma_peak_amplitude,
111  float ROIsummedADC,
112  float HitsummedADC,
113  float hit_integral,
114  float hit_sigma_integral,
115  short int multiplicity,
116  short int local_index,
117  float goodness_of_fit,
118  int dof,
119  geo::View_t view,
120  geo::SigType_t signal_type,
121  geo::WireID wireID);
122 
125 
127  raw::TDCtick_t StartTick() const;
128 
130  raw::TDCtick_t EndTick() const;
131 
133  float PeakTime() const;
134 
136  float SigmaPeakTime() const;
137 
139  float RMS() const;
140 
142  float PeakAmplitude() const;
143 
145  float SigmaPeakAmplitude() const;
146 
148  float ROISummedADC() const;
149 
151  float HitSummedADC() const;
152 
154  float Integral() const;
155 
157  float SigmaIntegral() const;
158 
160  short int Multiplicity() const;
161 
163  short int LocalIndex() const;
164 
166  float GoodnessOfFit() const;
167 
169  int DegreesOfFreedom() const;
170 
172  raw::ChannelID_t Channel() const;
173 
175  geo::View_t View() const;
176 
178  geo::SigType_t SignalType() const;
179 
181  geo::WireID const& WireID() const;
182 
184 
186 
198  float PeakTimePlusRMS(float sigmas = +1.) const;
199  float PeakTimeMinusRMS(float sigmas = +1.) const;
201 
210  float TimeDistanceAsRMS(float time) const;
211 
212  friend std::ostream& operator<<(std::ostream& o, const Hit& a);
213  friend bool operator<(const Hit& a, const Hit& b);
214 
215  }; // class Hit
216 } // namespace recob
217 
219 {
220  return fStartTick;
221 }
223 {
224  return fEndTick;
225 }
226 inline float recob::Hit::PeakTime() const
227 {
228  return fPeakTime;
229 }
230 inline float recob::Hit::SigmaPeakTime() const
231 {
232  return fSigmaPeakTime;
233 }
234 inline float recob::Hit::RMS() const
235 {
236  return fRMS;
237 }
238 inline float recob::Hit::PeakAmplitude() const
239 {
240  return fPeakAmplitude;
241 }
242 inline float recob::Hit::SigmaPeakAmplitude() const
243 {
244  return fSigmaPeakAmplitude;
245 }
246 inline float recob::Hit::ROISummedADC() const
247 {
248  return fROISummedADC;
249 }
250 inline float recob::Hit::HitSummedADC() const
251 {
252  return fHitSummedADC;
253 }
254 inline float recob::Hit::Integral() const
255 {
256  return fIntegral;
257 }
258 inline float recob::Hit::SigmaIntegral() const
259 {
260  return fSigmaIntegral;
261 }
262 inline short int recob::Hit::Multiplicity() const
263 {
264  return fMultiplicity;
265 }
266 inline short int recob::Hit::LocalIndex() const
267 {
268  return fLocalIndex;
269 }
270 inline float recob::Hit::GoodnessOfFit() const
271 {
272  return fGoodnessOfFit;
273 }
275 {
276  return fNDF;
277 }
279 {
280  return fChannel;
281 }
283 {
284  return fSignalType;
285 }
287 {
288  return fView;
289 }
290 inline geo::WireID const& recob::Hit::WireID() const
291 {
292  return fWireID;
293 }
294 
295 inline float recob::Hit::PeakTimePlusRMS(float sigmas /* = +1. */) const
296 {
297  return PeakTime() + sigmas * RMS();
298 }
299 
300 inline float recob::Hit::PeakTimeMinusRMS(float sigmas /* = +1. */) const
301 {
302  return PeakTimePlusRMS(-sigmas);
303 }
304 
305 inline float recob::Hit::TimeDistanceAsRMS(float time) const
306 {
307  return (time - PeakTime()) / RMS();
308 }
309 
310 #endif // LARDATAOBJ_RECOBASE_HIT_H
short int LocalIndex() const
How well do we believe we know this hit?
Definition: Hit.h:266
friend bool operator<(const Hit &a, const Hit &b)
Definition: Hit.cxx:110
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
Definition: Hit.h:282
float fPeakAmplitude
the estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:58
raw::TDCtick_t fStartTick
initial tdc tick for hit
Definition: Hit.h:53
Reconstruction base classes.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:234
float fSigmaPeakAmplitude
uncertainty on estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:60
geo::View_t fView
view for the plane of the hit
Definition: Hit.h:71
geo::SigType_t fSignalType
signal type for the plane of the hit
Definition: Hit.h:72
float SigmaPeakAmplitude() const
Uncertainty on estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:242
float SigmaIntegral() const
Initial tdc tick for hit.
Definition: Hit.h:258
int DegreesOfFreedom() const
Initial tdc tick for hit.
Definition: Hit.h:274
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:254
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:286
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:290
Hit()
Default constructor: a hit with no signal.
Definition: Hit.cxx:19
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
Definition: Hit.h:270
short int Multiplicity() const
How many hits could this one be shared with.
Definition: Hit.h:262
raw::TDCtick_t fEndTick
final tdc tick for hit
Definition: Hit.h:54
float fSigmaPeakTime
uncertainty for the signal peak, in tick units
Definition: Hit.h:56
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:238
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:25
friend std::ostream & operator<<(std::ostream &o, const Hit &a)
short int fMultiplicity
how many hits could this one be shared with
Definition: Hit.h:67
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:87
float TimeDistanceAsRMS(float time) const
Returns the distance of the specified time from peak, in RMS units.
Definition: Hit.h:305
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
float fPeakTime
time of the signal peak, in tick units
Definition: Hit.h:55
raw::ChannelID_t fChannel
ID of the readout channel the hit was extracted from.
Definition: Hit.h:52
int fNDF
degrees of freedom in the determination of the hit shape
Definition: Hit.h:70
float fRMS
RMS of the hit shape, in tick units.
Definition: Hit.h:57
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
Definition: Hit.h:218
Definition of data types for geometry description.
float PeakTimeMinusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Definition: Hit.h:300
float HitSummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:250
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
Definition: Hit.h:222
float ROISummedADC() const
The sum of calibrated ADC counts of the ROI (0. by default)
Definition: Hit.h:246
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:226
geo::WireID fWireID
WireID for the hit (Cryostat, TPC, Plane, Wire)
Definition: Hit.h:73
float fROISummedADC
the sum of calibrated ADC counts of the ROI
Definition: Hit.h:61
float fSigmaIntegral
the uncertainty of integral under the calibrated signal waveform of the hit, in ADC units ...
Definition: Hit.h:66
float fGoodnessOfFit
how well do we believe we know this hit?
Definition: Hit.h:69
float fHitSummedADC
the sum of calibrated ADC counts of the ROI
Definition: Hit.h:62
short int fLocalIndex
index of this hit among the Multiplicity() hits in the signal window
Definition: Hit.h:68
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
Definition: Hit.h:230
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
float fIntegral
the integral under the calibrated signal waveform of the hit, in tick x ADC units ...
Definition: Hit.h:64
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Definition: Hit.h:295
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:278