ATLAS Offline Software
Loading...
Searching...
No Matches
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
39 uint32_t m_nped;
40
41 public:
42
43 // Constructor
45 // Destructor
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
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
void add(const std::vector< short > &samples)
std::vector< uint64_t > m_sumSquares
void set_max(const short max)
void set_min(const short min)