Public Types | Public Member Functions | Protected Attributes | List of all members
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 83 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 86 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 50 of file HitCreator.cxx.

67  :
68  hit(
69  digits.Channel(),
70  start_tick,
71  end_tick,
72  peak_time,
73  sigma_peak_time,
74  rms,
75  peak_amplitude,
76  sigma_peak_amplitude,
77  summedADC,
78  hit_integral,
79  hit_sigma_integral,
80  multiplicity,
81  local_index,
82  goodness_of_fit,
83  dof,
84  art::ServiceHandle<geo::Geometry const>()->View(digits.Channel()),
86  wireID
87  )
88  {} // HitCreator::HitCreator(RawDigit)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
AdcChannelData::View View
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:365
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 92 of file HitCreator.cxx.

109  :
110  hit(
111  wire.Channel(),
112  start_tick,
113  end_tick,
114  peak_time,
115  sigma_peak_time,
116  rms,
117  peak_amplitude,
118  sigma_peak_amplitude,
119  summedADC,
120  hit_integral,
121  hit_sigma_integral,
122  multiplicity,
123  local_index,
124  goodness_of_fit,
125  dof,
126  wire.View(),
127  art::ServiceHandle<geo::Geometry const>()->SignalType(wire.Channel()),
128  wireID
129  )
130  {} // HitCreator::HitCreator(Wire)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:365
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 134 of file HitCreator.cxx.

150  :
151  HitCreator(
152  wire, wireID, start_tick, end_tick,
153  rms, peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
154  hit_integral, hit_sigma_integral,
155  std::accumulate(
156  wire.SignalROI().begin() + start_tick,
157  wire.SignalROI().begin() + end_tick,
158  0.
159  ), // sum of ADC counts between start_tick and end_tick
160  multiplicity, local_index,
161  goodness_of_fit, dof
162  )
163  {} // HitCreator::HitCreator(Wire; no summed ADC)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
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:50
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 167 of file HitCreator.cxx.

183  :
184  HitCreator(
185  wire, wireID, signal.begin_index(), signal.end_index(),
186  rms, peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
187  hit_integral, hit_sigma_integral, summedADC, multiplicity, local_index,
188  goodness_of_fit, dof
189  )
190  {} // HitCreator::HitCreator(Wire; RoI)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
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:50
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 194 of file HitCreator.cxx.

210  :
211  HitCreator(
212  wire, wireID, rms, peak_time, sigma_peak_time, peak_amplitude, sigma_peak_amplitude,
213  hit_integral, hit_sigma_integral, summedADC, multiplicity, local_index,
214  goodness_of_fit, dof, wire.SignalROI().range(iSignalRoI)
215  )
216  {} // HitCreator::HitCreator(Wire; RoI index)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:40
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:50
recob::HitCreator::HitCreator ( recob::Hit const &  from)

Constructor: copies from an existing hit.

Parameters
fromthe original hit

Definition at line 219 of file HitCreator.cxx.

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

222  :
223  hit(from)
224  {
225  hit.fWireID = wireID;
226  } // HitCreator::HitCreator(new wire ID)
recob::Hit hit
Local instance of the hit being constructed.
Definition: HitCreator.h:365
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 361 of file HitCreator.h.

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

343 { return std::move(hit); }
def move(depos, offset)
Definition: depos.py:107
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 365 of file HitCreator.h.


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