MINT2
StatisticsFinder.h
Go to the documentation of this file.
1 
10 #ifndef STATISTICS_FINDER_HH
11 #define STATISTICS_FINDER_HH
12 
13 #include "Mint/MessageService.h"
14 
16 
17  double _min;
18  double _max;
20  double _nEvents;
21  double _wSum;
22  double _wSum2;
23  double _wSum3;
24  double _wSum4;
25  double _sumW;
27  //Can specify to keep track of the ordered events
28  //allowing things like the median to be calculated
29 
31  mutable std::vector<double> _orderedEvents;
33  bool needOrderedEvents() const;
34  void warnIfWeightedEvents() const;
35  bool notEnoughInformation(const double& val) const;
36 
37  public:
38 
39  StatisticsFinder(bool mean = 1, bool width = 1, bool widthError = 1, bool keepOrderedEvents = 0);
40 
41  double median() const;
42 
43  double numEvents() const{return _nEvents;}
45  void add(const double& x, const double& weight = 1.0);
46 
47  double mean() const;
48  double meanError() const;
49  double varience() const;
50  double width() const;
51  double widthError() const;
52 
53  double expX() const;
54  double expX2() const;
55  double expX3() const;
56  double expX4() const;
57 
58  double secondCentralMom() const;
59  double fourthCentralMom() const;
60 
61  const double& getMin() const{return _min;}
62  const double& getMax() const{return _max;}
64  double range() const{return _max - _min;}
66  virtual ~StatisticsFinder();
67 
68 };
69 
80  public:
84 };
85 
96  public:
97  MeanFinder() : StatisticsFinder(1,0,0,0){}
100 };
101 
112  public:
116 };
117 
128  public:
132 };
133 
143  public:
147 };
148 
149 #endif
void warnIfWeightedEvents() const
double fourthCentralMom() const
std::vector< double > _orderedEvents
double secondCentralMom() const
double median() const
double expX4() const
void add(const double &x, const double &weight=1.0)
const double & getMin() const
double varience() const
double range() const
double widthError() const
double numEvents() const
double expX3() const
double expX() const
double width() const
StatisticsFinder(bool mean=1, bool width=1, bool widthError=1, bool keepOrderedEvents=0)
bool needOrderedEvents() const
double meanError() const
bool notEnoughInformation(const double &val) const
const double & getMax() const
double expX2() const
double mean() const