LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
recob::HitCreator Class Reference

Class managing the creation of a new recob::Hit object. More...

#include "HitCreator.h"

Public Types

using RegionOfInterest_t = recob::Wire::RegionsOfInterest_t::datarange_t
 Type of one region of interest. More...
 

Public Member Functions

 HitCreator (raw::RawDigit const &digits, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
 Constructor: extracts some information from raw digit. More...
 
 HitCreator (recob::Wire const &wire, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
 Constructor: extracts some information from wire. More...
 
 HitCreator (recob::Wire const &wire, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
 Constructor: computes sum of ADC from wire. More...
 
 HitCreator (recob::Wire const &wire, geo::WireID const &wireID, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof, RegionOfInterest_t const &signal)
 Constructor: uses region of interest specified by index. More...
 
 HitCreator (recob::Wire const &wire, geo::WireID const &wireID, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof, size_t iSignalRoI)
 Constructor: uses region of interest specified by index. More...
 
 HitCreator (recob::Hit const &from)
 Constructor: copies from an existing hit. More...
 
 HitCreator (recob::Hit const &from, geo::WireID const &wireID)
 Constructor: copies from an existing hit, changing wire ID. More...
 
recob::Hit && move ()
 Prepares the constructed hit to be moved away. More...
 
recob::Hit const & copy () const
 Returns the constructed wire. More...
 

Protected Attributes

recob::Hit hit
 Local instance of the hit being constructed. More...
 

Detailed Description

Class managing the creation of a new recob::Hit object.


In order to be as simple as possible (Plain Old Data), data products like recob::Hit need to be stripped of most of their functions, including the ability to communicate whether a value we try to store is invalid (that would require a art::Exception` – art – or at least a message on the screen – MessageFacility) and the ability to read things from event, services (e.g. geometry) etc.

A Creator is a class that creates a temporary data product, and at the end it yields it to the caller for storage. This last step should be by move construction, although a copy method is also provided.

An example of creating a recob::Hit object (assuming all the relevant variables have been assigned proper values):

wire, wireID,
start_tick, end_tick, rms,
peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
hit_integral, hit_sigma_integral, summedADC,
multiplicity, local_index, goodness_of_fit, dof
);
hit.push_back(hit.move()); // hit content is not valid any more

This is a one-step creation object: the hit is constructed at the same time the HitCreator is, and no facility is offered to modify the constructed hit, or to create another one.

The constructors currently provided are:

  1. from RawDigit (extracts channel, view and signal type [CVS] thanks to geometry)
  2. from recob::Wire, [CVS]
  3. from recob::Wire, [CVS], summedADC is automatically computed from wire
  4. from recob::Wire, [CVS], start and stop time from a region of interest
  5. from recob::Wire, [CVS], start and stop time from index of region of interest

Definition at line 84 of file HitCreator.h.

Member Typedef Documentation

using recob::HitCreator::RegionOfInterest_t = recob::Wire::RegionsOfInterest_t::datarange_t

Type of one region of interest.

Definition at line 87 of file HitCreator.h.

Constructor & Destructor Documentation

recob::HitCreator::HitCreator ( raw::RawDigit const &  digits,
geo::WireID const &  wireID,
raw::TDCtick_t  start_tick,
raw::TDCtick_t  end_tick,
float  rms,
float  peak_time,
float  sigma_peak_time,
float  peak_amplitude,
float  sigma_peak_amplitude,
float  hit_integral,
float  hit_sigma_integral,
float  summedADC,
short int  multiplicity,
short int  local_index,
float  goodness_of_fit,
int  dof 
)

Constructor: extracts some information from raw digit.

Parameters
digitsa pointer to a raw::RawDigit (for channel, view, signal type)
wireIDID of the wire the hit is on
start_tickfirst tick in the region the hit was extracted from
end_tickfirst tick after the region the hit was extracted from
rmsRMS of the signal hit, in TDC time units
peak_timetime at peak of the signal, in TDC time units
sigma_peak_timeuncertainty on time at peak, in TDC time units
peak_amplitudeamplitude of the signal at peak, in ADC units
sigma_peak_amplitudeuncertainty on amplitude at peak
hit_integraltotal charge integrated under the hit signal
hit_sigma_integraluncertainty on the total hit charge
summedADCtotal ADC count in the region assigned to the hit
multiplicitynumber of hits in the region it was extracted from
local_indexindex of this hit in the region it was extracted from
goodness_of_fitquality parameter for the hit
dofdegrees of freedom in the definition of the hit shape

The information used from the raw digit is the channel ID; view and signal type are obtained from geometry.

Definition at line 51 of file HitCreator.cxx.

68  :
69  hit(
70  digits.Channel(),
71  start_tick,
72  end_tick,
73  peak_time,
74  sigma_peak_time,
75  rms,
76  peak_amplitude,
77  sigma_peak_amplitude,
78  summedADC,
79  hit_integral,
80  hit_sigma_integral,
81  multiplicity,
82  local_index,
83  goodness_of_fit,
84  dof,
85  art::ServiceHandle<geo::Geometry>()->View(digits.Channel()),
86  art::ServiceHandle<geo::Geometry>()->SignalType(digits.Channel()),
87  wireID
88  )
89  {} // HitCreator::HitCreator(RawDigit)
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:366
recob::HitCreator::HitCreator ( recob::Wire const &  wire,
geo::WireID const &  wireID,
raw::TDCtick_t  start_tick,
raw::TDCtick_t  end_tick,
float  rms,
float  peak_time,
float  sigma_peak_time,
float  peak_amplitude,
float  sigma_peak_amplitude,
float  hit_integral,
float  hit_sigma_integral,
float  summedADC,
short int  multiplicity,
short int  local_index,
float  goodness_of_fit,
int  dof 
)

Constructor: extracts some information from wire.

Parameters
wirea pointer to a recob::Wire (for channel, view, signal type)
wireIDID of the wire the hit is on
start_tickfirst tick in the region the hit was extracted from
end_tickfirst tick after the region the hit was extracted from
rmsRMS of the signal hit, in TDC time units
peak_timetime at peak of the signal, in TDC time units
sigma_peak_timeuncertainty on time at peak, in TDC time units
peak_amplitudeamplitude of the signal at peak, in ADC units
sigma_peak_amplitudeuncertainty on amplitude at peak
hit_integraltotal charge integrated under the hit signal
hit_sigma_integraluncertainty on the total hit charge
summedADCtotal ADC count in the region assigned to the hit
multiplicitynumber of hits in the region it was extracted from
local_indexindex of this hit in the region it was extracted from
goodness_of_fitquality parameter for the hit
dofdegrees of freedom in the definition of the hit shape

The information used from the wire are the channel ID and view; the signal type is obtained from geometry.

Definition at line 93 of file HitCreator.cxx.

110  :
111  hit(
112  wire.Channel(),
113  start_tick,
114  end_tick,
115  peak_time,
116  sigma_peak_time,
117  rms,
118  peak_amplitude,
119  sigma_peak_amplitude,
120  summedADC,
121  hit_integral,
122  hit_sigma_integral,
123  multiplicity,
124  local_index,
125  goodness_of_fit,
126  dof,
127  wire.View(),
128  art::ServiceHandle<geo::Geometry>()->SignalType(wire.Channel()),
129  wireID
130  )
131  {} // HitCreator::HitCreator(Wire)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:366
recob::HitCreator::HitCreator ( recob::Wire const &  wire,
geo::WireID const &  wireID,
raw::TDCtick_t  start_tick,
raw::TDCtick_t  end_tick,
float  rms,
float  peak_time,
float  sigma_peak_time,
float  peak_amplitude,
float  sigma_peak_amplitude,
float  hit_integral,
float  hit_sigma_integral,
short int  multiplicity,
short int  local_index,
float  goodness_of_fit,
int  dof 
)

Constructor: computes sum of ADC from wire.

Parameters
wirea pointer to a recob::Wire (for channel, view, signal type)
wireIDID of the wire the hit is on
start_tickfirst tick in the region the hit was extracted from
end_tickfirst tick after the region the hit was extracted from
rmsRMS of the signal hit, in TDC time units
peak_timetime at peak of the signal, in TDC time units
sigma_peak_timeuncertainty on time at peak, in TDC time units
peak_amplitudeamplitude of the signal at peak, in ADC units
sigma_peak_amplitudeuncertainty on amplitude at peak
hit_integraltotal charge integrated under the hit signal
hit_sigma_integraluncertainty on the total hit charge
multiplicitynumber of hits in the region it was extracted from
local_indexindex of this hit in the region it was extracted from
goodness_of_fitquality parameter for the hit
dofdegrees of freedom in the definition of the hit shape

The information used from the wire are the channel ID, view; the signal type is obtained from geometry.

The sum of ADC counts is automatically computed over the whole range of the wire signal between start_tick and end_tick (the latter excluded).

Definition at line 135 of file HitCreator.cxx.

151  :
152  HitCreator(
153  wire, wireID, start_tick, end_tick,
154  rms, peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
155  hit_integral, hit_sigma_integral,
156  std::accumulate(
157  wire.SignalROI().begin() + start_tick,
158  wire.SignalROI().begin() + end_tick,
159  0.
160  ), // sum of ADC counts between start_tick and end_tick
161  multiplicity, local_index,
162  goodness_of_fit, dof
163  )
164  {} // HitCreator::HitCreator(Wire; no summed ADC)
HitCreator(raw::RawDigit const &digits, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
Constructor: extracts some information from raw digit.
Definition: HitCreator.cxx:51
recob::HitCreator::HitCreator ( recob::Wire const &  wire,
geo::WireID const &  wireID,
float  rms,
float  peak_time,
float  sigma_peak_time,
float  peak_amplitude,
float  sigma_peak_amplitude,
float  hit_integral,
float  hit_sigma_integral,
float  summedADC,
short int  multiplicity,
short int  local_index,
float  goodness_of_fit,
int  dof,
RegionOfInterest_t const &  signal 
)

Constructor: uses region of interest specified by index.

Parameters
wirea pointer to a recob::Wire (for channel, view, signal type)
wireIDID of the wire the hit is on
rmsRMS of the signal hit, in TDC time units
peak_timetime at peak of the signal, in TDC time units
sigma_peak_timeuncertainty on time at peak, in TDC time units
peak_amplitudeamplitude of the signal at peak, in ADC units
sigma_peak_amplitudeuncertainty on amplitude at peak
hit_integraltotal charge integrated under the hit signal
hit_sigma_integraluncertainty on the total hit charge
summedADCtotal ADC count in the region assigned to the hit
multiplicitynumber of hits in the region it was extracted from
local_indexindex of this hit in the region it was extracted from
goodness_of_fitquality parameter for the hit
dofdegrees of freedom in the definition of the hit shape
signalthe signal region the hit was extracted from

The information used from the wire are the channel ID, view and the region of interest; the signal type is obtained from geometry.

Signal start and end ticks are extracted from the region of interest.

Definition at line 168 of file HitCreator.cxx.

184  :
185  HitCreator(
186  wire, wireID, signal.begin_index(), signal.end_index(),
187  rms, peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
188  hit_integral, hit_sigma_integral, summedADC, multiplicity, local_index,
189  goodness_of_fit, dof
190  )
191  {} // HitCreator::HitCreator(Wire; RoI)
HitCreator(raw::RawDigit const &digits, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
Constructor: extracts some information from raw digit.
Definition: HitCreator.cxx:51
recob::HitCreator::HitCreator ( recob::Wire const &  wire,
geo::WireID const &  wireID,
float  rms,
float  peak_time,
float  sigma_peak_time,
float  peak_amplitude,
float  sigma_peak_amplitude,
float  hit_integral,
float  hit_sigma_integral,
float  summedADC,
short int  multiplicity,
short int  local_index,
float  goodness_of_fit,
int  dof,
size_t  iSignalRoI 
)

Constructor: uses region of interest specified by index.

Parameters
wirea pointer to a recob::Wire (for channel, view, signal type)
wireIDID of the wire the hit is on
rmsRMS of the signal hit, in TDC time units
peak_timetime at peak of the signal, in TDC time units
sigma_peak_timeuncertainty on time at peak, in TDC time units
peak_amplitudeamplitude of the signal at peak, in ADC units
sigma_peak_amplitudeuncertainty on amplitude at peak
hit_integraltotal charge integrated under the hit signal
hit_sigma_integraluncertainty on the total hit charge
summedADCtotal ADC count in the region assigned to the hit
multiplicitynumber of hits in the region it was extracted from
local_indexindex of this hit in the region it was extracted from
goodness_of_fitquality parameter for the hit
dofdegrees of freedom in the definition of the hit shape
iSignalRoIindex in the wire of the signal region the hit was extracted from

The information used from the wire are the channel ID, view and the region of interest; the signal type is obtained from geometry.

Signal start and end ticks are extracted from the region of interest.

Definition at line 195 of file HitCreator.cxx.

211  :
212  HitCreator(
213  wire, wireID, rms, peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
214  hit_integral, hit_sigma_integral, summedADC, multiplicity, local_index,
215  goodness_of_fit, dof, wire.SignalROI().range(iSignalRoI)
216  )
217  {} // HitCreator::HitCreator(Wire; RoI index)
HitCreator(raw::RawDigit const &digits, geo::WireID const &wireID, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float rms, float peak_time, float sigma_peak_time, float peak_amplitude, float sigma_peak_amplitude, float hit_integral, float hit_sigma_integral, float summedADC, short int multiplicity, short int local_index, float goodness_of_fit, int dof)
Constructor: extracts some information from raw digit.
Definition: HitCreator.cxx:51
recob::HitCreator::HitCreator ( recob::Hit const &  from)

Constructor: copies from an existing hit.

Parameters
fromthe original hit

Definition at line 220 of file HitCreator.cxx.

220 : hit(from) {}
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:366
recob::HitCreator::HitCreator ( recob::Hit const &  from,
geo::WireID const &  wireID 
)

Constructor: copies from an existing hit, changing wire ID.

Parameters
fromthe original hit
wireIDID of the new wire the hit is on

Definition at line 223 of file HitCreator.cxx.

223  :
224  hit(from)
225  {
226  hit.fWireID = wireID;
227  } // HitCreator::HitCreator(new wire ID)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:366
Detector simulation of raw signals on wires.

Member Function Documentation

recob::Hit const& recob::HitCreator::copy ( ) const
inline

Returns the constructed wire.

Returns
a constant reference to the constructed wire

Despite the name, no copy happens in this function. Copy takes place in the caller code as proper; for example:

// be Hit a HitCreator instance:
std::vector<recob::Hit> Hits;
hit.copy(); // nothing happens
Hits.push_back(hit.copy()); // here a copy happens
recob::Hit single_hit(hit.copy()); // hit is copied again

Definition at line 362 of file HitCreator.h.

Referenced by recob::HitCollectionCreator::emplace_back(), and hit::GausHitFinder::produce().

362 { return hit; }
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:366
recob::Hit&& recob::HitCreator::move ( )
inline

Prepares the constructed hit to be moved away.

Returns
a right-value reference to the constructed hit

Despite the name, no move happens in this function. Move takes place in the caller code as proper; for example:

// be hit a HitCreator instance:
std::vector<recob::Hit> Hits;
hit.move(); // nothing happens
Hits.push_back(hit.move()); // here the copy happens
recob::Hit single_hit(hit.move()); // wrong! hit is empty now

Definition at line 344 of file HitCreator.h.

Referenced by hit::DisambigCheater::MakeDisambigHit(), hit::TTHitFinder::produce(), apa::APAHitFinder::produce(), hit::GausHitFinder::produce(), and hit::DPRawHitFinder::produce().

344 { return std::move(hit); }
Detector simulation of raw signals on wires.

Member Data Documentation

recob::Hit recob::HitCreator::hit
protected

Local instance of the hit being constructed.

Definition at line 366 of file HitCreator.h.


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