Belle II Software  release-05-02-19
ECLLocalRunCalibAcc.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * ECLLocalRunCalibAcc *
6  * *
7  * Feature (mean value, standard deviation and number of accepted *
8  * events) accumulator. *
9  * *
10  * Author: The Belle II Collaboration *
11  * Contributors: Sergei Gribanov (S.S.Gribanov@inp.nsk.su), *
12  * *
13  * This software is provided "as is" without any warranty. *
14  **************************************************************************/
15 #pragma once
16 
17 // STL
18 #include <vector>
19 // BOOST
20 #include <boost/accumulators/accumulators.hpp>
21 #include <boost/accumulators/statistics.hpp>
22 namespace bacc = boost::accumulators;
23 namespace Belle2 {
34  class ECLLocalRunCalibAcc {
35  public:
44  const float& min_value,
45  const float& max_value,
46  const int* const ndevs);
54  int getNOfEvents() const;
59  int getCount() const;
63  float getMean() const;
67  float getStdDev() const;
71  void add(const float& value);
77  void calc();
78  private:
84  bool isValueInRange(const float& value) const;
93  float calcStdDev(const float& variance,
94  const int& count) const;
101  void updateLimits(const float& mean,
102  const float& stddev);
106  float m_leftLimit;
110  float m_rightLimit;
116  const int* const c_ndevs;
120  int m_nevents;
125  int m_count;
129  float m_mean;
133  float m_stddev;
137  std::vector<int> m_data;
138  };
140 }
141 
Belle2::ECLLocalRunCalibAcc::m_count
int m_count
Number of accepted events.
Definition: ECLLocalRunCalibAcc.h:138
Belle2::ECLLocalRunCalibAcc::isValueInRange
bool isValueInRange(const float &value) const
Check value.
Definition: ECLLocalRunCalibAcc.cc:44
Belle2::ECLLocalRunCalibAcc::getCount
int getCount() const
Get number of accepted events.
Definition: ECLLocalRunCalibAcc.cc:123
Belle2::ECLLocalRunCalibAcc::add
void add(const float &value)
Add value.
Definition: ECLLocalRunCalibAcc.cc:50
Belle2::ECLLocalRunCalibAcc::m_data
std::vector< int > m_data
Vector of accepted values.
Definition: ECLLocalRunCalibAcc.h:150
Belle2::ECLLocalRunCalibAcc::~ECLLocalRunCalibAcc
~ECLLocalRunCalibAcc()
Destructor.
Definition: ECLLocalRunCalibAcc.cc:40
Belle2::ECLLocalRunCalibAcc::m_rightLimit
float m_rightLimit
Upper value limit.
Definition: ECLLocalRunCalibAcc.h:123
Belle2::ECLLocalRunCalibAcc::getStdDev
float getStdDev() const
Get standard deviation.
Definition: ECLLocalRunCalibAcc.cc:133
Belle2::ECLLocalRunCalibAcc::m_leftLimit
float m_leftLimit
Lower value limit.
Definition: ECLLocalRunCalibAcc.h:119
Belle2::ECLLocalRunCalibAcc::ECLLocalRunCalibAcc
ECLLocalRunCalibAcc(const float &min_value, const float &max_value, const int *const ndevs)
Constructor.
Definition: ECLLocalRunCalibAcc.cc:25
Belle2::ECLLocalRunCalibAcc::calcStdDev
float calcStdDev(const float &variance, const int &count) const
Calculate standard deviation using variance and number of accepted events.
Definition: ECLLocalRunCalibAcc.cc:57
Belle2::ECLLocalRunCalibAcc::getNOfEvents
int getNOfEvents() const
Get total number of events.
Definition: ECLLocalRunCalibAcc.cc:118
Belle2::ECLLocalRunCalibAcc::calc
void calc()
Calculate mean value, standard deviation and number of accepted events.
Definition: ECLLocalRunCalibAcc.cc:72
Belle2::ECLLocalRunCalibAcc::m_stddev
float m_stddev
Standard deviation.
Definition: ECLLocalRunCalibAcc.h:146
Belle2::ECLLocalRunCalibAcc::getMean
float getMean() const
Get mean value.
Definition: ECLLocalRunCalibAcc.cc:128
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLLocalRunCalibAcc::c_ndevs
const int *const c_ndevs
Number of standard deviations used to update value limits.
Definition: ECLLocalRunCalibAcc.h:129
Belle2::ECLLocalRunCalibAcc::updateLimits
void updateLimits(const float &mean, const float &stddev)
Update value limits.
Definition: ECLLocalRunCalibAcc.cc:63
Belle2::ECLLocalRunCalibAcc::m_nevents
int m_nevents
Total number of events.
Definition: ECLLocalRunCalibAcc.h:133
Belle2::ECLLocalRunCalibAcc::m_mean
float m_mean
Mean value.
Definition: ECLLocalRunCalibAcc.h:142