LArSoft  v09_90_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 fSummedADC;
62  float
64  float
66  short int fMultiplicity;
67  short int fLocalIndex;
69  int fNDF;
73 
74  friend class HitCreator; // helper to create hits
75 
76  public:
101  Hit(raw::ChannelID_t channel,
102  raw::TDCtick_t start_tick,
103  raw::TDCtick_t end_tick,
104  float peak_time,
105  float sigma_peak_time,
106  float rms,
107  float peak_amplitude,
108  float sigma_peak_amplitude,
109  float summedADC,
110  float hit_integral,
111  float hit_sigma_integral,
112  short int multiplicity,
113  short int local_index,
114  float goodness_of_fit,
115  int dof,
116  geo::View_t view,
117  geo::SigType_t signal_type,
118  geo::WireID wireID);
119 
122 
124  raw::TDCtick_t StartTick() const;
125 
127  raw::TDCtick_t EndTick() const;
128 
130  float PeakTime() const;
131 
133  float SigmaPeakTime() const;
134 
136  float RMS() const;
137 
139  float PeakAmplitude() const;
140 
142  float SigmaPeakAmplitude() const;
143 
145  float SummedADC() const;
146 
148  float Integral() const;
149 
151  float SigmaIntegral() const;
152 
154  short int Multiplicity() const;
155 
157  short int LocalIndex() const;
158 
160  float GoodnessOfFit() const;
161 
163  int DegreesOfFreedom() const;
164 
166  raw::ChannelID_t Channel() const;
167 
169  geo::View_t View() const;
170 
172  geo::SigType_t SignalType() const;
173 
175  geo::WireID const& WireID() const;
176 
178 
180 
192  float PeakTimePlusRMS(float sigmas = +1.) const;
193  float PeakTimeMinusRMS(float sigmas = +1.) const;
195 
204  float TimeDistanceAsRMS(float time) const;
205 
206  friend std::ostream& operator<<(std::ostream& o, const Hit& a);
207  friend bool operator<(const Hit& a, const Hit& b);
208 
209  }; // class Hit
210 } // namespace recob
211 
213 {
214  return fStartTick;
215 }
217 {
218  return fEndTick;
219 }
220 inline float recob::Hit::PeakTime() const
221 {
222  return fPeakTime;
223 }
224 inline float recob::Hit::SigmaPeakTime() const
225 {
226  return fSigmaPeakTime;
227 }
228 inline float recob::Hit::RMS() const
229 {
230  return fRMS;
231 }
232 inline float recob::Hit::PeakAmplitude() const
233 {
234  return fPeakAmplitude;
235 }
236 inline float recob::Hit::SigmaPeakAmplitude() const
237 {
238  return fSigmaPeakAmplitude;
239 }
240 inline float recob::Hit::SummedADC() const
241 {
242  return fSummedADC;
243 }
244 inline float recob::Hit::Integral() const
245 {
246  return fIntegral;
247 }
248 inline float recob::Hit::SigmaIntegral() const
249 {
250  return fSigmaIntegral;
251 }
252 inline short int recob::Hit::Multiplicity() const
253 {
254  return fMultiplicity;
255 }
256 inline short int recob::Hit::LocalIndex() const
257 {
258  return fLocalIndex;
259 }
260 inline float recob::Hit::GoodnessOfFit() const
261 {
262  return fGoodnessOfFit;
263 }
265 {
266  return fNDF;
267 }
269 {
270  return fChannel;
271 }
273 {
274  return fSignalType;
275 }
277 {
278  return fView;
279 }
280 inline geo::WireID const& recob::Hit::WireID() const
281 {
282  return fWireID;
283 }
284 
285 inline float recob::Hit::PeakTimePlusRMS(float sigmas /* = +1. */) const
286 {
287  return PeakTime() + sigmas * RMS();
288 }
289 
290 inline float recob::Hit::PeakTimeMinusRMS(float sigmas /* = +1. */) const
291 {
292  return PeakTimePlusRMS(-sigmas);
293 }
294 
295 inline float recob::Hit::TimeDistanceAsRMS(float time) const
296 {
297  return (time - PeakTime()) / RMS();
298 }
299 
300 #endif // LARDATAOBJ_RECOBASE_HIT_H
short int LocalIndex() const
How well do we believe we know this hit?
Definition: Hit.h:256
friend bool operator<(const Hit &a, const Hit &b)
Definition: Hit.cxx:106
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
Definition: Hit.h:272
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.
float fSummedADC
the sum of calibrated ADC counts of the hit
Definition: Hit.h:61
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:228
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:70
geo::SigType_t fSignalType
signal type for the plane of the hit
Definition: Hit.h:71
float SigmaPeakAmplitude() const
Uncertainty on estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:236
float SigmaIntegral() const
Initial tdc tick for hit.
Definition: Hit.h:248
int DegreesOfFreedom() const
Initial tdc tick for hit.
Definition: Hit.h:264
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:244
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:276
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:280
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:260
short int Multiplicity() const
How many hits could this one be shared with.
Definition: Hit.h:252
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:232
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:66
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:295
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:69
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:212
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:290
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
Definition: Hit.h:216
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:220
geo::WireID fWireID
WireID for the hit (Cryostat, TPC, Plane, Wire)
Definition: Hit.h:72
float fSigmaIntegral
the uncertainty of integral under the calibrated signal waveform of the hit, in ADC units ...
Definition: Hit.h:65
float fGoodnessOfFit
how well do we believe we know this hit?
Definition: Hit.h:68
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:240
short int fLocalIndex
index of this hit among the Multiplicity() hits in the signal window
Definition: Hit.h:67
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
Definition: Hit.h:224
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:63
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Definition: Hit.h:285
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:268