yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.3
YODA::BinEstimator Struct Reference

Bin estimator. More...

#include <BinEstimators.h>

Inheritance diagram for YODA::BinEstimator:
YODA::LinBinEstimator YODA::LogBinEstimator

Public Member Functions

virtual ~BinEstimator ()
 Virtual destructor needed for inheritance.
 
size_t estindex (double x) const
 Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.
 
size_t operator() (double x) const
 Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.
 

Detailed Description

Bin estimator.

Base class for guessing the right bin index for a given value. The better the guess, the less time spent looking.

Definition at line 14 of file BinEstimators.h.

Constructor & Destructor Documentation

◆ ~BinEstimator()

virtual YODA::BinEstimator::~BinEstimator ( )
inlinevirtual

Virtual destructor needed for inheritance.

Definition at line 17 of file BinEstimators.h.

17{}

Member Function Documentation

◆ estindex()

size_t YODA::BinEstimator::estindex ( double  x) const
inline

Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.

Definition at line 20 of file BinEstimators.h.

20 {
21 if (_N == 0) return 0;
22 const int i = _est(x);
23 if (i < 0) return 0;
24 const size_t i2 = (size_t) i;
25 if (i2 >= _N) return _N+1;
26 return i2 + 1;
27 }

Referenced by operator()().

◆ operator()()

size_t YODA::BinEstimator::operator() ( double  x) const
inline

Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.

Definition at line 30 of file BinEstimators.h.

30 {
31 return estindex(x);
32 }
size_t estindex(double x) const
Return offset bin index estimate, with 0 = underflow and Nbins+1 = overflow.

References estindex().


The documentation for this struct was generated from the following file: