ATLAS Offline Software
LArCalibUtils/LArCalibUtils/LArPedestal.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARPEDESTAL_H
6 #define LARPEDESTAL_H
7 /********************************************************************
8 
9  NAME: LArPedestal.h
10  PACKAGE: offline/LArCalorimeter/LArCalibUtils
11 
12  AUTHORS: M. AHARROUCHE
13  CREATED: Jan. 12, 2004
14  UPDATED: Mar. 10, 2004 by Remi Lafaye
15 
16  PURPOSE: Interchanges the data with LArPedestalMaker for
17  calculation of pedestal and rms.
18 
19  ********************************************************************/
20 // Include files
21 #include <string>
22 #include <vector>
23 #include <math.h>
24 #include <stdint.h>
25 
27 {
28  private:
29 
30  // Lower bound of window
31  short m_min;
32  // Upper bound of window
33  short m_max;
34  // Sum of components
35  std::vector<uint32_t> m_sum;
36  // Sum of squares
37  std::vector<uint64_t> m_sumSquares;
38  // Event counter
40 
41  public:
42 
43  // Constructor
44  LArPedestal();
45  // Destructor
46  ~LArPedestal();
47 
48  // Reset m_sum, m_matrix and m_nped
49  void zero();
50 
51  // Set lower value
52  void set_min(const short min);
53 
54  // Set upper value
55  void set_max(const short max);
56 
57  // Get number of entries
58  inline int get_nentries() const { return m_nped; }
59 
60  // Get sum
61  double get_sum() const;
62  double get_sum(const unsigned isample) const;
63 
64  // Get mean value
65  double get_mean() const;
66  double get_mean(const unsigned isample) const;
67  double get_mean(const unsigned isample_min, const unsigned isample_max) const;
68 
69  // Get rms value
70  double get_rms() const;
71  double get_rms(const unsigned isample) const;
72  double get_rms(const unsigned isample_min, const unsigned isample_max) const;
73 
74  // Get number of samples
75  inline unsigned get_nsamples() const { return m_sum.size();}
76 
77  // Get lower value
78  inline const short& get_min() const { return m_min; }
79 
80  // Get uper value
81  inline const short& get_max() const { return m_max; }
82 
83  // Fill the m_sum and m_matrix vector
84  void add(const std::vector<short>& samples);
85 
86 };
87 
88 #endif
89 
LArPedestal::m_min
short m_min
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:43
LArPedestal::get_rms
double get_rms() const
Definition: LArCalibUtils/src/LArPedestal.cxx:151
LArPedestal::get_mean
double get_mean() const
Definition: LArCalibUtils/src/LArPedestal.cxx:102
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArPedestal
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:27
LArPedestal::~LArPedestal
~LArPedestal()
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
LArPedestal::m_sum
std::vector< uint32_t > m_sum
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:47
LArPedestal::get_max
const short & get_max() const
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:93
LArPedestal::add
void add(const std::vector< short > &samples)
Definition: LArCalibUtils/src/LArPedestal.cxx:170
LArPedestal::get_min
const short & get_min() const
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:90
LArPedestal::m_nped
uint32_t m_nped
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:51
LArPedestal::get_nsamples
unsigned get_nsamples() const
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:87
LArPedestal::set_min
void set_min(const short min)
Definition: LArCalibUtils/src/LArPedestal.cxx:37
LArPedestal::set_max
void set_max(const short max)
Definition: LArCalibUtils/src/LArPedestal.cxx:44
LArPedestal::m_sumSquares
std::vector< uint64_t > m_sumSquares
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:49
LArPedestal::get_sum
double get_sum() const
Definition: LArCalibUtils/src/LArPedestal.cxx:61
LArPedestal::zero
void zero()
Definition: LArCalibUtils/src/LArPedestal.cxx:188
LArPedestal::LArPedestal
LArPedestal()
Definition: LArCalibUtils/src/LArPedestal.cxx:23
LArPedestal::m_max
short m_max
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:45
LArPedestal::get_nentries
int get_nentries() const
Definition: LArCalibUtils/LArCalibUtils/LArPedestal.h:70