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

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

#include "OpWaveform.h"

Public Types

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

Public Member Functions

 OpWaveform ()
 Default constructor: a wire with no signal information. More...
 
 OpWaveform (double time, raw::ChannelID_t channel, RegionsOfInterest_t const &sigROIlist)
 Constructor: uses specified signal in regions of interest. More...
 
 OpWaveform (double time, raw::ChannelID_t channel, RegionsOfInterest_t &&sigROIlist)
 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...
 
raw::ChannelID_t Channel () const
 Returns the ID of the channel (or InvalidChannelID) More...
 
double TimeStamp () const
 Returns the time stamp. More...
 
Sorting and comparison operations
bool operator< (const OpWaveform &than) const
 Returns whether this channel ID is smaller than the other. More...
 

Private Attributes

double fTimeStamp
 Time stamp. More...
 
raw::ChannelID_t fChannel
 ID of the associated channel. More...
 
RegionsOfInterest_t fSignalROI
 Signal on the channel as function of time tick. More...
 

Detailed Description

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

Note
The class is designed based on recob::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::OpDetWaveform that originates it.

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 OpWaveform 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: opwf.Signal()) ...

or they can analyze region by region:

for (auto iROI = opwf.begin_range(); iROI != opwf.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: opwf.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::OpDetWaveform object. These associations should be stored together with recob::OpWaveform by the producer in a art::Assns data product.

Creating recob::OpWaveform objects

LArSoft "protocol" prescribes:

Definition at line 94 of file OpWaveform.h.

Member Typedef Documentation

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

Definition at line 97 of file OpWaveform.h.

Constructor & Destructor Documentation

recob::OpWaveform::OpWaveform ( )

Default constructor: a wire with no signal information.

Definition at line 17 of file OpWaveform.cxx.

double fTimeStamp
Time stamp.
Definition: OpWaveform.h:103
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: OpWaveform.h:105
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: OpWaveform.h:104
recob::OpWaveform::OpWaveform ( double  time,
raw::ChannelID_t  channel,
RegionsOfInterest_t const &  sigROIlist 
)

Constructor: uses specified signal in regions of interest.

Parameters
timetime stamp of the signal
channelthe ID of the channel
sigROIlistsignal organized in regions of interest

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

23  : fTimeStamp(time), fChannel(channel), fSignalROI(sigROIlist)
24  {}
double fTimeStamp
Time stamp.
Definition: OpWaveform.h:103
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: OpWaveform.h:105
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: OpWaveform.h:104
recob::OpWaveform::OpWaveform ( double  time,
raw::ChannelID_t  channel,
RegionsOfInterest_t &&  sigROIlist 
)

Constructor: uses specified signal in regions of interest.

Parameters
timetime stamp of the signal
channelthe ID of the channel
sigROIlistsignal organized in regions of interest

The recob::OpWaveform 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::OpWaveform 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 27 of file OpWaveform.cxx.

28  : fTimeStamp(time), fChannel(channel), fSignalROI(std::move(sigROIlist))
29  {}
double fTimeStamp
Time stamp.
Definition: OpWaveform.h:103
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: OpWaveform.h:105
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: OpWaveform.h:104

Member Function Documentation

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

Returns the ID of the channel (or InvalidChannelID)

Definition at line 197 of file OpWaveform.h.

References fChannel.

Referenced by operator<().

198 {
199  return fChannel;
200 }
raw::ChannelID_t fChannel
ID of the associated channel.
Definition: OpWaveform.h:104
std::size_t recob::OpWaveform::NSignal ( ) const
inline

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

Definition at line 193 of file OpWaveform.h.

References fSignalROI, and lar::sparse_vector< T >::size().

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

Returns whether this channel ID is smaller than the other.

Definition at line 205 of file OpWaveform.h.

References Channel().

206 {
207  return Channel() < than.Channel();
208 }
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: OpWaveform.h:197
std::vector< float > recob::OpWaveform::Signal ( ) const

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

Definition at line 32 of file OpWaveform.cxx.

References lar::sparse_vector< T >::begin(), lar::sparse_vector< T >::end(), and fSignalROI.

33  {
34  return {fSignalROI.begin(), fSignalROI.end()};
35  } // OpWaveform::Signal()
iterator end()
Standard iterators interface.
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: OpWaveform.h:105
iterator begin()
Standard iterators interface.
const recob::OpWaveform::RegionsOfInterest_t & recob::OpWaveform::SignalROI ( ) const
inline

Returns the list of regions of interest.

Definition at line 189 of file OpWaveform.h.

References fSignalROI.

190 {
191  return fSignalROI;
192 }
RegionsOfInterest_t fSignalROI
Signal on the channel as function of time tick.
Definition: OpWaveform.h:105
double recob::OpWaveform::TimeStamp ( ) const
inline

Returns the time stamp.

Definition at line 201 of file OpWaveform.h.

References fTimeStamp.

202 {
203  return fTimeStamp;
204 }
double fTimeStamp
Time stamp.
Definition: OpWaveform.h:103

Member Data Documentation

raw::ChannelID_t recob::OpWaveform::fChannel
private

ID of the associated channel.

Definition at line 104 of file OpWaveform.h.

Referenced by Channel().

RegionsOfInterest_t recob::OpWaveform::fSignalROI
private

Signal on the channel as function of time tick.

Definition at line 105 of file OpWaveform.h.

Referenced by NSignal(), Signal(), and SignalROI().

double recob::OpWaveform::fTimeStamp
private

Time stamp.

Definition at line 103 of file OpWaveform.h.

Referenced by TimeStamp().


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