LArSoft  v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 ROIsummedADC, float HitsummedADC, 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 ROIsummedADC, float HitsummedADC, 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 ROIsummedADC, float HitsummedADC, 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 ROIsummedADC, float HitsummedADC, 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  ROIsummedADC,
float  HitsummedADC,
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
ROIsummedADCtotal ADC count in the region assigned to the hit ROI
HitsummedADCtotal ADC count in the region assigned to the hit 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.

66  : hit(digits.Channel(),
67  start_tick,
68  end_tick,
69  peak_time,
70  sigma_peak_time,
71  rms,
72  peak_amplitude,
73  sigma_peak_amplitude,
74  ROIsummedADC,
75  HitsummedADC,
76  hit_integral,
77  hit_sigma_integral,
78  multiplicity,
79  local_index,
80  goodness_of_fit,
81  dof,
82  art::ServiceHandle<geo::Geometry const>()->View(digits.Channel()),
84  wireID)
85  {} // HitCreator::HitCreator(RawDigit)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:358
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  ROIsummedADC,
float  HitsummedADC,
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
ROIsummedADCtotal ADC count in the region assigned to the hit ROI
HitsummedADCtotal ADC count in the region assigned to the hit 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 88 of file HitCreator.cxx.

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

142  : HitCreator(
143  wire,
144  wireID,
145  start_tick,
146  end_tick,
147  rms,
148  peak_time,
149  sigma_peak_time,
150  peak_amplitude,
151  sigma_peak_amplitude,
152  hit_integral,
153  hit_sigma_integral,
154  std::accumulate(wire.SignalROI().begin() + start_tick,
155  wire.SignalROI().begin() + end_tick,
156  0.), // sum of ADC counts between start_tick and end_tic
157  std::accumulate(
158  wire.SignalROI().begin() + start_tick,
159  wire.SignalROI().begin() + end_tick,
160  0.), // sum of ADC counts between start_tick and end_tick TO BE MODIFIED IF HIT HAS TO BE CONSIDERED
161  multiplicity,
162  local_index,
163  goodness_of_fit,
164  dof)
165  {} // 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 ROIsummedADC, float HitsummedADC, 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  ROIsummedADC,
float  HitsummedADC,
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
ROIsummedADCtotal ADC count in the region assigned to the hit ROI
HitsummedADCtotal ADC count in the region assigned to the hit 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  : HitCreator(wire,
185  wireID,
186  signal.begin_index(),
187  signal.end_index(),
188  rms,
189  peak_time,
190  sigma_peak_time,
191  peak_amplitude,
192  sigma_peak_amplitude,
193  hit_integral,
194  hit_sigma_integral,
195  ROIsummedADC,
196  HitsummedADC,
197  multiplicity,
198  local_index,
199  goodness_of_fit,
200  dof)
201  {} // 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 ROIsummedADC, float HitsummedADC, 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  ROIsummedADC,
float  HitsummedADC,
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
ROIsummedADC total ADC count in the region assigned to the hit ROI
HitsummedADC total ADC count in the region assigned to the hit 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 204 of file HitCreator.cxx.

220  : HitCreator(wire,
221  wireID,
222  rms,
223  peak_time,
224  sigma_peak_time,
225  peak_amplitude,
226  sigma_peak_amplitude,
227  hit_integral,
228  hit_sigma_integral,
229  ROIsummedADC,
230  HitsummedADC,
231  multiplicity,
232  local_index,
233  goodness_of_fit,
234  dof,
235  wire.SignalROI().range(iSignalRoI))
236  {} // 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 ROIsummedADC, float HitsummedADC, 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 238 of file HitCreator.cxx.

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

240  : hit(from)
241  {
242  hit.fWireID = wireID;
243  } // HitCreator::HitCreator(new wire ID)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:358
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 355 of file HitCreator.h.

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

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

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

338 { 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 358 of file HitCreator.h.


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