ATLAS Offline Software
LArAccumulatedDigit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
23 #ifndef LARACCUMULATEDDIGIT_H
24 #define LARACCUMULATEDDIGIT_H
25 #include <vector>
26 
29 
30 #include "stdint.h"
31 
33 
34 private:
35 
38 
41 
43  std::vector<uint64_t> m_sampleSum;
44 
46  std::vector<uint64_t> m_sampleSquare;
47 
50 
51 public:
52 
54  LArAccumulatedDigit(HWIdentifier & channel_value,
55  CaloGain::CaloGain gain_value,
56  const std::vector<uint64_t>& sampleSum_value,
57  const std::vector<uint64_t>& sampleSquare_value,
58  uint32_t nTrigger_value);
59 
61  LArAccumulatedDigit(HWIdentifier & channel_value);
62 
64  ~LArAccumulatedDigit() = default;
65 
68 
70  const HWIdentifier & hardwareID() const {return m_hardwareID; }
71 
73  const HWIdentifier & channelID() const { return m_hardwareID; }
74 
76  CaloGain::CaloGain gain() const { return m_gain; }
77 
79  int nsample() const { return m_sampleSquare.size(); }
80 
82  const std::vector<uint64_t>& sampleSum() const { return m_sampleSum; };
83 
85  const std::vector < uint64_t > & sampleSquare() const { return m_sampleSquare; }
86 
88  unsigned nTrigger() const {return m_nTrigger;}
89 
91  float mean(int n_min=-1, int n_max=-1) const;
92 
94  float RMS(int n_min=-1, int n_max=-1) const;
95 
97  //MGV implement switch m_normalize to normalize
98  void getCov(std::vector<float> &cov, int normalize) const;
99 
101  bool setAddDigit(const std::vector<short>& digit);
102 
103 
105  bool setAddSubStep(const CaloGain::CaloGain gain_value,
106  const HWIdentifier chid,
107  const std::vector<uint64_t>& sampleSum,
108  const std::vector <uint64_t>& sampleSquare,
109  const unsigned nTrigger);
110 
111  void setAddSubStep(CaloGain::CaloGain gain_value, const std::vector<uint64_t>& sampleSum,
112  const std::vector < uint64_t >& sampleSquare, unsigned nTrigger);
113  void setAddSubStep(CaloGain::CaloGain gain_value, const std::vector<int64_t>& sampleSum,
114  const std::vector < int64_t >& sampleSquare, unsigned nTrigger, int32_t base);
115 
116 
118  return setAddSubStep(ad.gain(), ad.channelID(), ad.sampleSum(),ad.sampleSquare(),ad.nTrigger());
119  };
120 };
121 
122 #endif //LARACCUMULATEDDIGIT_H
123 
LArAccumulatedDigit::gain
CaloGain::CaloGain gain() const
return gain value
Definition: LArAccumulatedDigit.h:76
LArAccumulatedDigit::m_hardwareID
HWIdentifier m_hardwareID
Online Identifier.
Definition: LArAccumulatedDigit.h:37
base
std::string base
Definition: hcg.cxx:78
LArAccumulatedDigit::m_gain
CaloGain::CaloGain m_gain
gain
Definition: LArAccumulatedDigit.h:40
LArAccumulatedDigit::setAddSubStep
bool setAddSubStep(const CaloGain::CaloGain gain_value, const HWIdentifier chid, const std::vector< uint64_t > &sampleSum, const std::vector< uint64_t > &sampleSquare, const unsigned nTrigger)
Accumulate new values
Definition: LArAccumulatedDigit.cxx:113
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
LArAccumulatedDigit::sampleSquare
const std::vector< uint64_t > & sampleSquare() const
return a reference to a stl vector containing the sum of the squares of the sample
Definition: LArAccumulatedDigit.h:85
LArAccumulatedDigit::mean
float mean(int n_min=-1, int n_max=-1) const
Calculates and returns the Mean value of ADC samples.
Definition: LArAccumulatedDigit.cxx:41
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
HWIdentifier
Definition: HWIdentifier.h:13
normalize
Double_t normalize(TF1 *func, Double_t *rampl=NULL, Double_t from=0., Double_t to=0., Double_t step=1.)
Definition: LArPhysWaveHECTool.cxx:825
LArAccumulatedDigit::setAddDigit
bool setAddDigit(const std::vector< short > &digit)
Accumulate single digit.
Definition: LArAccumulatedDigit.cxx:92
LArAccumulatedDigit::hardwareID
const HWIdentifier & hardwareID() const
Return HWIdentifier.
Definition: LArAccumulatedDigit.h:70
LArAccumulatedDigit::m_nTrigger
uint32_t m_nTrigger
number of total triggers
Definition: LArAccumulatedDigit.h:49
LArAccumulatedDigit
Data class for ADC samples and autocorr preprocessed by the DSP.
Definition: LArAccumulatedDigit.h:32
LArAccumulatedDigit::~LArAccumulatedDigit
~LArAccumulatedDigit()=default
Destructor.
LArAccumulatedDigit::setAddSubStep
bool setAddSubStep(const LArAccumulatedDigit &ad)
Definition: LArAccumulatedDigit.h:117
LArAccumulatedDigit::nsample
int nsample() const
return number of samples
Definition: LArAccumulatedDigit.h:79
LArAccumulatedDigit::getCov
void getCov(std::vector< float > &cov, int normalize) const
Compute the autocorrelation elements.
Definition: LArAccumulatedDigit.cxx:232
LArAccumulatedDigit::m_sampleSum
std::vector< uint64_t > m_sampleSum
sampleSum over ntrigger*nsamples
Definition: LArAccumulatedDigit.h:43
LArAccumulatedDigit::RMS
float RMS(int n_min=-1, int n_max=-1) const
Calculates and returns the RMS value of ADC samples
Definition: LArAccumulatedDigit.cxx:64
HWIdentifier.h
LArAccumulatedDigit::nTrigger
unsigned nTrigger() const
return the number of triggers
Definition: LArAccumulatedDigit.h:88
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArAccumulatedDigit::sampleSum
const std::vector< uint64_t > & sampleSum() const
return the sample-sums
Definition: LArAccumulatedDigit.h:82
LArAccumulatedDigit::LArAccumulatedDigit
LArAccumulatedDigit()
default constructor for persistency
Definition: LArAccumulatedDigit.cxx:10
LArAccumulatedDigit::m_sampleSquare
std::vector< uint64_t > m_sampleSquare
vector(index: j from s_i*s_{i+j})
Definition: LArAccumulatedDigit.h:46
CaloGain.h
LArAccumulatedDigit::channelID
const HWIdentifier & channelID() const
Return channel ID.
Definition: LArAccumulatedDigit.h:73