CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Averages.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripCommissioningSources_Averages_H
2 #define DQM_SiStripCommissioningSources_Averages_H
3 
5 #include <boost/cstdint.hpp>
6 #include <vector>
7 #include <map>
8 
10 class Averages {
11 
12  public:
13 
14  Averages();
15  ~Averages() {;}
16 
17  class Params {
18  public:
19  float mean_;
20  float median_;
21  float mode_;
22  float rms_;
23  float weight_;
24  float max_;
25  float min_;
26  uint32_t num_;
27  Params() :
28  mean_(1.*sistrip::invalid_),
29  median_(1.*sistrip::invalid_),
30  mode_(1.*sistrip::invalid_),
31  rms_(1.*sistrip::invalid_),
32  weight_(1.*sistrip::invalid_),
33  max_(-1.*sistrip::invalid_),
34  min_(1.*sistrip::invalid_),
35  num_(sistrip::invalid_) {;}
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 
51  uint32_t n_;
52  float s_;
53  float x_;
54  float xx_;
55  std::vector<float> median_;
56  std::map<uint32_t,uint32_t> mode_;
57 
58 };
59 
60 #endif // DQM_SiStripCommissioningSources_Averages_H
61 
std::map< uint32_t, uint32_t > mode_
Definition: Averages.h:56
float x_
Definition: Averages.h:53
void add(const float &value, const float &weight)
uint32_t n_
Definition: Averages.h:51
void calc(Params &)
Definition: Averages.cc:60
std::vector< float > median_
Definition: Averages.h:55
float s_
Definition: Averages.h:52
~Averages()
Definition: Averages.h:15
static const uint16_t invalid_
Definition: Constants.h:16
uint32_t num_
Definition: Averages.h:26
Averages()
Definition: Averages.cc:10
float xx_
Definition: Averages.h:54