ATLAS Offline Software
L1CaloPedestalCumul.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGT1CALOCALIBCONDITIONS_L1CALOPEDESTALCUMUL_H
6 #define TRIGT1CALOCALIBCONDITIONS_L1CALOPEDESTALCUMUL_H
7 
8 #include <string>
9 #include <vector>
10 #include <math.h>
11 
22 {
23  private:
24 
25  // Lower bound of window
26  short m_min;
27  // Upper bound of window
28  short m_max;
29  // Sum of components
30  std::vector<double> m_sum;
31  // Sum of squares
32  std::vector<double> m_matrix;
33  // Event counter
34  int m_nped;
35 
36  public:
37 
38  // Constructor
40  // Destructor
42 
43  // Reset m_sum, m_matrix and m_nped
44  void clear();
45 
46  // Set lower value
47  void set_min(const short min) { m_min = min; };
48 
49  // Set upper value
50  void set_max(const short max) { m_max = max; };
51 
52  // Get number of entries
53  inline int get_nentries() const { return m_nped; }
54 
55  // Get sum
56  double get_sum() const;
57  double get_sum(const unsigned isample) const;
58 
59  // Get mean value
60  double get_mean() const;
61  double get_mean(const unsigned isample) const;
62 
63  // Get rms value
64  double get_rms() const;
65  double get_rms(const unsigned isample) const;
66 
67  // Get number of samples
68  inline unsigned get_nsamples() const { return m_sum.size();}
69 
70  // Get lower value
71  inline const short& get_min() const { return m_min; }
72 
73  // Get uper value
74  inline const short& get_max() const { return m_max; }
75 
76  // Fill the m_sum and m_matrix vector
77  void add(const std::vector<int>& samples);
78 
79 };
80 
81 #endif
82 
L1CaloPedestalCumul
Intermediate Class to store pedestal data from the L1CaloPedestalMaker algorithm.
Definition: L1CaloPedestalCumul.h:22
L1CaloPedestalCumul::m_matrix
std::vector< double > m_matrix
Definition: L1CaloPedestalCumul.h:32
L1CaloPedestalCumul::set_min
void set_min(const short min)
Definition: L1CaloPedestalCumul.h:47
max
#define max(a, b)
Definition: cfImp.cxx:41
L1CaloPedestalCumul::clear
void clear()
Definition: L1CaloPedestalCumul.cxx:115
L1CaloPedestalCumul::get_max
const short & get_max() const
Definition: L1CaloPedestalCumul.h:74
L1CaloPedestalCumul::get_min
const short & get_min() const
Definition: L1CaloPedestalCumul.h:71
L1CaloPedestalCumul::~L1CaloPedestalCumul
~L1CaloPedestalCumul()
Definition: L1CaloPedestalCumul.cxx:15
L1CaloPedestalCumul::get_mean
double get_mean() const
Definition: L1CaloPedestalCumul.cxx:48
L1CaloPedestalCumul::m_nped
int m_nped
Definition: L1CaloPedestalCumul.h:34
L1CaloPedestalCumul::set_max
void set_max(const short max)
Definition: L1CaloPedestalCumul.h:50
L1CaloPedestalCumul::m_sum
std::vector< double > m_sum
Definition: L1CaloPedestalCumul.h:30
L1CaloPedestalCumul::add
void add(const std::vector< int > &samples)
Definition: L1CaloPedestalCumul.cxx:99
L1CaloPedestalCumul::m_min
short m_min
Definition: L1CaloPedestalCumul.h:26
L1CaloPedestalCumul::L1CaloPedestalCumul
L1CaloPedestalCumul()
Definition: L1CaloPedestalCumul.cxx:9
min
#define min(a, b)
Definition: cfImp.cxx:40
L1CaloPedestalCumul::get_sum
double get_sum() const
Definition: L1CaloPedestalCumul.cxx:28
L1CaloPedestalCumul::m_max
short m_max
Definition: L1CaloPedestalCumul.h:28
L1CaloPedestalCumul::get_nsamples
unsigned get_nsamples() const
Definition: L1CaloPedestalCumul.h:68
L1CaloPedestalCumul::get_rms
double get_rms() const
Definition: L1CaloPedestalCumul.cxx:80
L1CaloPedestalCumul::get_nentries
int get_nentries() const
Definition: L1CaloPedestalCumul.h:53