LArSoft  v09_90_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  , fSummedADC(0.)
29  , fIntegral(0.)
30  , fSigmaIntegral(-1.)
31  , fMultiplicity(0)
32  , fLocalIndex(-1)
33  , fGoodnessOfFit(0.)
34  , fNDF(-1)
35  , fView(geo::kUnknown)
36  , fSignalType(geo::kMysteryType)
37  , fWireID() // invalid
38  {}
39 
40  //----------------------------------------------------------------------
42  raw::TDCtick_t start_tick,
43  raw::TDCtick_t end_tick,
44  float peak_time,
45  float sigma_peak_time,
46  float rms,
47  float peak_amplitude,
48  float sigma_peak_amplitude,
49  float summedADC,
50  float hit_integral,
51  float hit_sigma_integral,
52  short int multiplicity,
53  short int local_index,
54  float goodness_of_fit,
55  int dof,
56  geo::View_t view,
57  geo::SigType_t signal_type,
58  geo::WireID wireID)
59  : fChannel(channel)
60  , fStartTick(start_tick)
61  , fEndTick(end_tick)
62  , fPeakTime(peak_time)
63  , fSigmaPeakTime(sigma_peak_time)
64  , fRMS(rms)
65  , fPeakAmplitude(peak_amplitude)
66  , fSigmaPeakAmplitude(sigma_peak_amplitude)
67  , fSummedADC(summedADC)
68  , fIntegral(hit_integral)
69  , fSigmaIntegral(hit_sigma_integral)
70  , fMultiplicity(multiplicity)
71  , fLocalIndex(local_index)
72  , fGoodnessOfFit(goodness_of_fit)
73  , fNDF(dof)
74  , fView(view)
75  , fSignalType(signal_type)
76  , fWireID(wireID)
77  {}
78 
79  //----------------------------------------------------------------------
80  // ostream operator.
81  //
82  std::ostream& operator<<(std::ostream& o, Hit const& hit)
83  {
84  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
85  o << " Channel " << std::setw(5) << std::right << hit.Channel() << " View = " << std::setw(3)
86  << std::right << hit.View() << " Signal type = " << std::setw(3) << std::right
87  << hit.SignalType() << " Wire = " << std::setw(3) << std::right << hit.WireID()
88  << "\n\tStartTick = " << std::setw(7) << std::right << hit.StartTick()
89  << "\tEndTick = " << std::setw(7) << std::right << hit.EndTick()
90  << "\tPeakTime = " << std::setw(7) << std::right << hit.PeakTime() << " +/- " << std::setw(7)
91  << std::right << hit.SigmaPeakTime() << "\tRMS = " << std::setw(7) << std::right << hit.RMS()
92  << "\n\tAmplitude = " << std::setw(7) << std::right << hit.PeakAmplitude() << " +/- "
93  << std::setw(7) << std::right << hit.SigmaPeakAmplitude() << "\tIntegral = " << std::setw(7)
94  << std::right << hit.Integral() << " +/- " << std::setw(7) << std::right
95  << hit.SigmaIntegral() << "\tADCsum = " << std::setw(7) << std::right << hit.SummedADC()
96  << "\tMultiplicity = " << std::setw(5) << std::right << hit.LocalIndex() << " of "
97  << hit.Multiplicity() << "\tGoodnessOfFit = " << std::setw(7) << std::right
98  << hit.GoodnessOfFit() << " DoF = " << std::setw(7) << std::right << hit.DegreesOfFreedom()
99  << std::endl;
100  return o;
101  } // operator<< (std::ostream, Hit)
102 
103  //----------------------------------------------------------------------
104  // < operator.
105  //
106  bool operator<(const Hit& a, const Hit& b)
107  {
108  if (a.Channel() != b.Channel()) return a.Channel() < b.Channel();
109  if (a.View() != b.View()) return a.View() < b.View();
110  if (a.PeakTime() != b.PeakTime()) return a.PeakTime() < b.PeakTime();
111 
112  return false; //They are equal
113  } // operator< (Hit, Hit)
114 
115  //----------------------------------------------------------------------
116 } // namespace recob
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
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
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.
Unknown view.
Definition: geo_types.h:142
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
Declaration of signal hit object.
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
Raw data description.
Definition: RawTypes.h:6
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
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: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
Detector simulation of raw signals on wires.
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
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:268