LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
recob::WireCreator Class Reference

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

#include "WireCreator.h"

Public Types

using RegionsOfInterest_t = Wire::RegionsOfInterest_t
 Alias for the type of regions of interest. More...
 

Public Member Functions

 WireCreator (const RegionsOfInterest_t &sigROIlist, const raw::RawDigit &rawdigit)
 Constructor: uses specified signal in regions of interest. More...
 
 WireCreator (RegionsOfInterest_t &&sigROIlist, const raw::RawDigit &rawdigit)
 Constructor: uses specified signal in regions of interest. More...
 
 WireCreator (RegionsOfInterest_t const &sigROIlist, raw::ChannelID_t channel, geo::View_t view)
 Constructor: uses specified signal in regions of interest. More...
 
 WireCreator (RegionsOfInterest_t &&sigROIlist, raw::ChannelID_t channel, geo::View_t view)
 Constructor: uses specified signal in regions of interest. More...
 
Wire && move ()
 Prepares the constructed wire to be moved away. More...
 
const Wirecopy () const
 Returns the constructed wire. More...
 

Protected Attributes

Wire wire
 local instance of the wire being constructed More...
 

Detailed Description

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

In order to be as simple as possible (Plain Old Data), data products like recob::Wire 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 Wire object:

// let RoIsignal be a recob::Wire::RegionsOfInterest_t already filled
// with the signal regions, and rawdigit the raw::RawDigit of the
// channel; RoIsignal will become empty
recob::WireCreator wire(std::move(RoIsignal), rawdigit);
wires.push_back(wire.move()); // wire content is not valid any more

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

Definition at line 55 of file WireCreator.h.

Member Typedef Documentation

Alias for the type of regions of interest.

Definition at line 58 of file WireCreator.h.

Constructor & Destructor Documentation

recob::WireCreator::WireCreator ( const RegionsOfInterest_t sigROIlist,
const raw::RawDigit rawdigit 
)

Constructor: uses specified signal in regions of interest.

Parameters
sigROIlistsignal organized in regions of interest
rawdigitthe raw digit this channel is associated to

The information used from the raw digit are the channel ID and the length in samples (TDC ticks) of the original readout window.

Definition at line 28 of file WireCreator.cxx.

References recob::Wire::fSignalROI, lar::sparse_vector< T >::resize(), raw::RawDigit::Samples(), and wire.

29  : wire(sigROIlist,
30  rawdigit.Channel(),
32  {
33  // resize fSignalROI again:
34  // just in case the user hasn't cared to set sigROIlist size right
35  wire.fSignalROI.resize(rawdigit.Samples());
36  } // Wire::Wire(RegionsOfInterest_t&)
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:217
void resize(size_type new_size)
Resizes the vector to the specified size, adding void.
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:213
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:141
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:127
recob::WireCreator::WireCreator ( RegionsOfInterest_t &&  sigROIlist,
const raw::RawDigit rawdigit 
)

Constructor: uses specified signal in regions of interest.

Parameters
sigROIlistsignal organized in regions of interest
rawdigitthe raw digit this channel is associated to

The information used from the raw digit are the channel ID and the length in samples (TDC ticks) of the original readout window.

Signal information is moved from sigROIlist, that becomes empty.

Definition at line 39 of file WireCreator.cxx.

References recob::Wire::fSignalROI, lar::sparse_vector< T >::resize(), raw::RawDigit::Samples(), and wire.

40  : wire(std::move(sigROIlist),
41  rawdigit.Channel(),
43  {
44  // resize fSignalROI again:
45  // just in case the user hasn't cared to set sigROIlist size right
46  wire.fSignalROI.resize(rawdigit.Samples());
47  } // Wire::Wire(RegionsOfInterest_t&)
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:217
void resize(size_type new_size)
Resizes the vector to the specified size, adding void.
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:213
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:141
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:127
recob::WireCreator::WireCreator ( RegionsOfInterest_t const &  sigROIlist,
raw::ChannelID_t  channel,
geo::View_t  view 
)

Constructor: uses specified signal in regions of interest.

Parameters
sigROIlistsignal organized in regions of interest
channelthe ID of the channel
viewthe view the channel belongs to

The information used from the raw digit are the channel ID and the length in samples (TDC ticks) of the original readout window.

Definition at line 50 of file WireCreator.cxx.

53  : wire(sigROIlist, channel, view)
54  {}
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:141
recob::WireCreator::WireCreator ( RegionsOfInterest_t &&  sigROIlist,
raw::ChannelID_t  channel,
geo::View_t  view 
)

Constructor: uses specified signal in regions of interest.

Parameters
sigROIlistsignal organized in regions of interest
channelthe ID of the channel
viewthe view the channel belongs to

The information used from the raw digit are the channel ID and the length in samples (TDC ticks) of the original readout window.

Signal information is moved from sigROIlist, that becomes empty.

Definition at line 57 of file WireCreator.cxx.

60  : wire(std::move(sigROIlist), channel, view)
61  {}
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:141

Member Function Documentation

const Wire& recob::WireCreator::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 wire a WireCreator instance:
std::vector<recob::Wire> Wires;
wire.copy();                          // nothing happens
Wires.push_back(wire.copy());         // here a copy happens
recob::Wire single_wire(wire.copy()); // wire is copied again

Definition at line 138 of file WireCreator.h.

138 { return wire; }
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:141
Wire&& recob::WireCreator::move ( )
inline

Prepares the constructed wire to be moved away.

Returns
a right-value reference to the constructed wire

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

// be wire a WireCreator instance:
std::vector<recob::Wire> Wires;
wire.move();                          // nothing happens
Wires.push_back(wire.move());         // here the copy happens
recob::Wire single_wire(wire.move()); // wrong! wire is empty now

Definition at line 122 of file WireCreator.h.

122 { return std::move(wire); }
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:141

Member Data Documentation

Wire recob::WireCreator::wire
protected

local instance of the wire being constructed

Definition at line 141 of file WireCreator.h.

Referenced by WireCreator().


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