Belle II Software  release-08-01-10
EmpiricalDistributionFunction Class Reference

Empirical distribution function object is basic for mainpulation of probabilities. More...

#include <NNWaveFitTool.h>

Collaboration diagram for EmpiricalDistributionFunction:

Public Member Functions

 EmpiricalDistributionFunction (const nnFitterBinData &p, const nnFitterBins &bins)
 Constructor constructs edf object from a probability distribution. More...
 
double operator() (double t)
 EmpiricalDistributionFunction(t) gives edf value at time t, linearly interpolated from cummulative bin probabilities. More...
 

Private Attributes

const nnFitterBinsm_bins
 array of bin boundaries.
 
std::vector< std::pair< double, double > > m_pTable
 (bin, prob) pairs
 

Detailed Description

Empirical distribution function object is basic for mainpulation of probabilities.

Definition at line 39 of file NNWaveFitTool.h.

Constructor & Destructor Documentation

◆ EmpiricalDistributionFunction()

EmpiricalDistributionFunction ( const nnFitterBinData p,
const nnFitterBins bins 
)
inline

Constructor constructs edf object from a probability distribution.

Parameters
parray of bin probabilities
binsarray of bin boundaries, size(p) + 1

Definition at line 45 of file NNWaveFitTool.h.

45  :
46  m_bins(bins)
47  {
48  // Create table of probabiilities for EmpiricalDistributionFunction calculation
49  m_pTable.resize(m_bins.size());
50  auto ibin = m_bins.begin();
51  auto ipt = m_pTable.begin();
52  double cp = 0.0;
53  *ipt++ = std::make_pair(*ibin++, cp);
54  for (auto prob : p) {
55  cp += prob;
56  *ipt++ = std::make_pair(*ibin++, cp);
57  }
58  }
std::vector< std::pair< double, double > > m_pTable
(bin, prob) pairs
Definition: NNWaveFitTool.h:79
const nnFitterBins & m_bins
array of bin boundaries.
Definition: NNWaveFitTool.h:78

Member Function Documentation

◆ operator()()

double operator() ( double  t)
inline

EmpiricalDistributionFunction(t) gives edf value at time t, linearly interpolated from cummulative bin probabilities.

Parameters
ttime at which edf is to be calculated.

Definition at line 64 of file NNWaveFitTool.h.


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