Public Types | Public Member Functions | Private Attributes | Friends | List of all members
recob::Wire Class Reference

Class holding the regions of interest of signal from a channel. More...

#include <Wire.h>

Public Types

typedef lar::sparse_vector< float > RegionsOfInterest_t
 a region of interest is a pair (TDC offset, readings) More...
 

Public Member Functions

 Wire ()
 Default constructor: a wire with no signal information. More...
 
 Wire (RegionsOfInterest_t const &sigROIlist, raw::ChannelID_t channel, geo::View_t view)
 Constructor: uses specified signal in regions of interest. More...
 
 Wire (RegionsOfInterest_t &&sigROIlist, raw::ChannelID_t channel, geo::View_t view)
 Constructor: uses specified signal in regions of interest. More...
 
Accessors
std::vector< float > Signal () const
 Return a zero-padded full length vector filled with RoI signal. More...
 
const RegionsOfInterest_tSignalROI () const
 Returns the list of regions of interest. More...
 
std::size_t NSignal () const
 Returns the number of time ticks, or samples, in the channel. More...
 
geo::View_t View () const
 Returns the view the channel belongs to. More...
 
raw::ChannelID_t Channel () const
 Returns the ID of the channel (or InvalidChannelID) More...
 
Sorting and comparison operations
bool operator< (const Wire &than) const
 Returns whether this channel ID is smaller than the other. More...
 

Private Attributes

raw::ChannelID_t fChannel
 ID of the associated channel. More...
 
geo::View_t fView
 View corresponding to the plane of this wire. More...
 
RegionsOfInterest_t fSignalROI
 Signal on the channel as function of time tick. More...
 

Friends

class WireCreator
 

Detailed Description

Class holding the regions of interest of signal from a channel.

Note
Despite the name, this class is associated to a readout channel, not just a wire

The channel content is expected to have been filtered from noise and corrected for electronics response, a process often called in jargon "deconvolution".

The content is presented as calibrated ADC counts, pedestal removed, as function of time in discrete TDC units. The time is expected to be the same as for the raw::RawDigit that originates it, i.e. starting from TPC electronics start time (use detinfo::DetectorClocks to discover the exact extent of each tick).

The content is organized as time intervals where some signal is present ("regions of interest", RoI), outside which we assume no signal. By principle, the definition of the regions of interest is a negative one: we determine time intervals where we are confident no signal is present; the rest will constitute regions of interest where there might be signal. The identification of such regions is responsibility of the algorithm creating the Wire object. In the simplest approach, the whole readout window is stored in a single region of interest, meaning that we don't claim any of the channel signal to be definitely signal free. More generally, the first tick of the waveform is #0, and if the first region of interest starts after that tick, it implies that the region between tick #0 and the start of that first region lacks signal. Likewise, any samples in the end of the covered time window (defined above) which lack signal are indicated by the overall size of the content, while the last region of interest ends earlier.

Algorithms using the regions of interest can access the channel signal information either ignoring the regions of interest, and being potentially flooded by zeroes from the non-signal regions:

for (float ADCcount: wire.Signal()) ...

or they can analyze region by region:

for (auto iROI = wire.begin_range(); iROI != wire.end_range(); ++iROI) {
const datarange_t& ROI = *iROI;
const int FirstTick = ROI.begin_index();
const int EndTick = ROI.end_index();
const float FirstADC = ROI[FirstTick]; // index access is by absolute tick number
for (float ADC: ROI) // ... or you can just iterate through
// ...
} // for

An alternative to the first form is:

for (float ADCcount: wire.SignalROI()) ...

which does not create a temporary dense vector, as Signal() does instead.

Note that the indexed access is always by absolute tick number. More examples of the use of SignalROI() return value are documented in lar::sparse_vector.

Each channel is associated with a raw::RawDigit object. These associations should be stored together with recob::Wire by the producer in a art::Assns data product.

Creating recob::Wire objects

LArSoft "protocol" prescribes:

Two patterns can be followed for creating a recob::Wire:

  1. direct construction: see the constructor documentation
  2. with recob::WireCreator, which extracts some relevant information from the source raw::RawDigit but does not help with their association

In both cases, please read the documentation of recob::Wire constructors.

Definition at line 118 of file Wire.h.

Member Typedef Documentation

a region of interest is a pair (TDC offset, readings)

Definition at line 121 of file Wire.h.

Constructor & Destructor Documentation

recob::Wire::Wire ( )

Default constructor: a wire with no signal information.

Definition at line 17 of file Wire.cxx.

20  , fSignalROI()
21  {}
Unknown view.
Definition: geo_types.h:136
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: Wire.h:127
geo::View_t fView
View corresponding to the plane of this wire.
Definition: Wire.h:128
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:129
recob::Wire::Wire ( 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

Signal is copied into the recob::Wire object, including the sparse region of interest structure within sigROIlist. If possible, use the other constructor that moves the data instead.

For more details, see the other constructor documentation.

Definition at line 24 of file Wire.cxx.

29  : fChannel(channel)
30  , fView(view)
31  , fSignalROI(sigROIlist)
32  {}
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: Wire.h:127
uint8_t channel
Definition: CRTFragment.hh:201
geo::View_t fView
View corresponding to the plane of this wire.
Definition: Wire.h:128
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:129
recob::Wire::Wire ( 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 recob::Wire object is constructed with the waveform information in sigROIlist and assigned the specified channel and view.

The signal is stored in a sparse vector, each entry corresponding to a tick in the calibrated waveform. The tick range of the sparse vector reflects the one in the wire, i.e. the first sample in sigROIlist becomes the sample #0 of the recob::Wire waveform. The total length of the waveform (that is, its duration in ticks) is also learned from the (nominal) size of sigROIlist (see also lar::sparse_vector::resize()), which can and should extend beyond the last region of interest.

This constructor moves the signal information is moved sigROIlist, that becomes invalid. This also preserves the sparse region of interest structure within sigROIlist.

Definition at line 35 of file Wire.cxx.

40  : fChannel(channel)
41  , fView(view)
42  , fSignalROI(std::move(sigROIlist))
43  {}
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: Wire.h:127
uint8_t channel
Definition: CRTFragment.hh:201
geo::View_t fView
View corresponding to the plane of this wire.
Definition: Wire.h:128
def move(depos, offset)
Definition: depos.py:107
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:129

Member Function Documentation

raw::ChannelID_t recob::Wire::Channel ( ) const
inline

Returns the ID of the channel (or InvalidChannelID)

Definition at line 231 of file Wire.h.

231 { return fChannel; }
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: Wire.h:127
std::size_t recob::Wire::NSignal ( ) const
inline

Returns the number of time ticks, or samples, in the channel.

Definition at line 229 of file Wire.h.

229 { return fSignalROI.size(); }
size_type size() const
Returns the size of the vector.
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:129
bool recob::Wire::operator< ( const Wire than) const
inline

Returns whether this channel ID is smaller than the other.

Definition at line 232 of file Wire.h.

233  { return Channel() < than.Channel(); }
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:231
std::vector< float > recob::Wire::Signal ( ) const

Return a zero-padded full length vector filled with RoI signal.

Definition at line 47 of file Wire.cxx.

47  {
48  return { fSignalROI.begin(), fSignalROI.end() };
49  } // Wire::Signal()
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:129
iterator begin()
Standard iterators interface.
const recob::Wire::RegionsOfInterest_t & recob::Wire::SignalROI ( ) const
inline

Returns the list of regions of interest.

Definition at line 228 of file Wire.h.

228 { return fSignalROI; }
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: Wire.h:129
geo::View_t recob::Wire::View ( ) const
inline

Returns the view the channel belongs to.

Definition at line 230 of file Wire.h.

230 { return fView; }
geo::View_t fView
View corresponding to the plane of this wire.
Definition: Wire.h:128

Friends And Related Function Documentation

friend class WireCreator
friend

Definition at line 132 of file Wire.h.

Member Data Documentation

raw::ChannelID_t recob::Wire::fChannel
private

ID of the associated channel.

Definition at line 127 of file Wire.h.

RegionsOfInterest_t recob::Wire::fSignalROI
private

Signal on the channel as function of time tick.

Definition at line 129 of file Wire.h.

geo::View_t recob::Wire::fView
private

View corresponding to the plane of this wire.

Definition at line 128 of file Wire.h.


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