ATLAS Offline Software
LArRawEvent/LArRawEvent/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/LArRawEvent
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 
26 class LArPedestal
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 
68  double get_mean(const unsigned isample_min, const unsigned isample_max) const;
69 
70  // Get rms value
71  double get_rms() const;
72  double get_rms(const unsigned isample) const;
73  double get_rms(const unsigned isample_min, const unsigned isample_max) const;
74 
75 
76  // Get number of samples
77  inline unsigned get_nsamples() const { return m_sum.size();}
78 
79  // Get lower value
80  inline const short& get_min() const { return m_min; }
81 
82  // Get uper value
83  inline const short& get_max() const { return m_max; }
84 
85  // Fill the m_sum and m_matrix vector
86  void add(const std::vector<short>& samples);
87 
88 };
89 
90 #endif
91 
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
max
#define max(a, b)
Definition: cfImp.cxx:41
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()
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
min
#define min(a, b)
Definition: cfImp.cxx:40
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