Logo ROOT  
Reference Guide
RooHistError Class Reference

RooHistError is a singleton class used to calculate the error bars for each bin of a RooHist object.

Errors are calculated by integrating a specified area of a Poisson or Binomail error distribution.

Definition at line 25 of file RooHistError.h.

Classes

class  BinomialSumAsym
 
class  BinomialSumEff
 
class  PoissonSum
 

Public Member Functions

virtual ~RooHistError ()
 
Bool_t getBinomialIntervalAsym (Int_t n, Int_t m, Double_t &a1, Double_t &a2, Double_t nSigma=1) const
 Return 'nSigma' binomial confidence interval for (n,m). More...
 
Bool_t getBinomialIntervalEff (Int_t n, Int_t m, Double_t &a1, Double_t &a2, Double_t nSigma=1) const
 Return 'nSigma' binomial confidence interval for (n,m). More...
 
Bool_t getInterval (const RooAbsFunc *Qu, const RooAbsFunc *Ql, Double_t pointEstimate, Double_t stepSize, Double_t &lo, Double_t &hi, Double_t nSigma) const
 Calculate a confidence interval using the cumulative functions provided. More...
 
Bool_t getPoissonInterval (Int_t n, Double_t &mu1, Double_t &mu2, Double_t nSigma=1) const
 Return a confidence interval for the expected number of events given n observed (unweighted) events. More...
 

Static Public Member Functions

static RooAbsFunccreateBinomialSum (Int_t n, Int_t m, Bool_t eff)
 Create and return a BinomialSum function binding. More...
 
static RooAbsFunccreatePoissonSum (Int_t n)
 Create and return a PoissonSum function binding. More...
 
static const RooHistErrorinstance ()
 Return a reference to a singleton object that is created the first time this method is called. More...
 

Private Member Functions

 RooHistError ()
 Construct our singleton object. More...
 
Bool_t getPoissonIntervalCalc (Int_t n, Double_t &mu1, Double_t &mu2, Double_t nSigma=1) const
 Calculate a confidence interval for the expected number of events given n observed (unweighted) events. More...
 
Double_t seek (const RooAbsFunc &f, Double_t startAt, Double_t step, Double_t value) const
 Scan f(x)-value until it changes sign. More...
 

Private Attributes

Double_t _poissonHiLUT [1000]
 
Double_t _poissonLoLUT [1000]
 

#include <RooHistError.h>

Constructor & Destructor Documentation

◆ ~RooHistError()

virtual RooHistError::~RooHistError ( )
inlinevirtual

Definition at line 28 of file RooHistError.h.

◆ RooHistError()

RooHistError::RooHistError ( )
private

Construct our singleton object.

Definition at line 59 of file RooHistError.cxx.

Member Function Documentation

◆ createBinomialSum()

RooAbsFunc * RooHistError::createBinomialSum ( Int_t  n,
Int_t  m,
Bool_t  eff 
)
static

Create and return a BinomialSum function binding.

Definition at line 343 of file RooHistError.cxx.

◆ createPoissonSum()

RooAbsFunc * RooHistError::createPoissonSum ( Int_t  n)
static

Create and return a PoissonSum function binding.

Definition at line 334 of file RooHistError.cxx.

◆ getBinomialIntervalAsym()

Bool_t RooHistError::getBinomialIntervalAsym ( Int_t  n,
Int_t  m,
Double_t asym1,
Double_t asym2,
Double_t  nSigma = 1 
) const

Return 'nSigma' binomial confidence interval for (n,m).

The result is return in asym1 and asym2. If the return values is kFALSE and error occurred.

Definition at line 133 of file RooHistError.cxx.

◆ getBinomialIntervalEff()

Bool_t RooHistError::getBinomialIntervalEff ( Int_t  n,
Int_t  m,
Double_t asym1,
Double_t asym2,
Double_t  nSigma = 1 
) const

Return 'nSigma' binomial confidence interval for (n,m).

The result is return in asym1 and asym2. If the return values is kFALSE and error occurred.

Definition at line 196 of file RooHistError.cxx.

◆ getInterval()

Bool_t RooHistError::getInterval ( const RooAbsFunc Qu,
const RooAbsFunc Ql,
Double_t  pointEstimate,
Double_t  stepSize,
Double_t lo,
Double_t hi,
Double_t  nSigma 
) const

Calculate a confidence interval using the cumulative functions provided.

The interval will be "central" when both cumulative functions are provided, unless this would exclude the pointEstimate, in which case a one-sided interval pinned at the point estimate is returned instead.

Definition at line 263 of file RooHistError.cxx.

◆ getPoissonInterval()

Bool_t RooHistError::getPoissonInterval ( Int_t  n,
Double_t mu1,
Double_t mu2,
Double_t  nSigma = 1 
) const

Return a confidence interval for the expected number of events given n observed (unweighted) events.

The interval will contain the same probability as nSigma of a Gaussian. Uses a central interval unless this does not enclose the point estimate n (ie, for small n) in which case the interval is adjusted to start at n. This method uses a lookup table to return precalculated results for n<1000

Definition at line 79 of file RooHistError.cxx.

◆ getPoissonIntervalCalc()

Bool_t RooHistError::getPoissonIntervalCalc ( Int_t  n,
Double_t mu1,
Double_t mu2,
Double_t  nSigma = 1 
) const
private

Calculate a confidence interval for the expected number of events given n observed (unweighted) events.

The interval will contain the same probability as nSigma of a Gaussian. Uses a central interval unless this does not enclose the point estimate n (ie, for small n) in which case the interval is adjusted to start at n.

Definition at line 102 of file RooHistError.cxx.

◆ instance()

const RooHistError & RooHistError::instance ( )
static

Return a reference to a singleton object that is created the first time this method is called.

Only one object will be constructed per ROOT session.

Definition at line 49 of file RooHistError.cxx.

◆ seek()

Double_t RooHistError::seek ( const RooAbsFunc f,
Double_t  startAt,
Double_t  step,
Double_t  value 
) const
private

Scan f(x)-value until it changes sign.

Start at the specified point and take constant steps of the specified size. Give up after 1000 steps.

Definition at line 313 of file RooHistError.cxx.

Member Data Documentation

◆ _poissonHiLUT

Double_t RooHistError::_poissonHiLUT[1000]
private

Definition at line 44 of file RooHistError.h.

◆ _poissonLoLUT

Double_t RooHistError::_poissonLoLUT[1000]
private

Definition at line 43 of file RooHistError.h.


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