LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
raw::RawDigit Class Reference

Collection of charge vs time digitized from a single readout channel. More...

#include "RawDigit.h"

Public Types

typedef std::vector< short > ADCvector_t
 Type representing a (compressed) vector of ADC counts. More...
 

Public Member Functions

 RawDigit ()
 Default constructor: an empty raw digit. More...
 
 RawDigit (ChannelID_t channel, ULong64_t samples, ADCvector_t const &adclist, raw::Compress_t compression=raw::kNone)
 Constructor: sets all the fields. More...
 
 RawDigit (ChannelID_t channel, ULong64_t samples, ADCvector_t &&adclist, raw::Compress_t compression=raw::kNone)
 Constructor: sets all the fields. More...
 
void SetPedestal (float ped, float sigma=1.)
 Set pedestal and its RMS (the latter is 0 by default) More...
 
Accessors
const ADCvector_tADCs () const
 Reference to the compressed ADC count vector. More...
 
size_t NADC () const
 Number of elements in the compressed ADC sample vector. More...
 
short ADC (int i) const
 ADC vector element number i; no decompression is applied. More...
 
ChannelID_t Channel () const
 DAQ channel this raw data was read from. More...
 
ULong64_t Samples () const
 Number of samples in the uncompressed ADC data. More...
 
float GetPedestal () const
 
float GetSigma () const
 TODO RMS of the pedestal level? More...
 
raw::Compress_t Compression () const
 Compression algorithm used to store the ADC counts. More...
 

Private Attributes

std::vector< short > fADC
 ADC readout per tick, before pedestal subtraction. More...
 
ChannelID_t fChannel
 channel number in the readout More...
 
ULong64_t fSamples
 number of ticks of the clock More...
 
float fPedestal
 pedestal for this channel More...
 
float fSigma
 sigma of the pedestal counts for this channel More...
 
Compress_t fCompression
 compression scheme used for the ADC vector More...
 

Detailed Description

Collection of charge vs time digitized from a single readout channel.

This class hosts potentially compressed data. It does not provide methods to uncompress it, not the same object can become compressed/uncompressed or change compression type: to use a compressed RawDigit, one has to create a new buffer, fill and use it:

raw::RawDigit::ADCvector_t ADCs(digits.Samples()); // fix the size!
raw::Uncompress(digits.ADCs(), ADCs, digits.Compression());

(remember that you have to provide raw::Uncompress() with a buffer large enough to contain the uncompressed data).

The class provides some flags, defined in FlagIndices_t. The construction of a RawDigit should be for example in the form:

raw::RawDigit::ADCvector_t ADCs;
// ... fill the digits etc.
raw::RawDigit saturatedDigit(
  channel, ADCs.size(), ADCs, raw::kNone,
  DefaultFlags | SaturationBit
  );
raw::RawDigit unsaturatedDigit(
  channel, ADCs.size(), ADCs, raw::kNone,
  DefaultFlags & ~SaturationBit
  );

Definition at line 68 of file RawDigit.h.

Member Typedef Documentation

typedef std::vector<short> raw::RawDigit::ADCvector_t

Type representing a (compressed) vector of ADC counts.

Definition at line 72 of file RawDigit.h.

Constructor & Destructor Documentation

raw::RawDigit::RawDigit ( )

Default constructor: an empty raw digit.

Definition at line 19 of file RawDigit.cxx.

20  : fADC(0)
22  , fSamples(0)
23  , fPedestal(0.)
24  , fSigma(0.)
26  // , fFlags(DefaultFlags)
27  {}
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:180
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:186
no compression
Definition: RawTypes.h:9
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:188
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:183
float fPedestal
pedestal for this channel
Definition: RawDigit.h:185
ChannelID_t fChannel
channel number in the readout
Definition: RawDigit.h:182
raw::RawDigit::RawDigit ( ChannelID_t  channel,
ULong64_t  samples,
ADCvector_t const &  adclist,
raw::Compress_t  compression = raw::kNone 
)

Constructor: sets all the fields.

Parameters
channelID of the channel the digits were acquired from
samplesnumber of ADC samples in the uncompressed collection
adclistlist of ADC counts vs. time, compressed
compressioncompression algorithm used in adclist

Data from the adclist is copied into the raw digits. Pedestal is set to 0 by default.

Definition at line 30 of file RawDigit.cxx.

36  : fADC(adclist)
37  , fChannel(channel)
38  , fSamples(samples)
39  , fPedestal(0.)
40  , fSigma(0.)
41  , fCompression(compression)
42  // , fFlags(flags)
43  {}
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:180
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:186
Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:188
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:183
float fPedestal
pedestal for this channel
Definition: RawDigit.h:185
ChannelID_t fChannel
channel number in the readout
Definition: RawDigit.h:182
raw::RawDigit::RawDigit ( ChannelID_t  channel,
ULong64_t  samples,
ADCvector_t &&  adclist,
raw::Compress_t  compression = raw::kNone 
)

Constructor: sets all the fields.

Parameters
channelID of the channel the digits were acquired from
samplesnumber of ADC samples in the uncompressed collection
adclistlist of ADC counts vs. time, compressed
compressioncompression algorithm used in adclist

Data from the adclist is moved into the raw digits. Pedestal is set to 0 by default.

Definition at line 46 of file RawDigit.cxx.

52  : fADC(std::move(adclist))
53  , fChannel(channel)
54  , fSamples(samples)
55  , fPedestal(0.)
56  , fSigma(0.)
57  , fCompression(compression)
58  // , fFlags(flags)
59  {}
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:180
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:186
Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:188
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:183
float fPedestal
pedestal for this channel
Definition: RawDigit.h:185
ChannelID_t fChannel
channel number in the readout
Definition: RawDigit.h:182

Member Function Documentation

short raw::RawDigit::ADC ( int  i) const
inline

ADC vector element number i; no decompression is applied.

Definition at line 205 of file RawDigit.h.

References fADC.

206 {
207  return fADC.at(i);
208 }
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:180
const raw::RawDigit::ADCvector_t & raw::RawDigit::ADCs ( ) const
inline

Reference to the compressed ADC count vector.

Definition at line 209 of file RawDigit.h.

References fADC.

Referenced by nnet::RawWaveformDump::analyze(), nnet::RawWaveformClnSigDump::analyze(), evdb_tool::DrawRawHist::Fill(), detsim::DumpRawDigits::PrintRawDigit(), hit::RawHitFinder::produce(), caldata::CalWire::produce(), and caldata::CalWireT962::produce().

210 {
211  return fADC;
212 }
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:180
raw::Compress_t raw::RawDigit::Compression ( ) const
inline

Compression algorithm used to store the ADC counts.

Definition at line 229 of file RawDigit.h.

References fCompression.

Referenced by nnet::RawWaveformDump::analyze(), nnet::RawWaveformClnSigDump::analyze(), evdb_tool::DrawRawHist::Fill(), detsim::DumpRawDigits::PrintRawDigit(), hit::RawHitFinder::produce(), caldata::CalWire::produce(), and caldata::CalWireT962::produce().

230 {
231  return fCompression;
232 }
Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:188
float raw::RawDigit::GetPedestal ( ) const
inline
float raw::RawDigit::GetSigma ( ) const
inline

TODO RMS of the pedestal level?

Definition at line 225 of file RawDigit.h.

References fSigma.

226 {
227  return fSigma;
228 }
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:186
size_t raw::RawDigit::NADC ( ) const
inline

Number of elements in the compressed ADC sample vector.

Definition at line 201 of file RawDigit.h.

References fADC.

Referenced by detsim::DumpRawDigits::PrintRawDigit().

202 {
203  return fADC.size();
204 }
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:180
void raw::RawDigit::SetPedestal ( float  ped,
float  sigma = 1. 
)

Set pedestal and its RMS (the latter is 0 by default)

Definition at line 62 of file RawDigit.cxx.

References fPedestal, and fSigma.

63  {
64 
65  fPedestal = ped;
66  fSigma = sigma;
67 
68  } // RawDigit::SetPedestal()
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:186
float fPedestal
pedestal for this channel
Definition: RawDigit.h:185

Member Data Documentation

std::vector<short> raw::RawDigit::fADC
private

ADC readout per tick, before pedestal subtraction.

Definition at line 180 of file RawDigit.h.

Referenced by ADC(), ADCs(), and NADC().

ChannelID_t raw::RawDigit::fChannel
private

channel number in the readout

Definition at line 182 of file RawDigit.h.

Referenced by Channel().

Compress_t raw::RawDigit::fCompression
private

compression scheme used for the ADC vector

Definition at line 188 of file RawDigit.h.

Referenced by Compression().

float raw::RawDigit::fPedestal
private

pedestal for this channel

Definition at line 185 of file RawDigit.h.

Referenced by GetPedestal(), and SetPedestal().

ULong64_t raw::RawDigit::fSamples
private

number of ticks of the clock

Definition at line 183 of file RawDigit.h.

Referenced by Samples().

float raw::RawDigit::fSigma
private

sigma of the pedestal counts for this channel

Definition at line 186 of file RawDigit.h.

Referenced by GetSigma(), and SetPedestal().


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