1#ifndef YODA_BINESTIMATORS_H
2#define YODA_BINESTIMATORS_H
21 const int i = _est(x);
23 const size_t i2 = (size_t) i;
24 if (i2 >= _N)
return _N+1;
37 virtual int _est(
double x)
const = 0;
54 _m = (double) nbins / (xhigh - xlow);
65 int _est(
double x)
const {
66 int res =(int) floor(_m * (x - _c));
88 _m = nbins / (log2(xhigh) - _c);
99 int _est(
double x)
const {
100 int res =(int) floor(_m * (Utils::fastlog2(x) - _c));
Logarithmic bin estimator.
LogBinEstimator(const LogBinEstimator &other)
Copy constructor.
LogBinEstimator(size_t nbins, double xlow, double xhigh)
Constructor.
Anonymous namespace to limit visibility.
size_t operator()(double x) const
Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.
size_t estindex(double x) const
Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.
virtual ~BinEstimator()
Virtual destructor needed for inheritance.
LinBinEstimator(size_t nbins, double xlow, double xhigh)
Constructor.
LinBinEstimator(const LinBinEstimator &other)
Copy constructor.