ATLAS Offline Software
LArAccumulatedCalibDigit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //Dear emacs, this is -*-c++-*-
15 /* modifications : */
16 /*
17 03-12-06, G.Rosenbaum
18 Added constructor to take an int for isPulsed to store info re: which caliblines
19 have been pulsed (HEC can be pulsed by up to 4.
20 
21 Changed getDelay to get the forst 12 bits of m_delayPulsed
22 Added functions to get the isPusled info
23 
24 
25 25-08-09 W. Lampl
26 Remove accumulation in converter, simplify LArAccumulatedDigit class
27 Contains now only the data of the currently processed substep.
28 
29 */
30 
31 
32 
33 #ifndef LARACCUMULATEDCALIBDIGIT_H
34 #define LARACCUMULATEDCALIBDIGIT_H
35 #include <vector>
36 
38 #include "CaloIdentifier/CaloGain.h"
39 
40 #include "stdint.h"
41 
43 
44 private:
45 
48 
51 
53  std::vector < uint64_t > m_sampleSum;
54 
56  std::vector < uint64_t > m_sample2Sum;
57 
59  //uint32_t m_nsamples;
60 
63 
66 
69 
71 
73 
74 public:
75 
78  const std::vector < uint64_t >& sampleSum_value,
79  const std::vector < uint64_t >& sample2Sum_value,
80  uint32_t nTrigger_value, uint32_t DAC_value=0, uint16_t delay_value=0,
81  uint16_t isPulsed_value=false, uint16_t nStep_value=0, uint16_t iStep_value=0) :
82  m_hardwareID(channel_value), m_gain(gain_value), m_sampleSum(sampleSum_value), m_sample2Sum(sample2Sum_value),
83  m_nTriggers(nTrigger_value), m_DAC(DAC_value),
84  m_delayPulsed((delay_value & 0xFFF) | (isPulsed_value<<12)),
85  m_nStep(nStep_value), m_iStep(iStep_value)
86  {};
87 
90  uint32_t nsamples=7, uint32_t DAC_value=0, uint16_t delay_value=0,
91  uint16_t isPulsed_value=false, uint16_t nStep_value=0, uint16_t iStep_value=0) :
92  m_hardwareID(channel_value), m_gain(gain_value),
93  m_nTriggers(0), m_DAC(DAC_value),
94  m_delayPulsed((delay_value & 0xFFF) | (isPulsed_value<<12)),
95  m_nStep(nStep_value), m_iStep(iStep_value)
96  {
97  m_sampleSum.resize(nsamples);
98  m_sample2Sum.resize(nsamples);
99  };
100 
103 
107  m_DAC(0), m_delayPulsed(0), m_nStep(0), m_iStep(0)
108  {};
109 
111  const HWIdentifier & hardwareID() const {return m_hardwareID; }
112 
114  const HWIdentifier & channelID() const { return m_hardwareID; }
115 
117  CaloGain::CaloGain gain() const { return m_gain; }
118 
120  size_t nsamples() const { return m_sampleSum.size(); }
121 
123  const std::vector < uint64_t > & sampleSum() const { return m_sampleSum; }
124 
126  const std::vector < uint64_t > & sample2Sum() const { return m_sample2Sum; }
127 
129  unsigned nTriggers() const {return m_nTriggers;}
130 
132  //unsigned nSamples() const {return m_nsamples;}
133 
135  int DAC() const {return static_cast<int>(m_DAC);}
136 
138  int delay() const {return static_cast<int>(m_delayPulsed & 0xFFF);}
139 
141  bool isPulsed() const {return static_cast<bool>(m_delayPulsed & 0xF000);}
142 
144  bool isPulsed(int n) const {
145  if(n==1) return static_cast<bool>(m_delayPulsed & 0x1000);
146  if(n==2) return static_cast<bool>(m_delayPulsed & 0x2000);
147  if(n==3) return static_cast<bool>(m_delayPulsed & 0x4000);
148  if(n==4) return static_cast<bool>(m_delayPulsed & 0x8000);
149  return false;//WRITE ERROR MESSAGE
150  }
151 
153  uint16_t getIsPulsedInt() const { return (m_delayPulsed >> 12);}
154 
156  std::vector<float> mean() const;
157 
159  std::vector<float> RMS() const;
160 
161 
163  float mean(const size_t i) const;
164 
166  float RMS(const size_t i) const;
167 
168  uint16_t nSteps() const { return m_nStep;}
169 
170  uint16_t stepIndex() const {return m_iStep;}
171 
173  void setSampleSum(const std::vector< uint64_t >& sampleSum);
174 
176  void setSample2Sum(const std::vector< uint64_t >& sample2Sum);
177 
179  bool setAddDigit(const std::vector<short>& samples);
180 
182  bool setAddSubStep(const std::vector < uint64_t >& sampleSum, const std::vector < uint64_t >& sample2Sum, const uint32_t nTriggerPerStep);
183 
184 };
185 
186 #endif //LARDIGIT_H
187 
LArAccumulatedCalibDigit::LArAccumulatedCalibDigit
LArAccumulatedCalibDigit(HWIdentifier &channel_value, CaloGain::CaloGain gain_value, uint32_t nsamples=7, uint32_t DAC_value=0, uint16_t delay_value=0, uint16_t isPulsed_value=false, uint16_t nStep_value=0, uint16_t iStep_value=0)
Constructor (initialize for later accumulation)
Definition: LArAccumulatedCalibDigit.h:89
LArAccumulatedCalibDigit
Data class for calibration ADC samples preprocessed by the DSP.
Definition: LArAccumulatedCalibDigit.h:42
LArAccumulatedCalibDigit::setAddDigit
bool setAddDigit(const std::vector< short > &samples)
Sum up with another (individual) LArCalibDigit.
Definition: LArAccumulatedCalibDigit.cxx:82
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArAccumulatedCalibDigit::m_sample2Sum
std::vector< uint64_t > m_sample2Sum
vector of sample square sums
Definition: LArAccumulatedCalibDigit.h:56
LArAccumulatedCalibDigit::m_sampleSum
std::vector< uint64_t > m_sampleSum
vector of sample sums
Definition: LArAccumulatedCalibDigit.h:53
LArAccumulatedCalibDigit::nsamples
size_t nsamples() const
return number of samples
Definition: LArAccumulatedCalibDigit.h:120
LArAccumulatedCalibDigit::nSteps
uint16_t nSteps() const
Definition: LArAccumulatedCalibDigit.h:168
LArAccumulatedCalibDigit::sampleSum
const std::vector< uint64_t > & sampleSum() const
return a reference to a stl vector containing the sample-sums
Definition: LArAccumulatedCalibDigit.h:123
LArAccumulatedCalibDigit::LArAccumulatedCalibDigit
LArAccumulatedCalibDigit(HWIdentifier &channel_value, CaloGain::CaloGain gain_value, const std::vector< uint64_t > &sampleSum_value, const std::vector< uint64_t > &sample2Sum_value, uint32_t nTrigger_value, uint32_t DAC_value=0, uint16_t delay_value=0, uint16_t isPulsed_value=false, uint16_t nStep_value=0, uint16_t iStep_value=0)
Constructor (initialize everything)
Definition: LArAccumulatedCalibDigit.h:77
LArAccumulatedCalibDigit::stepIndex
uint16_t stepIndex() const
Definition: LArAccumulatedCalibDigit.h:170
LArAccumulatedCalibDigit::m_DAC
uint32_t m_DAC
DAC-Value.
Definition: LArAccumulatedCalibDigit.h:65
LArAccumulatedCalibDigit::gain
CaloGain::CaloGain gain() const
return gain value
Definition: LArAccumulatedCalibDigit.h:117
HWIdentifier
Definition: HWIdentifier.h:13
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArAccumulatedCalibDigit::getIsPulsedInt
uint16_t getIsPulsedInt() const
get the four bit int that tells which lines pulsed
Definition: LArAccumulatedCalibDigit.h:153
CaloGain
Definition: CaloGain.h:10
LArAccumulatedCalibDigit::isPulsed
bool isPulsed(int n) const
Tell if calib line n was pulsed for this channel (n=1,2,3,4)
Definition: LArAccumulatedCalibDigit.h:144
LArAccumulatedCalibDigit::m_iStep
uint16_t m_iStep
Definition: LArAccumulatedCalibDigit.h:72
LArAccumulatedCalibDigit::m_nStep
uint16_t m_nStep
Definition: LArAccumulatedCalibDigit.h:70
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
LArAccumulatedCalibDigit::RMS
std::vector< float > RMS() const
Calculates and returns the RMS value of each ADC sample.
Definition: LArAccumulatedCalibDigit.cxx:50
LArAccumulatedCalibDigit::m_nTriggers
uint32_t m_nTriggers
number of samples
Definition: LArAccumulatedCalibDigit.h:62
LArAccumulatedCalibDigit::nTriggers
unsigned nTriggers() const
return the number of triggers
Definition: LArAccumulatedCalibDigit.h:129
LArAccumulatedCalibDigit::m_delayPulsed
uint16_t m_delayPulsed
Delay-Value and isPulsed boolean encoded in this variable.
Definition: LArAccumulatedCalibDigit.h:68
LArAccumulatedCalibDigit::m_gain
CaloGain::CaloGain m_gain
gain
Definition: LArAccumulatedCalibDigit.h:50
LArAccumulatedCalibDigit::hardwareID
const HWIdentifier & hardwareID() const
Return HWIdentifier.
Definition: LArAccumulatedCalibDigit.h:111
LArAccumulatedCalibDigit::mean
std::vector< float > mean() const
Calculates and returns the Mean value of each ADC sample.
Definition: LArAccumulatedCalibDigit.cxx:36
LArAccumulatedCalibDigit::setSample2Sum
void setSample2Sum(const std::vector< uint64_t > &sample2Sum)
Set the sample2Sum.
Definition: LArAccumulatedCalibDigit.cxx:77
HWIdentifier.h
LArAccumulatedCalibDigit::~LArAccumulatedCalibDigit
virtual ~LArAccumulatedCalibDigit()
Destructor.
LArAccumulatedCalibDigit::delay
int delay() const
return the setting of the delay
Definition: LArAccumulatedCalibDigit.h:138
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArAccumulatedCalibDigit::LArAccumulatedCalibDigit
LArAccumulatedCalibDigit()
default constructor for persistency
Definition: LArAccumulatedCalibDigit.h:105
LArAccumulatedCalibDigit::isPulsed
bool isPulsed() const
Tell if this channel was pulsed.
Definition: LArAccumulatedCalibDigit.h:141
LArAccumulatedCalibDigit::setAddSubStep
bool setAddSubStep(const std::vector< uint64_t > &sampleSum, const std::vector< uint64_t > &sample2Sum, const uint32_t nTriggerPerStep)
Sum up with another substep.
Definition: LArAccumulatedCalibDigit.cxx:112
LArAccumulatedCalibDigit::channelID
const HWIdentifier & channelID() const
Return channel ID.
Definition: LArAccumulatedCalibDigit.h:114
CaloGain.h
LArAccumulatedCalibDigit::setSampleSum
void setSampleSum(const std::vector< uint64_t > &sampleSum)
Set the sampleSum.
Definition: LArAccumulatedCalibDigit.cxx:73
LArAccumulatedCalibDigit::sample2Sum
const std::vector< uint64_t > & sample2Sum() const
return a reference to a stl vector containing the sum of the squares of the sample
Definition: LArAccumulatedCalibDigit.h:126
LArAccumulatedCalibDigit::m_hardwareID
HWIdentifier m_hardwareID
Online Identifier.
Definition: LArAccumulatedCalibDigit.h:47
LArAccumulatedCalibDigit::DAC
int DAC() const
return the number of samples
Definition: LArAccumulatedCalibDigit.h:135