yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.0
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 const int i = _est(x);
22 if (i < 0) return 0;
23 const size_t i2 = (size_t) i;
24 if (i2 >= _N) return _N+1;
25 return i2 + 1;
26 }

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 29 of file BinEstimators.h.

29 {
30 return estindex(x);
31 }
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: