LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 87 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 90 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 49 of file HitCreator.cxx.

65  : hit(digits.Channel(),
66  start_tick,
67  end_tick,
68  peak_time,
69  sigma_peak_time,
70  rms,
71  peak_amplitude,
72  sigma_peak_amplitude,
73  summedADC,
74  hit_integral,
75  hit_sigma_integral,
76  multiplicity,
77  local_index,
78  goodness_of_fit,
79  dof,
80  art::ServiceHandle<geo::Geometry const>()->View(digits.Channel()),
82  wireID)
83  {} // HitCreator::HitCreator(RawDigit)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:350
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
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 86 of file HitCreator.cxx.

102  : hit(wire.Channel(),
103  start_tick,
104  end_tick,
105  peak_time,
106  sigma_peak_time,
107  rms,
108  peak_amplitude,
109  sigma_peak_amplitude,
110  summedADC,
111  hit_integral,
112  hit_sigma_integral,
113  multiplicity,
114  local_index,
115  goodness_of_fit,
116  dof,
117  wire.View(),
118  art::ServiceHandle<geo::Geometry const>()->SignalType(wire.Channel()),
119  wireID)
120  {} // HitCreator::HitCreator(Wire)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:350
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 123 of file HitCreator.cxx.

138  : HitCreator(wire,
139  wireID,
140  start_tick,
141  end_tick,
142  rms,
143  peak_time,
144  sigma_peak_time,
145  peak_amplitude,
146  sigma_peak_amplitude,
147  hit_integral,
148  hit_sigma_integral,
149  std::accumulate(wire.SignalROI().begin() + start_tick,
150  wire.SignalROI().begin() + end_tick,
151  0.), // sum of ADC counts between start_tick and end_tick
152  multiplicity,
153  local_index,
154  goodness_of_fit,
155  dof)
156  {} // 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:49
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 159 of file HitCreator.cxx.

174  : HitCreator(wire,
175  wireID,
176  signal.begin_index(),
177  signal.end_index(),
178  rms,
179  peak_time,
180  sigma_peak_time,
181  peak_amplitude,
182  sigma_peak_amplitude,
183  hit_integral,
184  hit_sigma_integral,
185  summedADC,
186  multiplicity,
187  local_index,
188  goodness_of_fit,
189  dof)
190  {} // 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:49
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 193 of file HitCreator.cxx.

208  : HitCreator(wire,
209  wireID,
210  rms,
211  peak_time,
212  sigma_peak_time,
213  peak_amplitude,
214  sigma_peak_amplitude,
215  hit_integral,
216  hit_sigma_integral,
217  summedADC,
218  multiplicity,
219  local_index,
220  goodness_of_fit,
221  dof,
222  wire.SignalROI().range(iSignalRoI))
223  {} // 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:49
recob::HitCreator::HitCreator ( recob::Hit const &  from)

Constructor: copies from an existing hit.

Parameters
fromthe original hit

Definition at line 225 of file HitCreator.cxx.

225 : hit(from) {}
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:350
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 227 of file HitCreator.cxx.

227  : hit(from)
228  {
229  hit.fWireID = wireID;
230  } // HitCreator::HitCreator(new wire ID)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:350
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 347 of file HitCreator.h.

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

347 { return hit; }
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:350
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 330 of file HitCreator.h.

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

330 { 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 350 of file HitCreator.h.


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