1#ifndef ROOT_TEfficiency
2#define ROOT_TEfficiency
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
#define ClassDefOverride(name, id)
const TEfficiency operator+(const TEfficiency &lhs, const TEfficiency &rhs)
static unsigned int total
Using a TBrowser one can browse all ROOT objects.
Collection abstract base class.
Describe directory structure in memory.
void FillGraph2D(TGraph2DAsymmErrors *graph, Option_t *opt) const
Bool_t UsesCentralInterval() const
void Draw(Option_t *opt="") override
Default Draw method for all objects.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
void SetPosteriorMode(Bool_t on=true)
TEfficiency(const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Int_t nbinsy, const Double_t *ybins)
TH2 * CreateHistogram(Option_t *opt="") const
Bool_t SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins)
TH2 * GetPaintedHistogram() const
Double_t GetBetaAlpha(Int_t bin=-1) const
void SetPosteriorAverage(Bool_t on=true)
void FillWeighted(Bool_t bPassed, Double_t weight, Double_t x, Double_t y=0, Double_t z=0)
Bool_t SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins, Int_t nz, const Double_t *zBins)
void Browse(TBrowser *) override
Browse object. May be overridden for another default action.
static Double_t AgrestiCoull(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
TList * GetListOfFunctions()
Long64_t Merge(TCollection *list)
std::vector< std::pair< Double_t, Double_t > > fBeta_bin_params
Parameter for prior beta distribution different bin by bin (default vector is empty).
EStatOption fStatisticOption
Defines how the confidence intervals are determined.
TEfficiency(const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup)
void SetStatisticOption(EStatOption option)
static Double_t Combine(Double_t &up, Double_t &low, Int_t n, const Int_t *pass, const Int_t *total, Double_t alpha, Double_t beta, Double_t level=0.683, const Double_t *w=nullptr, Option_t *opt="")
TGraph2DAsymmErrors * GetPaintedGraph2D() const
void Paint(Option_t *opt) override
This method must be overridden if a class wants to paint itself.
void SetWeight(Double_t weight)
static Double_t BetaMode(Double_t alpha, Double_t beta)
TH1 * fTotalHistogram
Histogram for total number of events.
Int_t GetDimension() const
TGraph2DAsymmErrors * fPaintGraph2D
! Temporary graph for painting
TEfficiency & operator+=(const TEfficiency &rhs)
Bool_t SetBins(Int_t nx, Double_t xmin, Double_t xmax)
void Build(const char *name, const char *title)
TH1 * GetCopyPassedHisto() const
static Double_t Bayesian(Double_t total, Double_t passed, Double_t level, Double_t alpha, Double_t beta, Bool_t bUpper, Bool_t bShortest=false)
Double_t GetEfficiencyErrorUp(Int_t bin) const
static Bool_t CheckConsistency(const TH1 &pass, const TH1 &total, Option_t *opt="")
static Double_t MidPInterval(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Double_t fBeta_alpha
Global parameter for prior beta distribution (default = 1).
Bool_t UsesBayesianStat() const
static Bool_t CheckWeights(const TH1 &pass, const TH1 &total)
Bool_t SetBins(Int_t nx, const Double_t *xBins)
const TH1 * GetPassedHistogram() const
void SavePrimitive(std::ostream &out, Option_t *opt="") override
Save a primitive as a C++ statement(s) on output stream "out".
static Double_t Wilson(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
static Double_t Normal(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
void SetBetaBeta(Double_t beta)
Double_t GetConfidenceLevel() const
void SetName(const char *name) override
Set the name of the TNamed.
TEfficiency(const char *name, const char *title, Int_t nbins, Double_t xlow, Double_t xup)
TGraph2DAsymmErrors * CreateGraph2D(Option_t *opt="") const
Bool_t SetPassedEvents(Int_t bin, Double_t events)
Int_t GetGlobalBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
TH1 * fPassedHistogram
Histogram for events which passed certain criteria.
void SetBetaAlpha(Double_t alpha)
Bool_t SetBins(Int_t nx, Double_t xmin, Double_t xmax, Int_t ny, Double_t ymin, Double_t ymax)
@ kIsBayesian
Bayesian statistics are used.
@ kUseWeights
Use weights.
@ kPosteriorMode
Use posterior mean for best estimate (Bayesian statistics).
@ kUseBinPrior
Use a different prior for each bin.
@ kShortestInterval
Use shortest interval.
static Double_t FeldmanCousins(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Double_t fWeight
Weight for all events (default = 1).
Bool_t SetPassedHistogram(const TH1 &rPassed, Option_t *opt)
Bool_t SetBins(Int_t nx, Double_t xmin, Double_t xmax, Int_t ny, Double_t ymin, Double_t ymax, Int_t nz, Double_t zmin, Double_t zmax)
Double_t GetBetaBeta(Int_t bin=-1) const
Double_t(* fBoundary)(Double_t, Double_t, Double_t, Bool_t)
! Pointer to a method calculating the boundaries of confidence intervals
void FillGraph(TGraphAsymmErrors *graph, Option_t *opt) const
static Double_t BetaCentralInterval(Double_t level, Double_t alpha, Double_t beta, Bool_t bUpper)
Bool_t UsesPosteriorMode() const
TEfficiency(const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, Int_t nbinsz, Double_t zlow, Double_t zup)
void SetShortestInterval(Bool_t on=true)
const TH1 * GetTotalHistogram() const
Bool_t UsesWeights() const
void FillHistogram(TH2 *h2) const
TEfficiency(const TH1 &passed, const TH1 &total)
Bool_t UsesPosteriorAverage() const
TEfficiency(const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Int_t nbinsy, const Double_t *ybins, Int_t nbinsz, const Double_t *zbins)
Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const
TDirectory * GetDirectory() const
TDirectory * fDirectory
! Pointer to directory holding this TEfficiency object
void SetUseWeightedEvents(Bool_t on=kTRUE)
TEfficiency & operator=(const TEfficiency &rhs)
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
Double_t fConfLevel
Confidence level (default = 0.683, 1 sigma).
void SetCentralInterval(Bool_t on=true)
TEfficiency(const TEfficiency &heff)
static TGraphAsymmErrors * Combine(TCollection *pList, Option_t *opt="", Int_t n=0, const Double_t *w=nullptr)
static Double_t ClopperPearson(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Double_t fBeta_beta
Global parameter for prior beta distribution (default = 1).
Double_t GetEfficiency(Int_t bin) const
Bool_t SetTotalHistogram(const TH1 &rTotal, Option_t *opt)
void Fill(Bool_t bPassed, Double_t x, Double_t y=0, Double_t z=0)
void SetDirectory(TDirectory *dir)
static Double_t BetaMean(Double_t alpha, Double_t beta)
static Bool_t CheckEntries(const TH1 &pass, const TH1 &total, Option_t *opt="")
TGraphAsymmErrors * fPaintGraph
! Temporary graph for painting
TEfficiency(const char *name, const char *title, Int_t nbins, const Double_t *xbins)
TGraphAsymmErrors * CreateGraph(Option_t *opt="") const
static Bool_t BetaShortestInterval(Double_t level, Double_t alpha, Double_t beta, Double_t &lower, Double_t &upper)
EStatOption GetStatisticOption() const
TGraphAsymmErrors * GetPaintedGraph() const
TList * fFunctions
->Pointer to list of functions
Bool_t SetTotalEvents(Int_t bin, Double_t events)
void SetBetaBinParameters(Int_t bin, Double_t alpha, Double_t beta)
Double_t GetWeight() const
void Add(const TEfficiency &rEff)
static Bool_t FeldmanCousinsInterval(Double_t total, Double_t passed, Double_t level, Double_t &lower, Double_t &upper)
TH1 * GetCopyTotalHisto() const
void SetConfidenceLevel(Double_t level)
Double_t GetEfficiencyErrorLow(Int_t bin) const
Bool_t UsesShortestInterval() const
EStatOption
Enumeration type for different statistic options for calculating confidence intervals kF* ....
@ kBJeffrey
Jeffrey interval (Prior ~ Beta(0.5,0.5).
@ kFWilson
Wilson interval.
@ kFAC
Agresti-Coull interval.
@ kMidP
Mid-P Lancaster interval.
@ kBUniform
Prior ~ Uniform = Beta(1,1).
@ kFFC
Feldman-Cousins interval.
@ kBBayesian
User specified Prior ~ Beta(fBeta_alpha,fBeta_beta).
@ kFNormal
Normal approximation.
@ kFCP
Clopper-Pearson interval (recommended by PDG).
static Bool_t CheckBinning(const TH1 &pass, const TH1 &total)
void SetTitle(const char *title) override
Set the title of the TNamed.
TFitResultPtr Fit(TF1 *f1, Option_t *opt="")
void RecursiveRemove(TObject *obj) override
Recursively remove this object from a list.
TH2 * fPaintHisto
! Temporary histogram for painting
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
TH1 is the base class of all histogram classes in ROOT.
Service class for 2-D histogram classes.
Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
TObject()
TObject constructor.