LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 53 of file WireCreator.h.

Member Typedef Documentation

Alias for the type of regions of interest.

Definition at line 56 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 30 of file WireCreator.cxx.

References raw::RawDigit::Samples().

30  :
31  wire(
32  sigROIlist,
33  rawdigit.Channel(),
34  art::ServiceHandle<geo::Geometry>()->View(rawdigit.Channel())
35  )
36  {
37  // resize fSignalROI again:
38  // just in case the user hasn't cared to set sigROIlist size right
39  wire.fSignalROI.resize(rawdigit.Samples());
40  } // Wire::Wire(RegionsOfInterest_t&)
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:211
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:154
unsigned short Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:212
RegionsOfInterest_t fSignalROI
Signal on the channel.
Definition: Wire.h:91
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 44 of file WireCreator.cxx.

References raw::RawDigit::Samples().

44  :
45  wire(
46  std::move(sigROIlist),
47  rawdigit.Channel(),
48  art::ServiceHandle<geo::Geometry>()->View(rawdigit.Channel())
49  )
50  {
51  // resize fSignalROI again:
52  // just in case the user hasn't cared to set sigROIlist size right
53  wire.fSignalROI.resize(rawdigit.Samples());
54  } // Wire::Wire(RegionsOfInterest_t&)
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:211
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:154
unsigned short Samples() const
Number of samples in the uncompressed ADC data.
Definition: RawDigit.h:212
RegionsOfInterest_t fSignalROI
Signal on the channel.
Definition: Wire.h:91
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 57 of file WireCreator.cxx.

61  :
62  wire(sigROIlist, channel, view)
63  {}
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:154
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 66 of file WireCreator.cxx.

70  :
71  wire(std::move(sigROIlist), channel, view)
72  {}
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:154

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 150 of file WireCreator.h.

References wire.

150 { return wire; }
Wire wire
local instance of the wire being constructed
Definition: WireCreator.h:154
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 133 of file WireCreator.h.

References wire.

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

Member Data Documentation

Wire recob::WireCreator::wire
protected

local instance of the wire being constructed

Definition at line 154 of file WireCreator.h.

Referenced by copy(), and move().


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