RawDigit.cxx
Go to the documentation of this file.
1 /** ****************************************************************************
2  * @file RawDigit.cxx
3  * @brief Definition of basic raw digits
4  * @author brebel@fnal.gov
5  * @see RawDigit.h raw.h
6  *
7  * Compression/uncompression utilities are declared in lardata/RawData/raw.h .
8  *
9  * ****************************************************************************/
10 
12 
13 // C/C++ standard libraries
14 #include <utility> // std::move()
15 
16 
17 namespace raw{
18 
19  //----------------------------------------------------------------------
21  : fADC(0)
22  , fChannel(InvalidChannelID)
23  , fSamples(0)
24  , fPedestal(0.)
25  , fSigma(0.)
26  , fCompression(kNone)
27  // , fFlags(DefaultFlags)
28  {}
29 
30 
31  //----------------------------------------------------------------------
34  ULong64_t samples,
35  ADCvector_t const& adclist,
36  Compress_t compression /* = kNone */ /*,
37  const Flags_t& flags / * = DefaultFlags * / */
38  )
39  : fADC(adclist)
40  , fChannel(channel)
41  , fSamples(samples)
42  , fPedestal(0.)
43  , fSigma(0.)
44  , fCompression(compression)
45  // , fFlags(flags)
46  {}
47 
48 
49  //----------------------------------------------------------------------
52  ULong64_t samples,
53  ADCvector_t&& adclist,
54  Compress_t compression /* = kNone */ /*,
55  const Flags_t& flags / * = DefaultFlags * / */
56  )
57  : fADC(std::move(adclist))
58  , fChannel(channel)
59  , fSamples(samples)
60  , fPedestal(0.)
61  , fSigma(0.)
62  , fCompression(compression)
63  // , fFlags(flags)
64  {}
65 
66 
67  //----------------------------------------------------------------------
68  void RawDigit::SetPedestal(float ped, float sigma /* = 1. */ )
69  {
70 
71  fPedestal = ped;
72  fSigma = sigma;
73 
74  } // RawDigit::SetPedestal()
75 
76 
77 } // namespace raw
78 ////////////////////////////////////////////////////////////////////////
79 
std::vector< short > fADC
ADC readout per tick, before pedestal subtraction.
Definition: RawDigit.h:183
enum raw::_compress Compress_t
float fSigma
sigma of the pedestal counts for this channel
Definition: RawDigit.h:189
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
STL namespace.
Raw data description.
uint8_t channel
Definition: CRTFragment.hh:201
no compression
Definition: RawTypes.h:9
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:32
def move(depos, offset)
Definition: depos.py:107
Compress_t fCompression
compression scheme used for the ADC vector
Definition: RawDigit.h:191
RawDigit()
Default constructor: an empty raw digit.
Definition: RawDigit.cxx:20
ULong64_t fSamples
number of ticks of the clock
Definition: RawDigit.h:186
void SetPedestal(float ped, float sigma=1.)
Set pedestal and its RMS (the latter is 0 by default)
Definition: RawDigit.cxx:68
float fPedestal
pedestal for this channel
Definition: RawDigit.h:188
ChannelID_t fChannel
channel number in the readout
Definition: RawDigit.h:185
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28