All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
recob::ChannelROI Class Reference

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

#include <ChannelROI.h>

Public Types

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

Public Member Functions

 ChannelROI ()
 Default constructor: a ChannelROI with no signal information. More...
 
 ChannelROI (RegionsOfInterest_t const &sigROIlist, raw::ChannelID_t channel)
 Constructor: uses specified signal in regions of interest. More...
 
 ChannelROI (RegionsOfInterest_t &&sigROIlist, raw::ChannelID_t channel)
 Constructor: uses specified signal in regions of interest. More...
 
Accessors
std::vector< short int > 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...
 
raw::ChannelID_t Channel () const
 Returns the ID of the channel (or InvalidChannelID) More...
 
Sorting and comparison operations
bool operator< (const ChannelROI &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...
 
RegionsOfInterest_t fSignalROI
 Signal on the channel as function of time tick. More...
 

Friends

class ChannelROICreator
 

Detailed Description

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

Note
This class is associated to an entire channel, not just a single logical Wire on a given logical plane

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 ChannelROI 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.

What is different in this data object from the recob::Wire data that precedes it is that we store the information as short ints rather than floats. This is because the initial data is a short int to start with but, more important, storing as an int will improve compressibility and save output storage space. Note that this is signed because the data will be pedestal subtracted

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 (auto ADCcount: ChannelROI.Signal()) ...

or they can analyze region by region:

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

An alternative to the first form is:

for (short ADCcount: ChannelROI.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::ChannelROI by the producer in a art::Assns data product.

Definition at line 107 of file ChannelROI.h.

Member Typedef Documentation

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

Definition at line 110 of file ChannelROI.h.

Constructor & Destructor Documentation

recob::ChannelROI::ChannelROI ( )

Default constructor: a ChannelROI with no signal information.

Definition at line 17 of file ChannelROI.cxx.

19  , fSignalROI()
20  {}
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: ChannelROI.h:117
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: ChannelROI.h:116
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
recob::ChannelROI::ChannelROI ( RegionsOfInterest_t const &  sigROIlist,
raw::ChannelID_t  channel 
)

Constructor: uses specified signal in regions of interest.

Parameters
sigROIlistsignal organized in regions of interest
channelthe ID of the channel

Signal is copied into the recob::ChannelROI 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 23 of file ChannelROI.cxx.

27  : fChannel(channel)
28  , fSignalROI(sigROIlist)
29  {}
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: ChannelROI.h:117
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: ChannelROI.h:116
recob::ChannelROI::ChannelROI ( RegionsOfInterest_t &&  sigROIlist,
raw::ChannelID_t  channel 
)

Constructor: uses specified signal in regions of interest.

Parameters
sigROIlistsignal organized in regions of interest
channelthe ID of the channel

The recob::ChannelROI 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 ChannelROI, i.e. the first sample in sigROIlist becomes the sample #0 of the recob::ChannelROI 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 32 of file ChannelROI.cxx.

36  : fChannel(channel)
37  , fSignalROI(std::move(sigROIlist))
38  {}
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: ChannelROI.h:117
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: ChannelROI.h:116

Member Function Documentation

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

Returns the ID of the channel (or InvalidChannelID)

Definition at line 211 of file ChannelROI.h.

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

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

Definition at line 210 of file ChannelROI.h.

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

Returns whether this channel ID is smaller than the other.

Definition at line 212 of file ChannelROI.h.

213  { return Channel() < than.Channel(); }
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: ChannelROI.h:211
std::vector< short int > recob::ChannelROI::Signal ( ) const

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

Definition at line 42 of file ChannelROI.cxx.

42  {
43  return { fSignalROI.begin(), fSignalROI.end() };
44  } // ChannelROI::Signal()
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: ChannelROI.h:117
iterator begin()
Standard iterators interface.
const recob::ChannelROI::RegionsOfInterest_t & recob::ChannelROI::SignalROI ( ) const
inline

Returns the list of regions of interest.

Definition at line 209 of file ChannelROI.h.

209 { return fSignalROI; }
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: ChannelROI.h:117

Friends And Related Function Documentation

friend class ChannelROICreator
friend

Definition at line 120 of file ChannelROI.h.

Member Data Documentation

raw::ChannelID_t recob::ChannelROI::fChannel
private

ID of the associated channel.

Definition at line 116 of file ChannelROI.h.

RegionsOfInterest_t recob::ChannelROI::fSignalROI
private

Signal on the channel as function of time tick.

Definition at line 117 of file ChannelROI.h.


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