Public Member Functions | Private Attributes | Friends | List of all members
recob::Hit Class Reference

2D representation of charge deposited in the TDC/wire plane More...

#include <Hit.h>

Public Member Functions

 Hit ()
 Default constructor: a hit with no signal. More...
 
 Hit (raw::ChannelID_t channel, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float peak_time, float sigma_peak_time, float rms, float peak_amplitude, float sigma_peak_amplitude, float summedADC, float hit_integral, float hit_sigma_integral, short int multiplicity, short int local_index, float goodness_of_fit, int dof, geo::View_t view, geo::SigType_t signal_type, geo::WireID wireID)
 Constructor: directly sets all the fields. More...
 
float TimeDistanceAsRMS (float time) const
 Returns the distance of the specified time from peak, in RMS units. More...
 
Accessors
raw::TDCtick_t StartTick () const
 Initial tdc tick for hit. More...
 
raw::TDCtick_t EndTick () const
 Final tdc tick for hit. More...
 
float PeakTime () const
 Time of the signal peak, in tick units. More...
 
float SigmaPeakTime () const
 Uncertainty for the signal peak, in tick units. More...
 
float RMS () const
 RMS of the hit shape, in tick units. More...
 
float PeakAmplitude () const
 The estimated amplitude of the hit at its peak, in ADC units. More...
 
float SigmaPeakAmplitude () const
 Uncertainty on estimated amplitude of the hit at its peak, in ADC units. More...
 
float SummedADC () const
 The sum of calibrated ADC counts of the hit (0. by default) More...
 
float Integral () const
 Integral under the calibrated signal waveform of the hit, in tick x ADC units. More...
 
float SigmaIntegral () const
 
short int Multiplicity () const
 How many hits could this one be shared with. More...
 
short int LocalIndex () const
 How well do we believe we know this hit? More...
 
float GoodnessOfFit () const
 Degrees of freedom in the determination of the hit signal shape (-1 by default) More...
 
int DegreesOfFreedom () const
 
raw::ChannelID_t Channel () const
 ID of the readout channel the hit was extracted from. More...
 
geo::View_t View () const
 View for the plane of the hit. More...
 
geo::SigType_t SignalType () const
 Signal type for the plane of the hit. More...
 
geo::WireID WireID () const
 
float PeakTimePlusRMS (float sigmas=+1.) const
 Returns a time sigmas RMS away from the peak time. More...
 
float PeakTimeMinusRMS (float sigmas=+1.) const
 

Private Attributes

raw::ChannelID_t fChannel
 ID of the readout channel the hit was extracted from. More...
 
raw::TDCtick_t fStartTick
 initial tdc tick for hit More...
 
raw::TDCtick_t fEndTick
 final tdc tick for hit More...
 
float fPeakTime
 time of the signal peak, in tick units More...
 
float fSigmaPeakTime
 uncertainty for the signal peak, in tick units More...
 
float fRMS
 RMS of the hit shape, in tick units. More...
 
float fPeakAmplitude
 the estimated amplitude of the hit at its peak, in ADC units More...
 
float fSigmaPeakAmplitude
 uncertainty on estimated amplitude of the hit at its peak, in ADC units More...
 
float fSummedADC
 the sum of calibrated ADC counts of the hit More...
 
float fIntegral
 the integral under the calibrated signal waveform of the hit, in tick x ADC units More...
 
float fSigmaIntegral
 the uncertainty of integral under the calibrated signal waveform of the hit, in ADC units More...
 
short int fMultiplicity
 how many hits could this one be shared with More...
 
short int fLocalIndex
 index of this hit among the Multiplicity() hits in the signal window More...
 
float fGoodnessOfFit
 how well do we believe we know this hit? More...
 
int fNDF
 degrees of freedom in the determination of the hit shape More...
 
geo::View_t fView
 view for the plane of the hit More...
 
geo::SigType_t fSignalType
 signal type for the plane of the hit More...
 
geo::WireID fWireID
 WireID for the hit (Cryostat, TPC, Plane, Wire) More...
 

Friends

class HitCreator
 
std::ostream & operator<< (std::ostream &o, const Hit &a)
 
bool operator< (const Hit &a, const Hit &b)
 

Detailed Description

2D representation of charge deposited in the TDC/wire plane

Hits are assumed to be made from deconvoluted, unipolar, calibrated signals. They identify a charge deposit in a specific location and time; the location is absolute and unique in the detector, while the time is relative to the start of sampling (tick time).

The version 14 of recob::Hit introduces the following changes:

Definition at line 48 of file Hit.h.

Constructor & Destructor Documentation

recob::Hit::Hit ( )

Default constructor: a hit with no signal.

Definition at line 19 of file Hit.cxx.

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)
37  , fWireID() // invalid
38  {}
float fPeakAmplitude
the estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:61
raw::TDCtick_t fStartTick
initial tdc tick for hit
Definition: Hit.h:56
Who knows?
Definition: geo_types.h:147
float fSummedADC
the sum of calibrated ADC counts of the hit
Definition: Hit.h:63
Unknown view.
Definition: geo_types.h:136
float fSigmaPeakAmplitude
uncertainty on estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:62
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
raw::TDCtick_t fEndTick
final tdc tick for hit
Definition: Hit.h:57
float fSigmaPeakTime
uncertainty for the signal peak, in tick units
Definition: Hit.h:59
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:32
float fPeakTime
time of the signal peak, in tick units
Definition: Hit.h:58
raw::ChannelID_t fChannel
ID of the readout channel the hit was extracted from.
Definition: Hit.h:55
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:60
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
short int fLocalIndex
index of this hit among the Multiplicity() hits in the signal window
Definition: Hit.h:67
float fIntegral
the integral under the calibrated signal waveform of the hit, in tick x ADC units ...
Definition: Hit.h:64
recob::Hit::Hit ( raw::ChannelID_t  channel,
raw::TDCtick_t  start_tick,
raw::TDCtick_t  end_tick,
float  peak_time,
float  sigma_peak_time,
float  rms,
float  peak_amplitude,
float  sigma_peak_amplitude,
float  summedADC,
float  hit_integral,
float  hit_sigma_integral,
short int  multiplicity,
short int  local_index,
float  goodness_of_fit,
int  dof,
geo::View_t  view,
geo::SigType_t  signal_type,
geo::WireID  wireID 
)

Constructor: directly sets all the fields.

Parameters
channelID of the readout channel the hit was extracted from
start_tickinitial tdc tick for hit
end_tickfinal tdc tick for hit
peak_timetdc for the peak charge deposition
sigma_peak_timeuncertainty for tdc of the peak
rmsRMS of the hit shape
peak_amplitudethe estimated amplitude of the hit at its peak
sigma_peak_amplitudethe uncertainty on the estimated amplitude of the hit at its peak
summedADCthe sum of calibrated ADC counts of the hit
hit_integralthe integral under the calibrated signal waveform of the hit
hit_sigma_integraluncertainty on the integral under the calibrated signal waveform of the hit
multiplicityhow many hits could this one be shared with
local_indexindex of this hit among the Multiplicity() hits in the signal window
goodness_of_fithow well do we believe we know this hit?
dofnumber of degrees of freedom in the determination of hit shape
viewview for the plane of the hit
signal_typesignal type for the plane of the hit
wireIDWireID for the hit (Cryostat TPC Plane Wire)

The tick parameters are real numbers, since they can in principle come from some processing.

Definition at line 41 of file Hit.cxx.

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  {}
float fPeakAmplitude
the estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:61
raw::TDCtick_t fStartTick
initial tdc tick for hit
Definition: Hit.h:56
float fSummedADC
the sum of calibrated ADC counts of the hit
Definition: Hit.h:63
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
float fSigmaPeakAmplitude
uncertainty on estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:62
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
uint8_t channel
Definition: CRTFragment.hh:201
raw::TDCtick_t fEndTick
final tdc tick for hit
Definition: Hit.h:57
float fSigmaPeakTime
uncertainty for the signal peak, in tick units
Definition: Hit.h:59
short int fMultiplicity
how many hits could this one be shared with
Definition: Hit.h:66
float fPeakTime
time of the signal peak, in tick units
Definition: Hit.h:58
raw::ChannelID_t fChannel
ID of the readout channel the hit was extracted from.
Definition: Hit.h:55
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:60
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
short int fLocalIndex
index of this hit among the Multiplicity() hits in the signal window
Definition: Hit.h:67
float fIntegral
the integral under the calibrated signal waveform of the hit, in tick x ADC units ...
Definition: Hit.h:64

Member Function Documentation

raw::ChannelID_t recob::Hit::Channel ( ) const
inline

ID of the readout channel the hit was extracted from.

Definition at line 230 of file Hit.h.

230 { return fChannel; }
raw::ChannelID_t fChannel
ID of the readout channel the hit was extracted from.
Definition: Hit.h:55
int recob::Hit::DegreesOfFreedom ( ) const
inline

Definition at line 229 of file Hit.h.

229 { return fNDF; }
int fNDF
degrees of freedom in the determination of the hit shape
Definition: Hit.h:69
raw::TDCtick_t recob::Hit::EndTick ( ) const
inline

Final tdc tick for hit.

Definition at line 217 of file Hit.h.

217 { return fEndTick; }
raw::TDCtick_t fEndTick
final tdc tick for hit
Definition: Hit.h:57
float recob::Hit::GoodnessOfFit ( ) const
inline

Degrees of freedom in the determination of the hit signal shape (-1 by default)

Definition at line 228 of file Hit.h.

228 { return fGoodnessOfFit; }
float fGoodnessOfFit
how well do we believe we know this hit?
Definition: Hit.h:68
float recob::Hit::Integral ( ) const
inline

Integral under the calibrated signal waveform of the hit, in tick x ADC units.

Uncertainty of integral under the calibrated signal waveform of the hit, in ADC units

Definition at line 224 of file Hit.h.

224 { return fIntegral; }
float fIntegral
the integral under the calibrated signal waveform of the hit, in tick x ADC units ...
Definition: Hit.h:64
short int recob::Hit::LocalIndex ( ) const
inline

How well do we believe we know this hit?

Definition at line 227 of file Hit.h.

227 { return fLocalIndex; }
short int fLocalIndex
index of this hit among the Multiplicity() hits in the signal window
Definition: Hit.h:67
short int recob::Hit::Multiplicity ( ) const
inline

How many hits could this one be shared with.

Index of this hit among the Multiplicity() hits in the signal window (-1 by default)

Definition at line 226 of file Hit.h.

226 { return fMultiplicity; }
short int fMultiplicity
how many hits could this one be shared with
Definition: Hit.h:66
float recob::Hit::PeakAmplitude ( ) const
inline

The estimated amplitude of the hit at its peak, in ADC units.

Definition at line 221 of file Hit.h.

221 { return fPeakAmplitude; }
float fPeakAmplitude
the estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:61
float recob::Hit::PeakTime ( ) const
inline

Time of the signal peak, in tick units.

Definition at line 218 of file Hit.h.

218 { return fPeakTime; }
float fPeakTime
time of the signal peak, in tick units
Definition: Hit.h:58
float recob::Hit::PeakTimeMinusRMS ( float  sigmas = +1.) const
inline

Definition at line 239 of file Hit.h.

240  { return PeakTimePlusRMS(-sigmas); }
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Definition: Hit.h:236
float recob::Hit::PeakTimePlusRMS ( float  sigmas = +1.) const
inline

Returns a time sigmas RMS away from the peak time.

Parameters
sigmasthe number of RMS units to move away
Returns
the shifted time in TDC ticks

PeakTimePlusRMS() returns PeakTime() + sigmas x RMS(); PeakTimeMinusRMS() returns PeakTime() - sigmas x RMS().

Note
StartTime() of recob::Hit version <=13 was defined by GausHitFinder to be PeakTimePlusRMS(-1.), and EndTime() was PeakTimePlusRMS(+1.).

Definition at line 236 of file Hit.h.

237  { return PeakTime() + sigmas * RMS(); }
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
float recob::Hit::RMS ( ) const
inline

RMS of the hit shape, in tick units.

Definition at line 220 of file Hit.h.

220 { return fRMS; }
float fRMS
RMS of the hit shape, in tick units.
Definition: Hit.h:60
float recob::Hit::SigmaIntegral ( ) const
inline

Definition at line 225 of file Hit.h.

225 { return fSigmaIntegral; }
float fSigmaIntegral
the uncertainty of integral under the calibrated signal waveform of the hit, in ADC units ...
Definition: Hit.h:65
float recob::Hit::SigmaPeakAmplitude ( ) const
inline

Uncertainty on estimated amplitude of the hit at its peak, in ADC units.

Definition at line 222 of file Hit.h.

222 { return fSigmaPeakAmplitude; }
float fSigmaPeakAmplitude
uncertainty on estimated amplitude of the hit at its peak, in ADC units
Definition: Hit.h:62
float recob::Hit::SigmaPeakTime ( ) const
inline

Uncertainty for the signal peak, in tick units.

Definition at line 219 of file Hit.h.

219 { return fSigmaPeakTime; }
float fSigmaPeakTime
uncertainty for the signal peak, in tick units
Definition: Hit.h:59
geo::SigType_t recob::Hit::SignalType ( ) const
inline

Signal type for the plane of the hit.

ID of the wire the hit is on (Cryostat, TPC, Plane, Wire)

Definition at line 231 of file Hit.h.

231 { return fSignalType; }
geo::SigType_t fSignalType
signal type for the plane of the hit
Definition: Hit.h:71
raw::TDCtick_t recob::Hit::StartTick ( ) const
inline

Initial tdc tick for hit.

Definition at line 216 of file Hit.h.

216 { return fStartTick; }
raw::TDCtick_t fStartTick
initial tdc tick for hit
Definition: Hit.h:56
float recob::Hit::SummedADC ( ) const
inline

The sum of calibrated ADC counts of the hit (0. by default)

Definition at line 223 of file Hit.h.

223 { return fSummedADC; }
float fSummedADC
the sum of calibrated ADC counts of the hit
Definition: Hit.h:63
float recob::Hit::TimeDistanceAsRMS ( float  time) const
inline

Returns the distance of the specified time from peak, in RMS units.

Parameters
timethe time, in TDC tick units
Returns
the distance of the specified time from peak, in RMS units

This returns (ticks - PeakTime()) / RMS(). There is no protection in case RMS is 0!

Definition at line 242 of file Hit.h.

243  { return (time - PeakTime()) / RMS(); }
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
geo::View_t recob::Hit::View ( ) const
inline

View for the plane of the hit.

Definition at line 232 of file Hit.h.

232 { return fView; }
geo::View_t fView
view for the plane of the hit
Definition: Hit.h:70
geo::WireID recob::Hit::WireID ( ) const
inline

Definition at line 233 of file Hit.h.

233 { return fWireID; }
geo::WireID fWireID
WireID for the hit (Cryostat, TPC, Plane, Wire)
Definition: Hit.h:72

Friends And Related Function Documentation

friend class HitCreator
friend

Definition at line 74 of file Hit.h.

bool operator< ( const Hit a,
const Hit b 
)
friend

Definition at line 112 of file Hit.cxx.

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.StartTick() != b.StartTick())
119  return a.StartTick() < b.StartTick();
120 
121  return false; //They are equal
122  } // operator< (Hit, Hit)
const double a
static bool * b
Definition: config.cpp:1043
std::ostream& operator<< ( std::ostream &  o,
const Hit a 
)
friend

Member Data Documentation

raw::ChannelID_t recob::Hit::fChannel
private

ID of the readout channel the hit was extracted from.

Definition at line 55 of file Hit.h.

raw::TDCtick_t recob::Hit::fEndTick
private

final tdc tick for hit

Definition at line 57 of file Hit.h.

float recob::Hit::fGoodnessOfFit
private

how well do we believe we know this hit?

Definition at line 68 of file Hit.h.

float recob::Hit::fIntegral
private

the integral under the calibrated signal waveform of the hit, in tick x ADC units

Definition at line 64 of file Hit.h.

short int recob::Hit::fLocalIndex
private

index of this hit among the Multiplicity() hits in the signal window

Definition at line 67 of file Hit.h.

short int recob::Hit::fMultiplicity
private

how many hits could this one be shared with

Definition at line 66 of file Hit.h.

int recob::Hit::fNDF
private

degrees of freedom in the determination of the hit shape

Definition at line 69 of file Hit.h.

float recob::Hit::fPeakAmplitude
private

the estimated amplitude of the hit at its peak, in ADC units

Definition at line 61 of file Hit.h.

float recob::Hit::fPeakTime
private

time of the signal peak, in tick units

Definition at line 58 of file Hit.h.

float recob::Hit::fRMS
private

RMS of the hit shape, in tick units.

Definition at line 60 of file Hit.h.

float recob::Hit::fSigmaIntegral
private

the uncertainty of integral under the calibrated signal waveform of the hit, in ADC units

Definition at line 65 of file Hit.h.

float recob::Hit::fSigmaPeakAmplitude
private

uncertainty on estimated amplitude of the hit at its peak, in ADC units

Definition at line 62 of file Hit.h.

float recob::Hit::fSigmaPeakTime
private

uncertainty for the signal peak, in tick units

Definition at line 59 of file Hit.h.

geo::SigType_t recob::Hit::fSignalType
private

signal type for the plane of the hit

Definition at line 71 of file Hit.h.

raw::TDCtick_t recob::Hit::fStartTick
private

initial tdc tick for hit

Definition at line 56 of file Hit.h.

float recob::Hit::fSummedADC
private

the sum of calibrated ADC counts of the hit

Definition at line 63 of file Hit.h.

geo::View_t recob::Hit::fView
private

view for the plane of the hit

Definition at line 70 of file Hit.h.

geo::WireID recob::Hit::fWireID
private

WireID for the hit (Cryostat, TPC, Plane, Wire)

Definition at line 72 of file Hit.h.


The documentation for this class was generated from the following files: