All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hit.cxx
Go to the documentation of this file.
1 /** ****************************************************************************
2  * @file lardataobj/RecoBase/Hit.cxx
3  * @brief Definition of signal hit object.
4  * @author mitchell.soderberg@yale.edu
5  * @see lardataobj/RecoBase/Hit.h
6  *
7  * ****************************************************************************/
8 
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::ChannelID_t channel,
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 summedADC,
51  float hit_integral,
52  float hit_sigma_integral,
53  short int multiplicity,
54  short int local_index,
55  float goodness_of_fit,
56  int dof,
57  geo::View_t view,
58  geo::SigType_t signal_type,
59  geo::WireID wireID
60  )
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  , fSummedADC(summedADC)
70  , fIntegral(hit_integral)
71  , fSigmaIntegral(hit_sigma_integral)
72  , fMultiplicity(multiplicity)
73  , fLocalIndex(local_index)
74  , fGoodnessOfFit(goodness_of_fit)
75  , fNDF(dof)
76  , fView(view)
77  , fSignalType(signal_type)
78  , fWireID(wireID)
79  {}
80 
81 
82  //----------------------------------------------------------------------
83  // ostream operator.
84  //
85  std::ostream& operator<< (std::ostream& o, Hit const& hit) {
86  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
87  o << " Channel " << std::setw(5) << std::right << hit.Channel()
88  << " View = " << std::setw(3) << std::right << hit.View()
89  << " Signal type = " << std::setw(3) << std::right << hit.SignalType()
90  << " 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()
94  << " +/- " << std::setw(7) << std::right << hit.SigmaPeakTime()
95  << "\tRMS = " << std::setw(7) << std::right << hit.RMS()
96  << "\n\tAmplitude = " << std::setw(7) << std::right << hit.PeakAmplitude()
97  << " +/- " << std::setw(7) << std::right << hit.SigmaPeakAmplitude()
98  << "\tIntegral = " << std::setw(7) << std::right << hit.Integral()
99  << " +/- " << std::setw(7) << std::right << hit.SigmaIntegral()
100  << "\tADCsum = " << std::setw(7) << std::right << hit.SummedADC()
101  << "\tMultiplicity = " << std::setw(5) << std::right << hit.LocalIndex() << " of " << hit.Multiplicity()
102  << "\tGoodnessOfFit = " << std::setw(7) << std::right << hit.GoodnessOfFit()
103  << " DoF = " << std::setw(7) << std::right << hit.DegreesOfFreedom()
104  << std::endl;
105  return o;
106  } // operator<< (std::ostream, Hit)
107 
108 
109  //----------------------------------------------------------------------
110  // < operator.
111  //
112  bool operator < (const Hit & a, const Hit & b)
113  {
114  if (a.Channel() != b.Channel())
115  return a.Channel() < b.Channel();
116  if (a.View() != b.View())
117  return a.View() < b.View();
118  if (a.PeakTime() != b.PeakTime())
119  return a.PeakTime() < b.PeakTime();
120 
121  return false; //They are equal
122  } // operator< (Hit, Hit)
123 
124 
125  //----------------------------------------------------------------------
126 } // namespace recob
short int LocalIndex() const
How well do we believe we know this hit?
Definition: Hit.h:227
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
Definition: Hit.h:231
Who knows?
Definition: geo_types.h:147
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
geo::WireID WireID() const
Definition: Hit.h:233
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
Declaration of signal hit object.
walls no right
Definition: selectors.fcl:105
float SigmaPeakAmplitude() const
Uncertainty on estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:222
float SigmaIntegral() const
Definition: Hit.h:225
int DegreesOfFreedom() const
Definition: Hit.h:229
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:224
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:232
Hit()
Default constructor: a hit with no signal.
Definition: Hit.cxx:19
process_name hit
Definition: cheaterreco.fcl:51
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
Definition: Hit.h:228
short int Multiplicity() const
How many hits could this one be shared with.
Definition: Hit.h:226
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:221
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:25
process_name gaushit a
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
enum geo::_plane_sigtype SigType_t
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
Definition: Hit.h:216
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
Definition: Hit.h:217
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:223
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
Definition: Hit.h:219
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
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:230
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173