Public Types | Public Member Functions | Private Attributes | List of all members
gar::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 with zeros put in for paraneters and an invalid channel. More...
 
 RawDigit (Channel_t channel, ULong64_t samples, ADCvector_t const &adclist, gar::raw::Compress_t compress, ULong64_t time)
 Constructor: sets all the fields. More...
 
 RawDigit (Channel_t channel, ULong64_t samples, ADCvector_t &&adclist, gar::raw::Compress_t compress, ULong64_t time)
 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...
 
Channel_t Channel () const
 DAQ channel this raw data was read from. More...
 
gar::raw::Compress_t Compression () const
 Compression algorithm selector. More...
 
ULong64_t Samples () const
 Number of samples in the uncompressed ADC data. More...
 
float Pedestal () const
 
float Sigma () const
 TODO: RMS of the pedestal level? More...
 
ULong64_t Time () const
 Timestmap. More...
 

Private Attributes

std::vector< short > fADC
 ADC readout per tick, before pedestal subtraction. More...
 
Channel_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...
 
gar::raw::Compress_t fCompression
 compression scheme used for the ADC vector More...
 
ULong64_t fTime
 timestamp 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).

Removed; may need to add this back later. 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 67 of file RawDigit.h.

Member Typedef Documentation

Type representing a (compressed) vector of ADC counts.

Definition at line 71 of file RawDigit.h.

Constructor & Destructor Documentation

gar::raw::RawDigit::RawDigit ( )

Default constructor: an empty raw digit with zeros put in for paraneters and an invalid channel.

Definition at line 20 of file RawDigit.cxx.

21  : fADC(0)
23  , fSamples(0)
24  , fPedestal(0.)
25  , fSigma(0.)
27  , fTime(0)
28  {}
ULong64_t fTime
timestamp
Definition: RawDigit.h:174
float fPedestal
pedestal for this channel
Definition: RawDigit.h:171
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:172
static int max(int a, int b)
no compression
Definition: RawTypes.h:16
gar::raw::Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:173
Channel_t fChannel
channel number in the readout
Definition: RawDigit.h:168
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:169
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:166
gar::raw::RawDigit::RawDigit ( Channel_t  channel,
ULong64_t  samples,
RawDigit::ADCvector_t const &  adclist,
gar::raw::Compress_t  compress,
ULong64_t  time 
)

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 32 of file RawDigit.cxx.

37  : fADC(adclist)
38  , fChannel(channel)
39  , fSamples(samples)
40  , fPedestal(0.)
41  , fSigma(0.)
42  , fCompression(compress)
43  , fTime(time)
44  {}
ULong64_t fTime
timestamp
Definition: RawDigit.h:174
uint8_t channel
Definition: CRTFragment.hh:201
float fPedestal
pedestal for this channel
Definition: RawDigit.h:171
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:172
gar::raw::Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:173
Channel_t fChannel
channel number in the readout
Definition: RawDigit.h:168
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:169
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:166
gar::raw::RawDigit::RawDigit ( Channel_t  channel,
ULong64_t  samples,
RawDigit::ADCvector_t &&  adclist,
gar::raw::Compress_t  compress,
ULong64_t  time 
)

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 48 of file RawDigit.cxx.

53  : fADC(std::move(adclist))
54  , fChannel(channel)
55  , fSamples(samples)
56  , fPedestal(0.)
57  , fSigma(0.)
58  , fCompression(compress)
59  , fTime(time)
60  {}
ULong64_t fTime
timestamp
Definition: RawDigit.h:174
uint8_t channel
Definition: CRTFragment.hh:201
float fPedestal
pedestal for this channel
Definition: RawDigit.h:171
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:172
def move(depos, offset)
Definition: depos.py:107
gar::raw::Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:173
Channel_t fChannel
channel number in the readout
Definition: RawDigit.h:168
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:169
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:166

Member Function Documentation

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

ADC vector element number i; no decompression is applied.

Definition at line 188 of file RawDigit.h.

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

Reference to the compressed ADC count vector.

Definition at line 189 of file RawDigit.h.

189 { return fADC; }
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:166
gar::raw::Channel_t gar::raw::RawDigit::Channel ( ) const
inline

DAQ channel this raw data was read from.

Definition at line 190 of file RawDigit.h.

190 { return fChannel; }
Channel_t fChannel
channel number in the readout
Definition: RawDigit.h:168
gar::raw::Compress_t gar::raw::RawDigit::Compression ( ) const
inline

Compression algorithm selector.

Definition at line 195 of file RawDigit.h.

195 { return fCompression; }
gar::raw::Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:173
size_t gar::raw::RawDigit::NADC ( ) const
inline

Number of elements in the compressed ADC sample vector.

Definition at line 187 of file RawDigit.h.

187 { return fADC.size(); }
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:166
float gar::raw::RawDigit::Pedestal ( ) const
inline

Pedestal level (ADC counts)

Deprecated:
Might be removed soon

Definition at line 192 of file RawDigit.h.

192 { return fPedestal; }
float fPedestal
pedestal for this channel
Definition: RawDigit.h:171
ULong64_t gar::raw::RawDigit::Samples ( ) const
inline

Number of samples in the uncompressed ADC data.

Definition at line 191 of file RawDigit.h.

191 { return fSamples; }
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:169
void gar::raw::RawDigit::SetPedestal ( float  ped,
float  sigma = 1. 
)

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

float gar::raw::RawDigit::Sigma ( ) const
inline

TODO: RMS of the pedestal level?

Definition at line 193 of file RawDigit.h.

193 { return fSigma; }
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:172
ULong64_t gar::raw::RawDigit::Time ( ) const
inline

Timestmap.

Definition at line 194 of file RawDigit.h.

194 { return fTime; }
ULong64_t fTime
timestamp
Definition: RawDigit.h:174

Member Data Documentation

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

ADC readout per tick, before pedestal subtraction.

Definition at line 166 of file RawDigit.h.

Channel_t gar::raw::RawDigit::fChannel
private

channel number in the readout

Definition at line 168 of file RawDigit.h.

gar::raw::Compress_t gar::raw::RawDigit::fCompression
private

compression scheme used for the ADC vector

Definition at line 173 of file RawDigit.h.

float gar::raw::RawDigit::fPedestal
private

pedestal for this channel

Definition at line 171 of file RawDigit.h.

ULong64_t gar::raw::RawDigit::fSamples
private

number of ticks of the clock

Definition at line 169 of file RawDigit.h.

float gar::raw::RawDigit::fSigma
private

sigma of the pedestal counts for this channel

Definition at line 172 of file RawDigit.h.

ULong64_t gar::raw::RawDigit::fTime
private

timestamp

Definition at line 174 of file RawDigit.h.


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