LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 #include <utility> // std::move()
16 
17 
18 namespace recob {
19 
20  //----------------------------------------------------------------------
22  : fChannel(raw::InvalidChannelID)
23  , fStartTick(0)
24  , fEndTick(0)
25  , fPeakTime(0.)
26  , fSigmaPeakTime(-1.)
27  , fRMS(0.)
28  , fPeakAmplitude(0.)
29  , fSigmaPeakAmplitude(-1.)
30  , fSummedADC(0.)
31  , fIntegral(0.)
32  , fSigmaIntegral(-1.)
33  , fMultiplicity(0)
34  , fLocalIndex(-1)
35  , fGoodnessOfFit(0.)
36  , fNDF(-1)
37  , fView(geo::kUnknown)
38  , fSignalType(geo::kMysteryType)
39  , fWireID() // invalid
40  {}
41 
42  //----------------------------------------------------------------------
44  raw::ChannelID_t channel,
45  raw::TDCtick_t start_tick,
46  raw::TDCtick_t end_tick,
47  float peak_time,
48  float sigma_peak_time,
49  float rms,
50  float peak_amplitude,
51  float sigma_peak_amplitude,
52  float summedADC,
53  float hit_integral,
54  float hit_sigma_integral,
55  short int multiplicity,
56  short int local_index,
57  float goodness_of_fit,
58  int dof,
59  geo::View_t view,
60  geo::SigType_t signal_type,
61  geo::WireID wireID
62  )
63  : fChannel(channel)
64  , fStartTick(start_tick)
65  , fEndTick(end_tick)
66  , fPeakTime(peak_time)
67  , fSigmaPeakTime(sigma_peak_time)
68  , fRMS(rms)
69  , fPeakAmplitude(peak_amplitude)
70  , fSigmaPeakAmplitude(sigma_peak_amplitude)
71  , fSummedADC(summedADC)
72  , fIntegral(hit_integral)
73  , fSigmaIntegral(hit_sigma_integral)
74  , fMultiplicity(multiplicity)
75  , fLocalIndex(local_index)
76  , fGoodnessOfFit(goodness_of_fit)
77  , fNDF(dof)
78  , fView(view)
79  , fSignalType(signal_type)
80  , fWireID(wireID)
81  {}
82 
83 
84  //----------------------------------------------------------------------
85  // ostream operator.
86  //
87  std::ostream& operator<< (std::ostream& o, Hit const& hit) {
88  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
89  o << " Channel " << std::setw(5) << std::right << hit.Channel()
90  << " View = " << std::setw(3) << std::right << hit.View()
91  << " Signal type = " << std::setw(3) << std::right << hit.SignalType()
92  << " Wire = " << std::setw(3) << std::right << hit.WireID()
93  << "\n\tStartTick = " << std::setw(7) << std::right << hit.StartTick()
94  << "\tEndTick = " << std::setw(7) << std::right << hit.EndTick()
95  << "\tPeakTime = " << std::setw(7) << std::right << hit.PeakTime()
96  << " +/- " << std::setw(7) << std::right << hit.SigmaPeakTime()
97  << "\tRMS = " << std::setw(7) << std::right << hit.RMS()
98  << "\n\tAmplitude = " << std::setw(7) << std::right << hit.PeakAmplitude()
99  << " +/- " << std::setw(7) << std::right << hit.SigmaPeakAmplitude()
100  << "\tIntegral = " << std::setw(7) << std::right << hit.Integral()
101  << " +/- " << std::setw(7) << std::right << hit.SigmaIntegral()
102  << "\tADCsum = " << std::setw(7) << std::right << hit.SummedADC()
103  << "\tMultiplicity = " << std::setw(5) << std::right << hit.LocalIndex() << " of " << hit.Multiplicity()
104  << "\tGoodnessOfFit = " << std::setw(7) << std::right << hit.GoodnessOfFit()
105  << " DoF = " << std::setw(7) << std::right << hit.DegreesOfFreedom()
106  << std::endl;
107  return o;
108  } // operator<< (std::ostream, Hit)
109 
110 
111  //----------------------------------------------------------------------
112  // < operator.
113  //
114  bool operator < (const Hit & a, const Hit & b)
115  {
116  if (a.Channel() != b.Channel())
117  return a.Channel() < b.Channel();
118  if (a.View() != b.View())
119  return a.View() < b.View();
120  if (a.StartTick() != b.StartTick())
121  return a.StartTick() < b.StartTick();
122 
123  return false; //They are equal
124  } // operator< (Hit, Hit)
125 
126 
127  //----------------------------------------------------------------------
128 } // namespace recob
short int LocalIndex() const
How well do we believe we know this hit?
Definition: Hit.h:228
friend bool operator<(const Hit &a, const Hit &b)
Definition: Hit.cxx:114
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
Definition: Hit.h:232
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
float fPeakAmplitude
the estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:62
raw::TDCtick_t fStartTick
initial tdc tick for hit
Definition: Hit.h:57
Reconstruction base classes.
Who knows?
Definition: geo_types.h:94
float fSummedADC
the sum of calibrated ADC counts of the hit
Definition: Hit.h:64
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Unknown view.
Definition: geo_types.h:83
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:221
float fSigmaPeakAmplitude
uncertainty on estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:63
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:223
float SigmaIntegral() const
Initial tdc tick for hit.
Definition: Hit.h:226
int DegreesOfFreedom() const
Initial tdc tick for hit.
Definition: Hit.h:230
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:225
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:233
Raw data description.
Definition: RawTypes.h:6
Hit()
Default constructor: a hit with no signal.
Definition: Hit.cxx:21
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
Definition: Hit.h:229
short int Multiplicity() const
How many hits could this one be shared with.
Definition: Hit.h:227
raw::TDCtick_t fEndTick
final tdc tick for hit
Definition: Hit.h:58
float fSigmaPeakTime
uncertainty for the signal peak, in tick units
Definition: Hit.h:60
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:222
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:24
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:59
raw::ChannelID_t fChannel
ID of the readout channel the hit was extracted from.
Definition: Hit.h:56
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:61
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
Definition: Hit.h:217
Detector simulation of raw signals on wires.
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
Definition: Hit.h:218
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
geo::WireID fWireID
WireID for the hit (Cryostat, TPC, Plane, Wire)
Definition: Hit.h:73
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 SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:224
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:220
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
float fIntegral
the integral under the calibrated signal waveform of the hit, in tick x ADC units ...
Definition: Hit.h:65
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
Namespace collecting geometry-related classes utilities.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:231