CMS 3D CMS Logo

Averages.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripCommissioningSources_Averages_H
2 #define DQM_SiStripCommissioningSources_Averages_H
3 
5 #include <vector>
6 #include <map>
7 #include <cstdint>
8 
10 class Averages {
11 public:
12  Averages();
13  ~Averages() { ; }
14 
15  class Params {
16  public:
17  float mean_;
18  float median_;
19  float mode_;
20  float rms_;
21  float weight_;
22  float max_;
23  float min_;
24  uint32_t num_;
26  : mean_(1. * sistrip::invalid_),
27  median_(1. * sistrip::invalid_),
28  mode_(1. * sistrip::invalid_),
29  rms_(1. * sistrip::invalid_),
30  weight_(1. * sistrip::invalid_),
31  max_(-1. * sistrip::invalid_),
32  min_(1. * sistrip::invalid_),
34  ;
35  }
36  ~Params() { ; }
37  };
38 
40  void add(const float& value, const float& weight);
41  void add(const float& value);
43  void add(const uint32_t& value, const uint32_t& weight);
44  void add(const uint32_t& value);
45 
47  void calc(Params&);
48 
49 private:
50  uint32_t n_;
51  float s_;
52  float x_;
53  float xx_;
54  std::vector<float> median_;
55  std::map<uint32_t, uint32_t> mode_;
56 };
57 
58 #endif // DQM_SiStripCommissioningSources_Averages_H
Averages::Params
Definition: Averages.h:15
Averages::x_
float x_
Definition: Averages.h:52
Averages::calc
void calc(Params &)
Definition: Averages.cc:48
Averages::Params::max_
float max_
Definition: Averages.h:22
Averages::Params::num_
uint32_t num_
Definition: Averages.h:24
Averages::Params::~Params
~Params()
Definition: Averages.h:36
Averages::mode_
std::map< uint32_t, uint32_t > mode_
Definition: Averages.h:55
Averages::median_
std::vector< float > median_
Definition: Averages.h:54
Averages::Params::median_
float median_
Definition: Averages.h:18
Averages::s_
float s_
Definition: Averages.h:51
Averages::add
void add(const float &value, const float &weight)
Averages::Params::weight_
float weight_
Definition: Averages.h:21
Averages::~Averages
~Averages()
Definition: Averages.h:13
SiStripConstants.h
Averages::Params::mean_
float mean_
Definition: Averages.h:17
Averages::xx_
float xx_
Definition: Averages.h:53
Averages::Params::min_
float min_
Definition: Averages.h:23
value
Definition: value.py:1
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
Averages::Averages
Averages()
Definition: Averages.cc:10
Averages::n_
uint32_t n_
Definition: Averages.h:50
Averages
Definition: Averages.h:10
Averages::Params::Params
Params()
Definition: Averages.h:25
sistrip
sistrip classes
Definition: EnsembleCalibrationLA.cc:10
Averages::Params::mode_
float mode_
Definition: Averages.h:19
Averages::Params::rms_
float rms_
Definition: Averages.h:20
weight
Definition: weight.py:1