LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
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, unsigned short samples, ADCvector_t const &adclist, raw::Compress_t compression=raw::kNone) | |
Constructor: sets all the fields. More... | |
RawDigit (ChannelID_t channel, unsigned short 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_t & | ADCs () 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... | |
unsigned short | 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... | |
unsigned short | 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... | |
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.
typedef std::vector<short> raw::RawDigit::ADCvector_t |
Type representing a (compressed) vector of ADC counts.
Definition at line 72 of file RawDigit.h.
raw::RawDigit::RawDigit | ( | ) |
Default constructor: an empty raw digit.
Definition at line 20 of file RawDigit.cxx.
raw::RawDigit::RawDigit | ( | ChannelID_t | channel, |
unsigned short | samples, | ||
ADCvector_t const & | adclist, | ||
raw::Compress_t | compression = raw::kNone |
||
) |
Constructor: sets all the fields.
channel | ID of the channel the digits were acquired from |
samples | number of ADC samples in the uncompressed collection |
adclist | list of ADC counts vs. time, compressed |
compression | compression 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.
raw::RawDigit::RawDigit | ( | ChannelID_t | channel, |
unsigned short | samples, | ||
ADCvector_t && | adclist, | ||
raw::Compress_t | compression = raw::kNone |
||
) |
Constructor: sets all the fields.
channel | ID of the channel the digits were acquired from |
samples | number of ADC samples in the uncompressed collection |
adclist | list of ADC counts vs. time, compressed |
compression | compression algorithm used in adclist |
Data from the adclist is moved into the raw digits. Pedestal is set to 0 by default.
Definition at line 50 of file RawDigit.cxx.
|
inline |
ADC vector element number i; no decompression is applied.
Definition at line 207 of file RawDigit.h.
References fADC.
|
inline |
Reference to the compressed ADC count vector.
Definition at line 209 of file RawDigit.h.
References fADC.
Referenced by detsim::DumpRawDigits::PrintRawDigit(), caldata::CalWire::produce(), caldata::CalWireT962::produce(), hit::RawHitFinder::produce(), and raw::RecompressRawDigits::recompress().
|
inline |
DAQ channel this raw data was read from.
Definition at line 211 of file RawDigit.h.
References fChannel.
Referenced by evd::RawDataDrawer::FillQHisto(), recob::HitCollectionAssociator::prepare_associations(), recob::HitRefinerAssociator::prepare_associations(), detsim::DumpRawDigits::PrintRawDigit(), caldata::CalWire::produce(), caldata::CalWireT962::produce(), hit::RawHitFinder::produce(), raw::RecompressRawDigits::recompress(), and evd::RawDataDrawer::RunOperation().
|
inline |
Compression algorithm used to store the ADC counts.
Definition at line 215 of file RawDigit.h.
References fCompression.
Referenced by detsim::DumpRawDigits::PrintRawDigit(), caldata::CalWire::produce(), caldata::CalWireT962::produce(), hit::RawHitFinder::produce(), and raw::RecompressRawDigits::recompress().
|
inline |
Pedestal level (ADC counts)
Definition at line 213 of file RawDigit.h.
References fPedestal.
Referenced by evd::RawDataDrawer::FillQHisto(), evd::RawDataDrawer::FillTQHisto(), caldata::CalWire::produce(), caldata::CalWireT962::produce(), hit::RawHitFinder::produce(), and evd::RawDataDrawer::RunOperation().
|
inline |
TODO RMS of the pedestal level?
Definition at line 214 of file RawDigit.h.
References fSigma.
|
inline |
Number of elements in the compressed ADC sample vector.
Definition at line 206 of file RawDigit.h.
References fADC.
Referenced by detsim::DumpRawDigits::PrintRawDigit().
|
inline |
Number of samples in the uncompressed ADC data.
Definition at line 212 of file RawDigit.h.
References fSamples.
Referenced by detsim::DumpRawDigits::PrintRawDigit(), caldata::CalWire::produce(), caldata::CalWireT962::produce(), hit::RawHitFinder::produce(), raw::RecompressRawDigits::recompress(), evd::details::RawDigitCacheDataClass::Refill(), and recob::WireCreator::WireCreator().
void raw::RawDigit::SetPedestal | ( | float | ped, |
float | sigma = 1. |
||
) |
Set pedestal and its RMS (the latter is 0 by default)
Definition at line 68 of file RawDigit.cxx.
References fPedestal, and fSigma.
|
private |
ADC readout per tick, before pedestal subtraction.
Definition at line 182 of file RawDigit.h.
|
private |
|
private |
compression scheme used for the ADC vector
Definition at line 190 of file RawDigit.h.
Referenced by Compression().
|
private |
pedestal for this channel
Definition at line 187 of file RawDigit.h.
Referenced by GetPedestal(), and SetPedestal().
|
private |
|
private |
sigma of the pedestal counts for this channel
Definition at line 188 of file RawDigit.h.
Referenced by GetSigma(), and SetPedestal().