ATLAS Offline Software
Loading...
Searching...
No Matches
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
22
23#ifndef LARACCUMULATEDDIGIT_H
24#define LARACCUMULATEDDIGIT_H
25#include <vector>
26
29
30#include "stdint.h"
31
33
34private:
35
38
41
43 std::vector<uint64_t> m_sampleSum;
44
46 std::vector<uint64_t> m_sampleSquare;
47
49 uint32_t m_nTrigger;
50
51public:
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
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
Double_t normalize(TF1 *func, Double_t *rampl=NULL, Double_t from=0., Double_t to=0., Double_t step=1.)
const HWIdentifier & hardwareID() const
Return HWIdentifier.
CaloGain::CaloGain m_gain
gain
const std::vector< uint64_t > & sampleSum() const
return the sample-sums
const std::vector< uint64_t > & sampleSquare() const
return a reference to a stl vector containing the sum of the squares of the sample
float RMS(int n_min=-1, int n_max=-1) const
Calculates and returns the RMS value of ADC samples.
std::vector< uint64_t > m_sampleSquare
vector(index: j from s_i*s_{i+j})
HWIdentifier m_hardwareID
Online Identifier.
LArAccumulatedDigit(HWIdentifier &channel_value, CaloGain::CaloGain gain_value, const std::vector< uint64_t > &sampleSum_value, const std::vector< uint64_t > &sampleSquare_value, uint32_t nTrigger_value)
Constructor (first type)
float mean(int n_min=-1, int n_max=-1) const
Calculates and returns the Mean value of ADC samples.
CaloGain::CaloGain gain() const
return gain value
int nsample() const
return number of samples
LArAccumulatedDigit()
default constructor for persistency
bool setAddDigit(const std::vector< short > &digit)
Accumulate single digit.
bool setAddSubStep(const LArAccumulatedDigit &ad)
uint32_t m_nTrigger
number of total triggers
unsigned nTrigger() const
return the number of triggers
std::vector< uint64_t > m_sampleSum
sampleSum over ntrigger*nsamples
void getCov(std::vector< float > &cov, int normalize) const
Compute the autocorrelation elements.
~LArAccumulatedDigit()=default
Destructor.
const HWIdentifier & channelID() const
Return channel ID.
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.
std::string base
Definition hcg.cxx:81