LArSoft  v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
Hit.cxx
Go to the documentation of this file.
1 
9 // Hit header
11 
12 // C/C++ standard library
13 #include <iomanip>
14 #include <ostream>
15 
16 namespace recob {
17 
18  //----------------------------------------------------------------------
20  : fChannel(raw::InvalidChannelID)
21  , fStartTick(0)
22  , fEndTick(0)
23  , fPeakTime(0.)
24  , fSigmaPeakTime(-1.)
25  , fRMS(0.)
26  , fPeakAmplitude(0.)
27  , fSigmaPeakAmplitude(-1.)
28  , fROISummedADC(0.)
29  , fHitSummedADC(0.)
30  , fIntegral(0.)
31  , fSigmaIntegral(-1.)
32  , fMultiplicity(0)
33  , fLocalIndex(-1)
34  , fGoodnessOfFit(0.)
35  , fNDF(-1)
36  , fView(geo::kUnknown)
37  , fSignalType(geo::kMysteryType)
38  , fWireID() // invalid
39  {}
40 
41  //----------------------------------------------------------------------
43  raw::TDCtick_t start_tick,
44  raw::TDCtick_t end_tick,
45  float peak_time,
46  float sigma_peak_time,
47  float rms,
48  float peak_amplitude,
49  float sigma_peak_amplitude,
50  float ROIsummedADC,
51  float HitsummedADC,
52  float hit_integral,
53  float hit_sigma_integral,
54  short int multiplicity,
55  short int local_index,
56  float goodness_of_fit,
57  int dof,
58  geo::View_t view,
59  geo::SigType_t signal_type,
60  geo::WireID wireID)
61  : fChannel(channel)
62  , fStartTick(start_tick)
63  , fEndTick(end_tick)
64  , fPeakTime(peak_time)
65  , fSigmaPeakTime(sigma_peak_time)
66  , fRMS(rms)
67  , fPeakAmplitude(peak_amplitude)
68  , fSigmaPeakAmplitude(sigma_peak_amplitude)
69  , fROISummedADC(ROIsummedADC)
70  , fHitSummedADC(HitsummedADC)
71  , fIntegral(hit_integral)
72  , fSigmaIntegral(hit_sigma_integral)
73  , fMultiplicity(multiplicity)
74  , fLocalIndex(local_index)
75  , fGoodnessOfFit(goodness_of_fit)
76  , fNDF(dof)
77  , fView(view)
78  , fSignalType(signal_type)
79  , fWireID(wireID)
80  {}
81 
82  //----------------------------------------------------------------------
83  // ostream operator.
84  //
85  std::ostream& operator<<(std::ostream& o, Hit const& hit)
86  {
87  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
88  o << " Channel " << std::setw(5) << std::right << hit.Channel() << " View = " << std::setw(3)
89  << std::right << hit.View() << " Signal type = " << std::setw(3) << std::right
90  << hit.SignalType() << " Wire = " << std::setw(3) << std::right << hit.WireID()
91  << "\n\tStartTick = " << std::setw(7) << std::right << hit.StartTick()
92  << "\tEndTick = " << std::setw(7) << std::right << hit.EndTick()
93  << "\tPeakTime = " << std::setw(7) << std::right << hit.PeakTime() << " +/- " << std::setw(7)
94  << std::right << hit.SigmaPeakTime() << "\tRMS = " << std::setw(7) << std::right << hit.RMS()
95  << "\n\tAmplitude = " << std::setw(7) << std::right << hit.PeakAmplitude() << " +/- "
96  << std::setw(7) << std::right << hit.SigmaPeakAmplitude() << "\tIntegral = " << std::setw(7)
97  << std::right << hit.Integral() << " +/- " << std::setw(7) << std::right
98  << hit.SigmaIntegral() << "\tROIADCsum = " << std::setw(7) << std::right << hit.ROISummedADC()
99  << "\tHitADCsum = " << std::setw(7) << std::right << hit.HitSummedADC()
100  << "\tMultiplicity = " << std::setw(5) << std::right << hit.LocalIndex() << " of "
101  << hit.Multiplicity() << "\tGoodnessOfFit = " << std::setw(7) << std::right
102  << hit.GoodnessOfFit() << " DoF = " << std::setw(7) << std::right << hit.DegreesOfFreedom()
103  << std::endl;
104  return o;
105  } // operator<< (std::ostream, Hit)
106 
107  //----------------------------------------------------------------------
108  // < operator.
109  //
110  bool operator<(const Hit& a, const Hit& b)
111  {
112  if (a.Channel() != b.Channel()) return a.Channel() < b.Channel();
113  if (a.View() != b.View()) return a.View() < b.View();
114  if (a.PeakTime() != b.PeakTime()) return a.PeakTime() < b.PeakTime();
115 
116  return false; //They are equal
117  } // operator< (Hit, Hit)
118 
119  //----------------------------------------------------------------------
120 } // namespace recob
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
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
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.
Who knows?
Definition: geo_types.h:153
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Unknown view.
Definition: geo_types.h:142
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
Declaration of signal hit object.
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
Raw data description.
Definition: RawTypes.h:6
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
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
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
float HitSummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:250
Detector simulation of raw signals on wires.
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
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
Namespace collecting geometry-related classes utilities.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:278