ATLAS Offline Software
LArRawEvent/LArRawEvent/LArAutoCorr.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 LARAUTOCORR_H
6 #define LARAUTOCORR_H
7 /********************************************************************
8 
9  NAME: LArAutoCorr.h
10  PACKAGE: offline/LArCalorimeter/LArRawEvent
11 
12  AUTHORS: M. AHARROUCHE
13  CREATED: Dec. 16, 2003
14 
15  PURPOSE: Intermediate object used to handle data
16  to be used for calculation of autocorrelation
17  elements.
18 
19  ********************************************************************/
20 // Include files
21 #include <string>
22 #include <vector>
23 #include <math.h>
24 
25 
26 class LArAutoCorr
27 {
28  private:
29 
30  // Lower bound of window
31  short m_min;
32 
33  // Upper bound of window
34  short m_max;
35 
36  // Sum of components
37  std::vector<double> m_sum;
38 
39  // Sum of squares
40  std::vector<double> m_matrix;
41 
42  // Autocorrelation matrix
43  std::vector<double> m_cov;
44  std::vector<double> m_cov_temp;
45 
46  // Counter of events
47  int m_nped;
48 
49  public:
50 
51  // Constructor
52  LArAutoCorr()
53  {
54  m_min = -1;
55  m_max = -1;
56  m_nped = 0;
57  }
58 
59  // Destructor
60  ~LArAutoCorr(){}
61 
62  // Reset m_sum, m_matrix and m_nped
63  void correl_zero();
64 
65  // Set lower value
66  void set_min(const short min);
67 
68  // Set upper value
69  void set_max(const short max);
70 
71  // Get number of entries
72  int get_nentries() const;
73 
74  // Get mean value
75  double get_mean() const;
76 
77  // Get rms value
78  double get_rms() const;
79 
80  // Get lower value
81  const short & get_min()const;
82 
83  // Get uper value
84  const short & get_max() const;
85 
86  // Fill the m_sum and m_matrix vector
87  void add(const std::vector<short>& samples, size_t maxnsamples);
88 
89  // Compute the autocorrelation elements
90  //MGV implement switch m_normalize to normalize
91  const std::vector<double> & get_cov(int normalize, int phys) ;
92 
93 
94 };
95 
96 #endif
97 
max
#define max(a, b)
Definition: cfImp.cxx:41
LArAutoCorr::correl_zero
void correl_zero()
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:248
LArAutoCorr::m_cov_temp
std::vector< double > m_cov_temp
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:56
LArAutoCorr::get_max
const short & get_max() const
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:126
LArAutoCorr::m_sum
std::vector< double > m_sum
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:49
LArAutoCorr::get_cov
const std::vector< double > & get_cov(int m_normalize, int m_phys)
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:149
LArAutoCorr::~LArAutoCorr
~LArAutoCorr()
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:72
normalize
Double_t normalize(TF1 *func, Double_t *rampl=NULL, Double_t from=0., Double_t to=0., Double_t step=1.)
Definition: LArPhysWaveHECTool.cxx:825
LArAutoCorr::set_max
void set_max(const short max)
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:104
LArAutoCorr::m_cov
std::vector< double > m_cov
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:55
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
LArAutoCorr::set_min
void set_min(const short min)
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:97
LArAutoCorr::add
void add(const std::vector< short > &samples, size_t maxnsamples)
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:222
LArAutoCorr::get_nentries
int get_nentries() const
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:111
LArAutoCorr::get_mean
double get_mean() const
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:134
min
#define min(a, b)
Definition: cfImp.cxx:40
LArAutoCorr::m_max
short m_max
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:46
LArAutoCorr::get_min
const short & get_min() const
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:119
LArAutoCorr::m_matrix
std::vector< double > m_matrix
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:52
LArAutoCorr
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:27
LArAutoCorr::m_min
short m_min
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:43
LArAutoCorr::get_rms
double get_rms() const
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:199
LArAutoCorr::LArAutoCorr
LArAutoCorr()
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:64
LArAutoCorr::m_nped
int m_nped
Definition: LArCalibUtils/LArCalibUtils/LArAutoCorr.h:59