10#include <ecl/modules/eclLocalRunCalibration/ECLLocalRunCalibAcc.h>
14#include <boost/accumulators/accumulators.hpp>
15#include <boost/accumulators/statistics.hpp>
19 const float& min_value,
20 const float& max_value,
21 const int*
const ndevs):
22 m_leftLimit(min_value),
23 m_rightLimit(max_value),
51 const int& count)
const
53 return sqrt((variance * count) / (count - 1));
73 namespace bacc = boost::accumulators;
74 bacc::accumulator_set <
79 bacc::tag::variance >> acc;
80 for (
const auto& value :
m_data) {
85 float tcount = bacc::count(acc);
86 float tmedian = bacc::median(acc);
87 float tvariance = bacc::variance(acc);
91 bacc::accumulator_set <
96 bacc::tag::variance >> acc_final;
97 for (
const auto& value :
m_data) {
104 m_count = bacc::count(acc_final);
105 m_mean = bacc::mean(acc_final);
106 tvariance = bacc::variance(acc_final);
void calc()
Calculate mean value, standard deviation and number of accepted events.
float calcStdDev(const float &variance, const int &count) const
Calculate standard deviation using variance and number of accepted events.
float m_leftLimit
Lower value limit.
int getCount() const
Get number of accepted events.
float getMean() const
Get mean value.
ECLLocalRunCalibAcc(const float &min_value, const float &max_value, const int *const ndevs)
Constructor.
float m_rightLimit
Upper value limit.
~ECLLocalRunCalibAcc()
Destructor.
void updateLimits(const float &mean, const float &stddev)
Update value limits.
bool isValueInRange(const float &value) const
Check value.
std::vector< int > m_data
Vector of accepted values.
int m_nevents
Total number of events.
int getNOfEvents() const
Get total number of events.
void add(const float &value)
Add value.
const int *const c_ndevs
Number of standard deviations used to update value limits.
float getStdDev() const
Get standard deviation.
int m_count
Number of accepted events.
float m_stddev
Standard deviation.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.