Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEfficiency Class Reference

Class to handle efficiency histograms.

I. Overview

This class handles the calculation of efficiencies and their uncertainties. It provides several statistical methods for calculating frequentist and Bayesian confidence intervals as well as a function for combining several efficiencies.

Efficiencies have a lot of applications and meanings but in principle, they can be described by the fraction of good/passed events k out of sample containing N events. One is usually interested in the dependency of the efficiency on other (binned) variables. The number of passed and total events is therefore stored internally in two histograms (TEfficiency::fTotalHistogram and TEfficiency::fPassedHistogram). Then the efficiency, as well as its upper and lower error, can be calculated for each bin individually.

As the efficiency can be regarded as a parameter of a binomial distribution, the number of passed and total events must always be integer numbers. Therefore a filling with weights is not possible. However, you can assign a global weight to each TEfficiency object (TEfficiency::SetWeight). It is necessary to create one TEfficiency object for each weight if you investigate a process involving different weights. This procedure needs more effort but enables you to re-use the filled object in cases where you want to change one or more weights. This would not be possible if all events with different weights were filled in the same histogram.

II. Creating a TEfficiency object

If you start a new analysis, it is highly recommended to use the TEfficiency class from the beginning. You can then use one of the constructors for fixed or variable bin size and your desired dimension. These constructors append the created TEfficiency object to the current directory if TH1::AddDirectoryStatus() is true. It will be written automatically to a file during the next TFile::Write command.

Example: create a two-dimensional TEfficiency object with

  • name = "eff"
  • title = "my efficiency"
  • axis titles: x, y and LaTeX-formatted epsilon as a label for Z axis
  • 10 bins with constant bin width (= 1) along X axis starting at 0 (lower edge from the first bin) up to 10 (upper edge of last bin)
  • 20 bins with constant bin width (= 0.5) along Y axis starting at -5 (lower edge from the first bin) up to 5 (upper edge of last bin)
      TEfficiency* pEff = new TEfficiency("eff","my efficiency;x;y;#epsilon",10,0,10,20,-5,5);
    
    If you already have two histograms filled with the number of passed and total events, you will use the constructor TEfficiency(const TH1& passed,const TH1& total) to construct the TEfficiency object. The histograms "passed" and "total" have to fulfill the conditions mentioned in TEfficiency::CheckConsistency, otherwise the construction will fail. As the histograms already exist, the new TEfficiency is by default not attached to the current directory to avoid duplication of data. If you want to store the new object anyway, you can either write it directly by calling TObject::Write or attach it to a directory using TEfficiency::SetDirectory. This also applies to TEfficiency objects created by the copy constructor TEfficiency::TEfficiency(const TEfficiency& rEff).

Example 1

TFile* pFile = new TFile("myfile.root","recreate");
//h_pass and h_total are valid and consistent histograms
{
// this will write the TEfficiency object to "myfile.root"
// AND pEff will be attached to the current directory if
// TH1::AddDirectoryStatus() is true.
pEff->Write();
}
Class to handle efficiency histograms.
Definition TEfficiency.h:29
TEfficiency()
Default constructor.
static Bool_t CheckConsistency(const TH1 &pass, const TH1 &total, Option_t *opt="")
Checks the consistence of the given histograms.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Definition TFile.h:130

Example 2

TFile* pFile = new TFile("myfile.root","recreate");
//h_pass and h_total are valid and consistent histograms
{
//this will attach the TEfficiency object to the current directory
pEff->SetDirectory(gDirectory);
//now all objects in gDirectory will be written to "myfile.root"
pFile->Write();
}
#define gDirectory
Definition TDirectory.h:385
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write memory objects to this file.
Definition TFile.cxx:2488

In case you already have two filled histograms and you only want to plot them as a graph, you should rather use TGraphAsymmErrors::TGraphAsymmErrors(const TH1* pass,const TH1* total,Option_t* opt) to create a graph object.

III. Filling with events

You can fill the TEfficiency object by calling the TEfficiency::Fill(Bool_t bPassed,Double_t x,Double_t y,Double_t z) method. The "bPassed" boolean flag indicates whether the current event is good (both histograms are filled) or not (only TEfficiency::fTotalHistogram is filled). The x, y and z variables determine the bin which is filled. For lower dimensions, the z- or even the y-value may be omitted.

{
//canvas only needed for this documentation
TCanvas* c1 = new TCanvas("example","",600,400);
c1->SetFillStyle(1001);
c1->SetFillColor(kWhite);
//create one-dimensional TEfficiency object with fixed bin size
TEfficiency* pEff = new TEfficiency("eff","my efficiency;x;#epsilon",20,0,10);
bool bPassed;
double x;
for(int i=0; i<10000; ++i)
{
//simulate events with variable under investigation
x = rand3.Uniform(10);
//check selection: bPassed = DoesEventPassSelection(x)
bPassed = rand3.Rndm() < TMath::Gaus(x,5,4);
pEff->Fill(bPassed,x);
}
pEff->Draw("AP");
}
@ kWhite
Definition Rtypes.h:66
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Canvas class.
Definition TCanvas.h:23
Random number generator class based on M.
Definition TRandom3.h:27
return c1
Definition legend1.C:41
Double_t x[n]
Definition legend1.C:17
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
Definition TMath.cxx:471

You can also set the number of passed or total events for a bin directly by using the TEfficiency::SetPassedEvents or TEfficiency::SetTotalEvents method.

IV. Statistic options

The calculation of the estimated efficiency depends on the chosen statistic option. Let k denotes the number of passed events and N the number of total events.

Frequentist methods

The expectation value of the number of passed events is given by the true efficiency times the total number of events. One can estimate the efficiency by replacing the expected number of passed events by the observed number of passed events.

\[ k = \epsilon \times N \Rightarrow \hat{\varepsilon} = \frac{k}{N} \]

Bayesian methods

In Bayesian statistics a likelihood-function (how probable is it to get the observed data assuming a true efficiency) and a prior probability (what is the probability that a certain true efficiency is actually realised) are used to determine a posterior probability by using Bayes theorem. At the moment, only beta distributions (with 2 free parameters) are supported as prior probabilities, as explained in D. Casadei, Estimating the selection efficiency, 2012 JINST 7 P08021, https://doi.org/10.1088/1748-0221/7/08/P08021 (https://arxiv.org/abs/0908.0130).

\begin{eqnarray*} P(\epsilon | k ; N) &=& \frac{1}{norm} \times P(k | \epsilon ; N) \times Prior(\epsilon) \\ P(k | \epsilon ; N) &=& Binomial(N,k) \times \epsilon^{k} \times (1 - \epsilon)^{N - k} ...\ binomial\ distribution \\ Prior(\epsilon) &=& \frac{1}{B(\alpha,\beta)} \times \epsilon ^{\alpha - 1} \times (1 - \epsilon)^{\beta - 1} \equiv Beta(\epsilon; \alpha,\beta) \\ \Rightarrow P(\epsilon | k ; N) &=& \frac{1}{norm'} \times \epsilon^{k + \alpha - 1} \times (1 - \epsilon)^{N - k + \beta - 1} \equiv Beta(\epsilon; k + \alpha, N - k + \beta) \end{eqnarray*}

By default the expectation value of this posterior distribution is used as an estimator for the efficiency:

\[ \hat{\varepsilon} = \frac{k + \alpha}{N + \alpha + \beta} \]

Optionally the mode can also be used as a value for the estimated efficiency. This can be done by calling SetBit(kPosteriorMode) or TEfficiency::SetPosteriorMode. In this case, the estimated efficiency is:

\[ \hat{\varepsilon} = \frac{k + \alpha -1}{N + \alpha + \beta - 2} \]

In the case of a uniform prior distribution, B(x,1,1), the posterior mode is k/n, equivalent to the frequentist estimate (the maximum likelihood value).

The statistic options also specify which confidence interval is used for calculating the uncertainties of the efficiency. The following properties define the error calculation:

In the following table, the implemented confidence intervals are listed with their corresponding statistic option. For more details on the calculation, please have a look at the mentioned functions.

name statistic option function kIsBayesian parameters
Clopper-Pearson kFCP TEfficiency::ClopperPearson false total events, passed events, confidence level
normal approximation kFNormal TEfficiency::Normal false total events, passed events, confidence level
Wilson kFWilson TEfficiency::Wilson false total events, passed events, confidence level
Agresti-Coull kFAC TEfficiency::AgrestiCoull false total events, passed events. confidence level
Feldman-Cousins kFFC TEfficiency::FeldmanCousins false total events, passed events, confidence level
Mid-P Lancaster kMidP TEfficiency::MidPInterval false total events, passed events, confidence level
Jeffrey kBJeffrey TEfficiency::Bayesian true total events, passed events, confidence level, fBeta_alpha = 0.5, fBeta_beta = 0.5
Uniform prior kBUniform TEfficiency::Bayesian true total events, passed events, confidence level, fBeta_alpha = 1, fBeta_beta = 1
custom prior kBBayesian TEfficiency::Bayesian true total events, passed events, confidence level, fBeta_alpha, fBeta_beta

The following example demonstrates the effect of different statistic options and confidence levels.

{
//canvas only needed for the documentation
TCanvas* c1 = new TCanvas("c1","",600,400);
c1->Divide(2);
c1->SetFillStyle(1001);
c1->SetFillColor(kWhite);
//create one-dimensional TEfficiency object with fixed bin size
TEfficiency* pEff = new TEfficiency("eff","different confidence levels;x;#epsilon",20,0,10);
bool bPassed;
double x;
for(int i=0; i<1000; ++i)
{
//simulate events with variable under investigation
x = rand3.Uniform(10);
//check selection: bPassed = DoesEventPassSelection(x)
bPassed = rand3.Rndm() < TMath::Gaus(x,5,4);
pEff->Fill(bPassed,x);
}
//set style attributes
pEff->SetFillStyle(3004);
pEff->SetFillColor(kRed);
//copy current TEfficiency object and set new confidence level
pCopy->SetConfidenceLevel(0.90);
//set style attributes
pCopy->SetFillStyle(3005);
pCopy->SetFillColor(kBlue);
c1->cd(1);
//add legend
TLegend* leg1 = new TLegend(0.3,0.1,0.7,0.5);
leg1->AddEntry(pEff,"68.3%","F");
leg1->AddEntry(pCopy,"90%","F");
pEff->Draw("A4");
pCopy->Draw("same4");
leg1->Draw("same");
//use same confidence level but different statistic methods
pEff2->SetStatisticOption(TEfficiency::kFNormal);
pCopy2->SetStatisticOption(TEfficiency::kFAC);
pEff2->SetTitle("different statistic options;x;#epsilon");
//set style attributes
pCopy2->SetFillStyle(3005);
pCopy2->SetFillColor(kBlue);
c1->cd(2);
//add legend
TLegend* leg2 = new TLegend(0.3,0.1,0.7,0.5);
leg2->AddEntry(pEff2,"kFNormal","F");
leg2->AddEntry(pCopy2,"kFAC","F");
pEff2->Draw("a4");
pCopy2->Draw("same4");
leg2->Draw("same");
}
@ kRed
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
@ kFAC
Agresti-Coull interval.
Definition TEfficiency.h:37
@ kFNormal
Normal approximation.
Definition TEfficiency.h:35
This class displays a legend box (TPaveText) containing several legend entries.
Definition TLegend.h:23

The prior probability of the efficiency in Bayesian statistics can be given in terms of a beta distribution. The beta distribution has two positive shape parameters. The resulting priors for different combinations of these shape parameters are shown in the plot below.

{
//canvas only needed for the documentation
TCanvas* c1 = new TCanvas("c1","",600,400);
c1->SetFillStyle(1001);
c1->SetFillColor(kWhite);
//create different beta distributions
TF1* f1 = new TF1("f1","TMath::BetaDist(x,1,1)",0,1);
TF1* f2 = new TF1("f2","TMath::BetaDist(x,0.5,0.5)",0,1);
TF1* f3 = new TF1("f3","TMath::BetaDist(x,1,5)",0,1);
f3->SetTitle("Beta distributions as priors;#epsilon;P(#epsilon)");
TF1* f4 = new TF1("f4","TMath::BetaDist(x,4,3)",0,1);
//add legend
TLegend* leg = new TLegend(0.25,0.5,0.85,0.89);
leg->SetFillColor(kWhite);
leg->SetFillStyle(1001);
leg->AddEntry(f1,"a=1, b=1","L");
leg->AddEntry(f2,"a=0.5, b=0.5","L");
leg->AddEntry(f3,"a=1, b=5","L");
leg->AddEntry(f4,"a=4, b=3","L");
f3->Draw();
f1->Draw("same");
f2->Draw("Same");
f4->Draw("same");
leg->Draw("same");
}
@ kGreen
Definition Rtypes.h:67
@ kViolet
Definition Rtypes.h:68
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:44
1-Dim function class
Definition TF1.h:182
void SetTitle(const char *title="") override
Set function title if title has the form "fffffff;xxxx;yyyy", it is assumed that the function title i...
Definition TF1.cxx:3613
void Draw(Option_t *option="") override
Draw this function with its current attributes.
Definition TF1.cxx:1340
TF1 * f1
Definition legend1.C:11
leg
Definition legend1.C:34

IV.1 Coverage probabilities for different methods

The following pictures illustrate the actual coverage probability for the different values of the true efficiency and the total number of events when a confidence level of 95% is desired.

Normal Approximation
Wilson
Agresti Coull
Clopper Pearson
Bayesian with Uniform Prior
Bayesian with Jeffrey Prior

The average (over all possible true efficiencies) coverage probability for different number of total events is shown in the next picture.

Average Coverage

V. Merging and combining TEfficiency objects

In many applications, the efficiency should be calculated for an inhomogeneous sample in the sense that it contains events with different weights. In order to be able to determine the correct overall efficiency, it is necessary to use for each subsample (= all events with the same weight) a different TEfficiency object. After finishing your analysis you can then construct the overall efficiency with its uncertainty.

This procedure has the advantage that you can change the weight of one subsample easily without rerunning the whole analysis. On the other hand, more effort is needed to handle several TEfficiency objects instead of one histogram. In the case of many different or even continuously distributed weights, this approach becomes cumbersome. One possibility to overcome this problem is the usage of binned weights.

Example

In particle physics weights arises from the fact that you want to normalise your results to a certain reference value. A very common formula for calculating weights is

\begin{eqnarray*} w &=& \frac{\sigma L}{N_{gen} \epsilon_{trig}} \\ &-& \sigma ...\ cross\ section \\ &-& L ...\ luminosity \\ &-& N_{gen}\ ... number\ of\ generated\ events \\ &-& \epsilon_{trig}\ ...\ (known)\ trigger\ efficiency \\ \end{eqnarray*}

The reason for different weights can therefore be:

  • different processes
  • other integrated luminosity
  • varying trigger efficiency
  • different sample sizes
  • ...
  • or even combination of them

Depending on the actual meaning of different weights in your case, you should either merge or combine them to get the overall efficiency.

V.1 When should I use merging?

If the weights are artificial and do not represent real alternative hypotheses, you should merge the different TEfficiency objects. That means especially for the Bayesian case that the prior probability should be the same for all merged TEfficiency objects. The merging can be done by invoking one of the following operations:

  • eff1.Add(eff2)
  • eff1 += eff2
  • eff1 = eff1 + eff2

The result of the merging is stored in the TEfficiency object which is marked bold above. The contents of the internal histograms of both TEfficiency objects are added and a new weight is assigned. The statistic options are not changed.

\[ \frac{1}{w_{new}} = \frac{1}{w_{1}} + \frac{1}{w_{2}} \]

Example:

If you use two samples with different numbers of generated events for the same process and you want to normalise both to the same integrated luminosity and trigger efficiency, the different weights then arise just from the fact that you have different numbers of events. The TEfficiency objects should be merged because the samples do not represent true alternatives. You expect the same result as if you would have a big sample with all events in it.

\[ w_{1} = \frac{\sigma L}{\epsilon N_{1}}, w_{2} = \frac{\sigma L}{\epsilon N_{2}} \Rightarrow w_{new} = \frac{\sigma L}{\epsilon (N_{1} + N_{2})} = \frac{1}{\frac{1}{w_{1}} + \frac{1}{w_{2}}} \]

V.2 When should I use combining?

You should combine TEfficiency objects whenever the weights represent alternatives processes for the efficiency. As the combination of two TEfficiency objects is not always consistent with the representation by two internal histograms, the result is not stored in a TEfficiency object but a TGraphAsymmErrors is returned which shows the estimated combined efficiency and its uncertainty for each bin. At the moment the combination method TEfficiency::Combine only supports a combination of 1-dimensional efficiencies in a Bayesian approach.

For calculating the combined efficiency and its uncertainty for each bin only Bayesian statistics is used. No frequentists methods are presently supported for computing the combined efficiency and its confidence interval. In the case of the Bayesian statistics, a combined posterior is constructed taking into account the weight of each TEfficiency object. The same prior is used for all the TEfficiency objects.

\begin{eqnarray*} P_{comb}(\epsilon | {w_{i}}, {k_{i}} , {N_{i}}) = \frac{1}{norm} \prod_{i}{L(k_{i} | N_{i}, \epsilon)}^{w_{i}} \Pi( \epsilon )\\ L(k_{i} | N_{i}, \epsilon)\ is\ the\ likelihood\ function\ for\ the\ sample\ i\ (a\ Binomial\ distribution)\\ \Pi( \epsilon)\ is\ the\ prior,\ a\ beta\ distribution\ B(\epsilon, \alpha, \beta).\\ The\ resulting\ combined\ posterior\ is \\ P_{comb}(\epsilon |{w_{i}}; {k_{i}}; {N_{i}}) = B(\epsilon, \sum_{i}{ w_{i} k_{i}} + \alpha, \sum_{i}{ w_{i}(n_{i}-k_{i})}+\beta) \\ \hat{\varepsilon} = \int_{0}^{1} \epsilon \times P_{comb}(\epsilon | {k_{i}} , {N_{i}}) d\epsilon \\ confidence\ level = 1 - \alpha \\ \frac{\alpha}{2} = \int_{0}^{\epsilon_{low}} P_{comb}(\epsilon | {k_{i}} , {N_{i}}) d\epsilon ...\ defines\ lower\ boundary \\ 1- \frac{\alpha}{2} = \int_{0}^{\epsilon_{up}} P_{comb}(\epsilon | {k_{i}} , {N_{i}}) d\epsilon ...\ defines\ upper\ boundary \end{eqnarray*}

Example:

If you use cuts to select electrons which can originate from two different processes, you can determine the selection efficiency for each process. The overall selection efficiency is then the combined efficiency. The weights to be used in the combination should be the probability that an electron comes from the corresponding process.

\[ p_{1} = \frac{\sigma_{1}}{\sigma_{1} + \sigma_{2}} = \frac{N_{1}w_{1}}{N_{1}w_{1} + N_{2}w_{2}}\\ p_{2} = \frac{\sigma_{2}}{\sigma_{1} + \sigma_{2}} = \frac{N_{2}w_{2}}{N_{1}w_{1} + N_{2}w_{2}} \]

VI. Further operations

VI.1 Information about the internal histograms

The methods TEfficiency::GetPassedHistogram and TEfficiency::GetTotalHistogram return a constant pointer to the internal histograms. They can be used to obtain information about the internal histograms (e.g., the binning, number of passed / total events in a bin, mean values...). One can obtain a clone of the internal histograms by calling TEfficiency::GetCopyPassedHisto or TEfficiency::GetCopyTotalHisto. The returned histograms are completely independent from the current TEfficiency object. By default, they are not attached to a directory to avoid the duplication of data and the user is responsible for deleting them.

//open a root file which contains a TEfficiency object
TFile* pFile = new TFile("myfile.root","update");
//get TEfficiency object with name "my_eff"
TEfficiency* pEff = (TEfficiency*)pFile->Get("my_eff");
//get clone of total histogram
TH1* clone = pEff->GetCopyTotalHisto();
//change clone...
//save changes of clone directly
clone->Write();
//or append it to the current directory and write the file
//clone->SetDirectory(gDirectory);
//pFile->Write();
//delete histogram object
delete clone;
clone = 0;
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:109
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition TObject.cxx:989

It is also possible to set the internal total or passed histogram by using the methods TEfficiency::SetPassedHistogram or TEfficiency::SetTotalHistogram.

In order to ensure the validity of the TEfficiency object, the consistency of the new histogram and the stored histogram is checked. It might be impossible sometimes to change the histograms in a consistent way. Therefore one can force the replacement by passing the "f" option. Then the user has to ensure that the other internal histogram is replaced as well and that the TEfficiency object is in a valid state.

VI.2 Fitting

The efficiency can be fitted using the TEfficiency::Fit function which internally uses the TBinomialEfficiencyFitter::Fit method. As this method is using a maximum-likelihood-fit, it is necessary to initialise the given fit function with reasonable start values. The resulting fit function is attached to the list of associated functions and will be drawn automatically during the next TEfficiency::Draw command. The list of associated function can be modified by using the pointer returned by TEfficiency::GetListOfFunctions.

{
//canvas only needed for this documentation
TCanvas* c1 = new TCanvas("example","",600,400);
c1->SetFillStyle(1001);
c1->SetFillColor(kWhite);
//create one-dimensional TEfficiency object with fixed bin size
TEfficiency* pEff = new TEfficiency("eff","my efficiency;x;#epsilon",20,0,10);
bool bPassed;
double x;
for (int i=0; i<10000; ++i) {
//simulate events with variable under investigation
x = rand3.Uniform(10);
//check selection: bPassed = DoesEventPassSelection(x)
bPassed = rand3.Rndm() < TMath::Gaus(x,5,4);
pEff->Fill(bPassed,x);
}
//create a function for fitting and do the fit
TF1* f1 = new TF1("f1","gaus",0,10);
f1->SetParameters(1,5,2);
pEff->Fit(f1);
//create a threshold function
TF1* f2 = new TF1("thres","0.8",0,10);
//add it to the list of functions
//use add first because the parameters of the last function will be displayed
pEff->GetListOfFunctions()->AddFirst(f2);
pEff->Draw("AP");
}
virtual void SetParameters(const Double_t *params)
Definition TF1.h:618

VI.3 Draw a TEfficiency object

A TEfficiency object can be drawn by calling the usual TEfficiency::Draw method. At the moment drawing is only supported for 1- and 2-dimensional TEfficiency objects. In the 1-dimensional case, you can use the same options as for the TGraphAsymmErrors::Draw method. For 2-dimensional TEfficiency objects, you can pass the same options as for a TH2::Draw object.

VI.4 TEfficiency object's axis customisation

The axes of a TEfficiency object can be accessed and customised by calling the GetPaintedGraph method and then GetXaxis() or GetYaxis() and the corresponding TAxis methods. Note that in order to access the painted graph via GetPaintedGraph(), one should either call Paint or, better, gPad->Update().

{
//canvas only needed for this documentation
TCanvas* c1 = new TCanvas("example","",600,400);
c1->SetFillStyle(1001);
c1->SetFillColor(kWhite);
c1->Divide(2,1);
//create one-dimensional TEfficiency object with fixed bin size
TEfficiency* pEff = new TEfficiency("eff","my efficiency;x;#epsilon",20,0,10);
bool bPassed;
double x;
for(int i=0; i<10000; ++i)
{
//simulate events with variable under investigation
x = rand3.Uniform(10);
//check selection: bPassed = DoesEventPassSelection(x)
bPassed = rand3.Rndm() < TMath::Gaus(x,5,4);
pEff->Fill(bPassed,x);
}
c1->cd(1);
pEff->Draw("AP");
c1->cd(2);
pEff->Draw("AP");
gPad->Update();
pEff->GetPaintedGraph()->GetXaxis()->SetTitleSize(0.05);
pEff->GetPaintedGraph()->GetXaxis()->SetLabelFont(42);
pEff->GetPaintedGraph()->GetXaxis()->SetLabelSize(0.05);
pEff->GetPaintedGraph()->GetYaxis()->SetTitleOffset(0.85);
pEff->GetPaintedGraph()->GetYaxis()->SetTitleSize(0.05);
pEff->GetPaintedGraph()->GetYaxis()->SetLabelFont(42);
pEff->GetPaintedGraph()->GetYaxis()->SetLabelSize(0.05);
pEff->GetPaintedGraph()->GetXaxis()->SetRangeUser(3,7);
}
#define gPad

Definition at line 28 of file TEfficiency.h.

Public Types

enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatOption {
  kFCP = 0 , kFNormal , kFWilson , kFAC ,
  kFFC , kBJeffrey , kBUniform , kBBayesian ,
  kMidP
}
 Enumeration type for different statistic options for calculating confidence intervals kF* ... frequentist methods; kB* ... bayesian methods. More...
 

Public Member Functions

 TEfficiency ()
 Default constructor.
 
 TEfficiency (const char *name, const char *title, Int_t nbins, const Double_t *xbins)
 Create 1-dimensional TEfficiency object with variable bin size.
 
 TEfficiency (const char *name, const char *title, Int_t nbins, Double_t xlow, Double_t xup)
 Create 1-dimensional TEfficiency object with fixed bins size.
 
 TEfficiency (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Int_t nbinsy, const Double_t *ybins)
 Create 2-dimensional TEfficiency object with variable bin size.
 
 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)
 Create 3-dimensional TEfficiency object with variable bin size.
 
 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)
 Create 2-dimensional TEfficiency object with fixed bin size.
 
 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)
 Create 3-dimensional TEfficiency object with fixed bin size.
 
 TEfficiency (const TEfficiency &heff)
 Copy constructor.
 
 TEfficiency (const TH1 &passed, const TH1 &total)
 Constructor using two existing histograms as input.
 
 ~TEfficiency () override
 default destructor
 
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
 
void Add (const TEfficiency &rEff)
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
void Browse (TBrowser *) override
 Browse object. May be overridden for another default action.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
void Clear (Option_t *option="") override
 Set name and title to empty strings ("").
 
TObjectClone (const char *newname="") const override
 Make a clone of an object using the Streamer facility.
 
Int_t Compare (const TObject *obj) const override
 Compare two TNamed objects.
 
void Copy (TAttFill &attfill) const
 Copy this fill attributes to a new TAttFill.
 
void Copy (TAttLine &attline) const
 Copy this line attributes to a new TAttLine.
 
void Copy (TAttMarker &attmarker) const
 Copy this marker attributes to a new TAttMarker.
 
void Copy (TObject &named) const override
 Copy this to obj.
 
TGraphAsymmErrorsCreateGraph (Option_t *opt="") const
 Create the graph used be painted (for dim=1 TEfficiency) The return object is managed by the caller.
 
TGraph2DAsymmErrorsCreateGraph2D (Option_t *opt="") const
 Create the graph used be painted (for dim=1 TEfficiency) The return object is managed by the caller.
 
TH2CreateHistogram (Option_t *opt="") const
 Create the histogram used to be painted (for dim=2 TEfficiency) The return object is managed by the caller.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
 Compute distance from point px,py to a line.
 
Int_t DistancetoPrimitive (Int_t px, Int_t py) override
 Compute distance from point px,py to a graph.
 
void Draw (Option_t *opt="") override
 Draws the current TEfficiency object.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
void ExecuteEvent (Int_t event, Int_t px, Int_t py) override
 Execute action corresponding to one event.
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
void Fill (Bool_t bPassed, Double_t x, Double_t y=0, Double_t z=0)
 This function is used for filling the two histograms.
 
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer.
 
void FillWeighted (Bool_t bPassed, Double_t weight, Double_t x, Double_t y=0, Double_t z=0)
 This function is used for filling the two histograms with a weight.
 
Int_t FindFixBin (Double_t x, Double_t y=0, Double_t z=0) const
 Returns the global bin number containing the given values.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
TFitResultPtr Fit (TF1 *f1, Option_t *opt="")
 Fits the efficiency using the TBinomialEfficiencyFitter class.
 
Double_t GetBetaAlpha (Int_t bin=-1) const
 
Double_t GetBetaBeta (Int_t bin=-1) const
 
Double_t GetConfidenceLevel () const
 
TH1GetCopyPassedHisto () const
 Returns a cloned version of fPassedHistogram.
 
TH1GetCopyTotalHisto () const
 Returns a cloned version of fTotalHistogram.
 
Int_t GetDimension () const
 returns the dimension of the current TEfficiency object
 
TDirectoryGetDirectory () const
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
Double_t GetEfficiency (Int_t bin) const
 Returns the efficiency in the given global bin.
 
Double_t GetEfficiencyErrorLow (Int_t bin) const
 Returns the lower error on the efficiency in the given global bin.
 
Double_t GetEfficiencyErrorUp (Int_t bin) const
 Returns the upper error on the efficiency in the given global bin.
 
virtual Color_t GetFillColor () const
 Return the fill area color.
 
virtual Style_t GetFillStyle () const
 Return the fill area style.
 
Int_t GetGlobalBin (Int_t binx, Int_t biny=0, Int_t binz=0) const
 Returns the global bin number which can be used as argument for the following functions:
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
virtual Color_t GetLineColor () const
 Return the line color.
 
virtual Style_t GetLineStyle () const
 Return the line style.
 
virtual Width_t GetLineWidth () const
 Return the line width.
 
TListGetListOfFunctions ()
 
virtual Color_t GetMarkerColor () const
 Return the marker color.
 
virtual Size_t GetMarkerSize () const
 Return the marker size.
 
virtual Style_t GetMarkerStyle () const
 Return the marker style.
 
const char * GetName () const override
 Returns name of object.
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
TGraphAsymmErrorsGetPaintedGraph () const
 
TGraph2DAsymmErrorsGetPaintedGraph2D () const
 
TH2GetPaintedHistogram () const
 
const TH1GetPassedHistogram () const
 
EStatOption GetStatisticOption () const
 
const char * GetTitle () const override
 Returns title of object.
 
const TH1GetTotalHistogram () const
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
Double_t GetWeight () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
ULong_t Hash () const override
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
TClassIsA () const override
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
Bool_t IsSortable () const override
 
virtual Bool_t IsTransparent () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
void ls (Option_t *option="") const override
 List TNamed name and title.
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
Long64_t Merge (TCollection *list)
 Merges the TEfficiency objects in the given list to the given TEfficiency object using the operator+=(TEfficiency&)
 
virtual void Modify ()
 Change current fill area attributes if necessary.
 
virtual void Modify ()
 Change current line attributes if necessary.
 
virtual void Modify ()
 Change current marker attributes if necessary.
 
virtual void ModifyOn (TVirtualPad &pad)
 Change current fill area attributes on speicifed pad.
 
virtual void ModifyOn (TVirtualPad &pad)
 Change current line attributes on specified pad.
 
virtual void ModifyOn (TVirtualPad &pad)
 Change current marker attributes if necessary on specified pad.
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
 
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TEfficiencyoperator+= (const TEfficiency &rhs)
 Adds the histograms of another TEfficiency object to current histograms.
 
TEfficiencyoperator= (const TEfficiency &rhs)
 Assignment operator.
 
void Paint (Option_t *opt) override
 Paints this TEfficiency object.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
void Print (Option_t *option="") const override
 Print TNamed name and title.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
void RecursiveRemove (TObject *obj) override
 Recursively remove object from the list of functions.
 
virtual void ResetAttFill (Option_t *option="")
 Reset this fill attributes to default values.
 
virtual void ResetAttLine (Option_t *option="")
 Reset this line attributes to default values.
 
virtual void ResetAttMarker (Option_t *toption="")
 Reset this marker attributes to the default values.
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
virtual void SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
 Save fill attributes as C++ statement(s) on output stream out.
 
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
 Save line attributes as C++ statement(s) on output stream out.
 
virtual void SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
 Save line attributes as C++ statement(s) on output stream out.
 
void SavePrimitive (std::ostream &out, Option_t *opt="") override
 Save primitive as a C++ statement(s) on output stream out.
 
void SetBetaAlpha (Double_t alpha)
 Sets the shape parameter α.
 
void SetBetaBeta (Double_t beta)
 Sets the shape parameter β.
 
void SetBetaBinParameters (Int_t bin, Double_t alpha, Double_t beta)
 Sets different shape parameter α and β for the prior distribution for each bin.
 
Bool_t SetBins (Int_t nx, const Double_t *xBins)
 Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.
 
Bool_t SetBins (Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins)
 Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.
 
Bool_t SetBins (Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins, Int_t nz, const Double_t *zBins)
 Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.
 
Bool_t SetBins (Int_t nx, Double_t xmin, Double_t xmax)
 Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.
 
Bool_t SetBins (Int_t nx, Double_t xmin, Double_t xmax, Int_t ny, Double_t ymin, Double_t ymax)
 Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.
 
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)
 Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
void SetCentralInterval (Bool_t on=true)
 
void SetConfidenceLevel (Double_t level)
 Sets the confidence level (0 < level < 1) The default value is 1-sigma :~ 0.683.
 
void SetDirectory (TDirectory *dir)
 Sets the directory holding this TEfficiency object.
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
virtual void SetFillAttributes ()
 Invoke the DialogCanvas Fill attributes.
 
virtual void SetFillColor (Color_t fcolor)
 Set the fill area color.
 
void SetFillColor (TColorNumber)
 Set a fill color.
 
virtual void SetFillColorAlpha (Color_t fcolor, Float_t falpha)
 Set a transparent fill color.
 
virtual void SetFillStyle (Style_t fstyle)
 Set the fill area style.
 
virtual void SetLineAttributes ()
 Invoke the DialogCanvas Line attributes.
 
virtual void SetLineColor (Color_t lcolor)
 Set the line color.
 
void SetLineColor (TColorNumber lcolor)
 
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
 Set a transparent line color.
 
virtual void SetLineStyle (Style_t lstyle)
 Set the line style.
 
virtual void SetLineWidth (Width_t lwidth)
 Set the line width.
 
virtual void SetMarkerAttributes ()
 Invoke the DialogCanvas Marker attributes.
 
virtual void SetMarkerColor (Color_t mcolor=1)
 Set the marker color.
 
void SetMarkerColor (TColorNumber lcolor)
 
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
 Set a transparent marker color.
 
virtual void SetMarkerSize (Size_t msize=1)
 Set the marker size.
 
virtual void SetMarkerStyle (Style_t mstyle=1)
 Set the marker style.
 
void SetName (const char *name) override
 Sets the name.
 
virtual void SetNameTitle (const char *name, const char *title)
 Set all the TNamed parameters (name and title).
 
Bool_t SetPassedEvents (Int_t bin, Double_t events)
 Sets the number of passed events in the given global bin.
 
Bool_t SetPassedHistogram (const TH1 &rPassed, Option_t *opt)
 Sets the histogram containing the passed events.
 
void SetPosteriorAverage (Bool_t on=true)
 
void SetPosteriorMode (Bool_t on=true)
 
void SetShortestInterval (Bool_t on=true)
 
void SetStatisticOption (EStatOption option)
 Sets the statistic option which affects the calculation of the confidence interval.
 
void SetTitle (const char *title) override
 Sets the title.
 
Bool_t SetTotalEvents (Int_t bin, Double_t events)
 Sets the number of total events in the given global bin.
 
Bool_t SetTotalHistogram (const TH1 &rTotal, Option_t *opt)
 Sets the histogram containing all events.
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
void SetUseWeightedEvents (Bool_t on=kTRUE)
 
void SetWeight (Double_t weight)
 Sets the global weight for this TEfficiency object.
 
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject.
 
void Streamer (TBuffer &) override
 Stream an object of class TObject.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
Bool_t UsesBayesianStat () const
 
Bool_t UsesCentralInterval () const
 
Bool_t UsesPosteriorAverage () const
 
Bool_t UsesPosteriorMode () const
 
Bool_t UsesShortestInterval () const
 
Bool_t UsesWeights () const
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

static Double_t AgrestiCoull (Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
 Calculates the boundaries for the frequentist Agresti-Coull interval.
 
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)
 Calculates the boundaries for a Bayesian confidence interval (shortest or central interval depending on the option) as explained in D.
 
static Double_t BetaCentralInterval (Double_t level, Double_t alpha, Double_t beta, Bool_t bUpper)
 Calculates the boundaries for a central confidence interval for a Beta distribution.
 
static Double_t BetaMean (Double_t alpha, Double_t beta)
 Compute the mean (average) of the beta distribution.
 
static Double_t BetaMode (Double_t alpha, Double_t beta)
 Compute the mode of the beta distribution.
 
static Bool_t BetaShortestInterval (Double_t level, Double_t alpha, Double_t beta, Double_t &lower, Double_t &upper)
 Calculates the boundaries for a shortest confidence interval for a Beta distribution.
 
static Bool_t CheckBinning (const TH1 &pass, const TH1 &total)
 Checks binning for each axis.
 
static Bool_t CheckConsistency (const TH1 &pass, const TH1 &total, Option_t *opt="")
 Checks the consistence of the given histograms.
 
static Bool_t CheckEntries (const TH1 &pass, const TH1 &total, Option_t *opt="")
 Checks whether bin contents are compatible with binomial statistics.
 
static Bool_t CheckWeights (const TH1 &pass, const TH1 &total)
 Check if both histogram are weighted.
 
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static Double_t ClopperPearson (Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
 Calculates the boundaries for the frequentist Clopper-Pearson interval.
 
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="")
 
static TGraphAsymmErrorsCombine (TCollection *pList, Option_t *opt="", Int_t n=0, const Double_t *w=nullptr)
 Combines a list of 1-dimensional TEfficiency objects.
 
static const char * DeclFileName ()
 
static Double_t FeldmanCousins (Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
 Calculates the boundaries for the frequentist Feldman-Cousins interval.
 
static Bool_t FeldmanCousinsInterval (Double_t total, Double_t passed, Double_t level, Double_t &lower, Double_t &upper)
 Calculates the interval boundaries using the frequentist methods of Feldman-Cousins.
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Width_t GetMarkerLineWidth (Style_t style)
 Internal helper function that returns the line width of the given marker style (0 = filled marker)
 
static Style_t GetMarkerStyleBase (Style_t style)
 Internal helper function that returns the corresponding marker style with line width 1 for the given style.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static Double_t MidPInterval (Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
 Calculates the boundaries using the mid-P binomial interval (Lancaster method) from B.
 
static Double_t Normal (Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
 Returns the confidence limits for the efficiency supposing that the efficiency follows a normal distribution with the rms below.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 
static Double_t Wilson (Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
 Calculates the boundaries for the frequentist Wilson interval.
 

Protected Types

enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kIsBayesian = (1ULL << ( 14 )) , kPosteriorMode = (1ULL << ( 15 )) , kShortestInterval = (1ULL << ( 16 )) , kUseBinPrior = (1ULL << ( 17 )) ,
  kUseWeights = (1ULL << ( 18 ))
}
 

Protected Member Functions

void Build (const char *name, const char *title)
 Building standard data structure of a TEfficiency object.
 
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void FillGraph (TGraphAsymmErrors *graph, Option_t *opt) const
 Fill the graph to be painted with information from TEfficiency Internal method called by TEfficiency::Paint or TEfficiency::CreateGraph.
 
void FillGraph2D (TGraph2DAsymmErrors *graph, Option_t *opt) const
 Fill the graph to be painted with information from TEfficiency Internal method called by TEfficiency::Paint or TEfficiency::CreateGraph.
 
void FillHistogram (TH2 *h2) const
 Fill the 2d histogram to be painted with information from TEfficiency 2D Internal method called by TEfficiency::Paint or TEfficiency::CreatePaintingGraph.
 
void MakeZombie ()
 
void SavePrimitiveNameTitle (std::ostream &out, const char *variable_name)
 Save object name and title into the output stream "out".
 

Static Protected Member Functions

static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
 
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
 
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.
 

Protected Attributes

Double_t fBeta_alpha
 Global parameter for prior beta distribution (default = 1)
 
Double_t fBeta_beta
 Global parameter for prior beta distribution (default = 1)
 
std::vector< std::pair< Double_t, Double_t > > fBeta_bin_params
 Parameter for prior beta distribution different bin by bin (default vector is empty)
 
Double_t(* fBoundary )(Double_t, Double_t, Double_t, Bool_t)
 ! Pointer to a method calculating the boundaries of confidence intervals
 
Double_t fConfLevel
 Confidence level (default = 0.683, 1 sigma)
 
TDirectoryfDirectory
 ! Pointer to directory holding this TEfficiency object
 
Color_t fFillColor
 Fill area color.
 
Style_t fFillStyle
 Fill area style.
 
TListfFunctions
 ->Pointer to list of functions
 
Color_t fLineColor
 Line color.
 
Style_t fLineStyle
 Line style.
 
Width_t fLineWidth
 Line width.
 
Color_t fMarkerColor
 Marker color.
 
Size_t fMarkerSize
 Marker size.
 
Style_t fMarkerStyle
 Marker style.
 
TString fName
 
TGraphAsymmErrorsfPaintGraph =nullptr
 ! Temporary graph for painting
 
TGraph2DAsymmErrorsfPaintGraph2D =nullptr
 ! Temporary graph for painting
 
TH2fPaintHisto =nullptr
 ! Temporary histogram for painting
 
TH1fPassedHistogram
 Histogram for events which passed certain criteria.
 
EStatOption fStatisticOption
 Defines how the confidence intervals are determined.
 
TString fTitle
 
TH1fTotalHistogram
 Histogram for total number of events.
 
Double_t fWeight
 Weight for all events (default = 1)
 

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.
 

Private Attributes

UInt_t fBits
 bit field status word
 
UInt_t fUniqueID
 object unique identifier
 

Static Private Attributes

static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
 
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable
 

#include <TEfficiency.h>

Inheritance diagram for TEfficiency:
TNamed TAttLine TAttFill TAttMarker TObject

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ EStatOption

Enumeration type for different statistic options for calculating confidence intervals kF* ... frequentist methods; kB* ... bayesian methods.

Enumerator
kFCP 

Clopper-Pearson interval (recommended by PDG)

kFNormal 

Normal approximation.

kFWilson 

Wilson interval.

kFAC 

Agresti-Coull interval.

kFFC 

Feldman-Cousins interval.

kBJeffrey 

Jeffrey interval (Prior ~ Beta(0.5,0.5)

kBUniform 

Prior ~ Uniform = Beta(1,1)

kBBayesian 

User specified Prior ~ Beta(fBeta_alpha,fBeta_beta)

kMidP 

Mid-P Lancaster interval.

Definition at line 33 of file TEfficiency.h.

◆ EStatusBits

Enumerator
kIsBayesian 

Bayesian statistics are used.

kPosteriorMode 

Use posterior mean for best estimate (Bayesian statistics)

kShortestInterval 

Use shortest interval.

kUseBinPrior 

Use a different prior for each bin.

kUseWeights 

Use weights.

Definition at line 63 of file TEfficiency.h.

Constructor & Destructor Documentation

◆ TEfficiency() [1/9]

TEfficiency::TEfficiency ( )

Default constructor.

Should not be used explicitly

Definition at line 694 of file TEfficiency.cxx.

◆ TEfficiency() [2/9]

TEfficiency::TEfficiency ( const TH1 & passed,
const TH1 & total )

Constructor using two existing histograms as input.

Input: passed - contains the events fulfilling some criteria total - contains all investigated events

Notes: - both histograms have to fulfill the conditions of CheckConsistency

  • dimension of the resulting efficiency object depends on the dimension of the given histograms
  • Clones of both histograms are stored internally
  • The function SetName(total.GetName() + "_clone") is called to set the names of the new object and the internal histograms..
  • The created TEfficiency object is NOT appended to a directory. It will not be written to disk during the next TFile::Write() command in order to prevent duplication of data. If you want to save this TEfficiency object anyway, you can either append it to a directory by calling SetDirectory(TDirectory*) or write it explicitly to disk by calling Write().

Definition at line 733 of file TEfficiency.cxx.

◆ TEfficiency() [3/9]

TEfficiency::TEfficiency ( const char * name,
const char * title,
Int_t nbins,
const Double_t * xbins )

Create 1-dimensional TEfficiency object with variable bin size.

Constructor creates two new and empty histograms with a given binning

Input:

  • name: the common part of the name for both histograms (no blanks) fTotalHistogram has name: name + "_total" fPassedHistogram has name: name + "_passed"
  • title: the common part of the title for both histogram fTotalHistogram has title: title + " (total)" fPassedHistogram has title: title + " (passed)" It is possible to label the axis by passing a title with the following format: "title;xlabel;ylabel".
  • nbins: number of bins on the x-axis
  • xbins: array of length (nbins + 1) with low-edges for each bin xbins[nbinsx] ... lower edge for overflow bin

Definition at line 799 of file TEfficiency.cxx.

◆ TEfficiency() [4/9]

TEfficiency::TEfficiency ( const char * name,
const char * title,
Int_t nbinsx,
Double_t xlow,
Double_t xup )

Create 1-dimensional TEfficiency object with fixed bins size.

Constructor creates two new and empty histograms with a fixed binning.

Input:

  • name: the common part of the name for both histograms(no blanks) fTotalHistogram has name: name + "_total" fPassedHistogram has name: name + "_passed"
  • title: the common part of the title for both histogram fTotalHistogram has title: title + " (total)" fPassedHistogram has title: title + " (passed)" It is possible to label the axis by passing a title with the following format: "title;xlabel;ylabel".
  • nbinsx: number of bins on the x-axis
  • xlow: lower edge of first bin
  • xup: upper edge of last bin

Definition at line 840 of file TEfficiency.cxx.

◆ TEfficiency() [5/9]

TEfficiency::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 )

Create 2-dimensional TEfficiency object with fixed bin size.

Constructor creates two new and empty histograms with a fixed binning.

Input:

  • name: the common part of the name for both histograms(no blanks) fTotalHistogram has name: name + "_total" fPassedHistogram has name: name + "_passed"
  • title: the common part of the title for both histogram fTotalHistogram has title: title + " (total)" fPassedHistogram has title: title + " (passed)" It is possible to label the axis by passing a title with the following format: "title;xlabel;ylabel;zlabel".
  • nbinsx: number of bins on the x-axis
  • xlow: lower edge of first x-bin
  • xup: upper edge of last x-bin
  • nbinsy: number of bins on the y-axis
  • ylow: lower edge of first y-bin
  • yup: upper edge of last y-bin

Definition at line 882 of file TEfficiency.cxx.

◆ TEfficiency() [6/9]

TEfficiency::TEfficiency ( const char * name,
const char * title,
Int_t nbinsx,
const Double_t * xbins,
Int_t nbinsy,
const Double_t * ybins )

Create 2-dimensional TEfficiency object with variable bin size.

Constructor creates two new and empty histograms with a given binning.

Input:

  • name: the common part of the name for both histograms(no blanks) fTotalHistogram has name: name + "_total" fPassedHistogram has name: name + "_passed"
  • title: the common part of the title for both histogram fTotalHistogram has title: title + " (total)" fPassedHistogram has title: title + " (passed)" It is possible to label the axis by passing a title with the following format: "title;xlabel;ylabel;zlabel".
  • nbinsx: number of bins on the x-axis
  • xbins: array of length (nbins + 1) with low-edges for each bin xbins[nbinsx] ... lower edge for overflow x-bin
  • nbinsy: number of bins on the y-axis
  • ybins: array of length (nbins + 1) with low-edges for each bin ybins[nbinsy] ... lower edge for overflow y-bin

Definition at line 925 of file TEfficiency.cxx.

◆ TEfficiency() [7/9]

TEfficiency::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 )

Create 3-dimensional TEfficiency object with fixed bin size.

Constructor creates two new and empty histograms with a fixed binning.

Input:

  • name: the common part of the name for both histograms(no blanks) fTotalHistogram has name: name + "_total" fPassedHistogram has name: name + "_passed"
  • title: the common part of the title for both histogram fTotalHistogram has title: title + " (total)" fPassedHistogram has title: title + " (passed)" It is possible to label the axis by passing a title with the following format: "title;xlabel;ylabel;zlabel".
  • nbinsx: number of bins on the x-axis
  • xlow: lower edge of first x-bin
  • xup: upper edge of last x-bin
  • nbinsy: number of bins on the y-axis
  • ylow: lower edge of first y-bin
  • yup: upper edge of last y-bin
  • nbinsz: number of bins on the z-axis
  • zlow: lower edge of first z-bin
  • zup: upper edge of last z-bin

Definition at line 971 of file TEfficiency.cxx.

◆ TEfficiency() [8/9]

TEfficiency::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 )

Create 3-dimensional TEfficiency object with variable bin size.

Constructor creates two new and empty histograms with a given binning.

Input:

  • name: the common part of the name for both histograms(no blanks) fTotalHistogram has name: name + "_total" fPassedHistogram has name: name + "_passed"
  • title: the common part of the title for both histogram fTotalHistogram has title: title + " (total)" fPassedHistogram has title: title + " (passed)" It is possible to label the axis by passing a title with the following format: "title;xlabel;ylabel;zlabel".
  • nbinsx: number of bins on the x-axis
  • xbins: array of length (nbins + 1) with low-edges for each bin xbins[nbinsx] ... lower edge for overflow x-bin
  • nbinsy: number of bins on the y-axis
  • ybins: array of length (nbins + 1) with low-edges for each bin xbins[nbinsx] ... lower edge for overflow y-bin
  • nbinsz: number of bins on the z-axis
  • zbins: array of length (nbins + 1) with low-edges for each bin xbins[nbinsx] ... lower edge for overflow z-bin

Definition at line 1018 of file TEfficiency.cxx.

◆ TEfficiency() [9/9]

TEfficiency::TEfficiency ( const TEfficiency & rEff)

Copy constructor.

The list of associated objects (e.g. fitted functions) is not copied.

Note:

  • SetName(rEff.GetName() + "_copy") is called to set the names of the object and the histograms.
  • The titles are set by calling SetTitle("[copy] " + rEff.GetTitle()).
  • The copied TEfficiency object is NOT appended to a directory. It will not be written to disk during the next TFile::Write() command in order to prevent duplication of data. If you want to save this TEfficiency object anyway, you can either append it to a directory by calling SetDirectory(TDirectory*) or write it explicitly to disk by calling Write().

Definition at line 1057 of file TEfficiency.cxx.

◆ ~TEfficiency()

TEfficiency::~TEfficiency ( )
override

default destructor

Definition at line 1102 of file TEfficiency.cxx.

Member Function Documentation

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ Add()

void TEfficiency::Add ( const TEfficiency & rEff)
inline

Definition at line 97 of file TEfficiency.h.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AgrestiCoull()

Double_t TEfficiency::AgrestiCoull ( Double_t total,
Double_t passed,
Double_t level,
Bool_t bUpper )
static

Calculates the boundaries for the frequentist Agresti-Coull interval.

Parameters
totalnumber of total events
passed0 <= number of passed events <= total
levelconfidence level
bUppertrue - upper boundary is returned false - lower boundary is returned

\begin{eqnarray*} \alpha &=& 1 - \frac{level}{2} \\ \kappa &=& \Phi^{-1}(1 - \alpha,1)\ ... normal\ quantile\ function\\ mode &=& \frac{passed + \frac{\kappa^{2}}{2}}{total + \kappa^{2}}\\ \Delta &=& \kappa * \sqrt{\frac{mode * (1 - mode)}{total + \kappa^{2}}}\\ return &=& max(0,mode - \Delta)\ or\ min(1,mode + \Delta) \end{eqnarray*}

Definition at line 1152 of file TEfficiency.cxx.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ Bayesian()

Double_t TEfficiency::Bayesian ( Double_t total,
Double_t passed,
Double_t level,
Double_t alpha,
Double_t beta,
Bool_t bUpper,
Bool_t bShortest = false )
static

Calculates the boundaries for a Bayesian confidence interval (shortest or central interval depending on the option) as explained in D.

Casadei, Estimating the selection efficiency, 2012 JINST 7 P08021, https://doi.org/10.1088/1748-0221/7/08/P08021 (https://arxiv.org/abs/0908.0130).

Parameters
[in]totalnumber of total events
[in]passed0 <= number of passed events <= total
[in]levelconfidence level
[in]alphashape parameter > 0 for the prior distribution (fBeta_alpha)
[in]betashape parameter > 0 for the prior distribution (fBeta_beta)
[in]bUpper
  • true - upper boundary is returned
  • false - lower boundary is returned
[in]bShortest??

Note: In the case central confidence interval is calculated. when passed = 0 (or passed = total) the lower (or upper) interval values will be larger than 0 (or smaller than 1).

Calculation:

The posterior probability in bayesian statistics is given by:

\[ P(\varepsilon |k,N) \propto L(\varepsilon|k,N) \times Prior(\varepsilon) \]

As an efficiency can be interpreted as probability of a positive outcome of a Bernoullli trial the likelihood function is given by the binomial distribution:

\[ L(\varepsilon|k,N) = Binomial(N,k) \varepsilon ^{k} (1 - \varepsilon)^{N-k} \]

At the moment only beta distributions are supported as prior probabilities of the efficiency ( \( B(\alpha,\beta)\) is the beta function):

\[ Prior(\varepsilon) = \frac{1}{B(\alpha,\beta)} \varepsilon ^{\alpha - 1} (1 - \varepsilon)^{\beta - 1} \]

The posterior probability is therefore again given by a beta distribution:

\[ P(\varepsilon |k,N) \propto \varepsilon ^{k + \alpha - 1} (1 - \varepsilon)^{N - k + \beta - 1} \]

In case of central intervals the lower boundary for the equal-tailed confidence interval is given by the inverse cumulative (= quantile) function for the quantile \( \frac{1 - level}{2} \). The upper boundary for the equal-tailed confidence interval is given by the inverse cumulative (= quantile) function for the quantile \( \frac{1 + level}{2} \). Hence it is the solution \( \varepsilon \) of the following equation:

\[ I_{\varepsilon}(k + \alpha,N - k + \beta) = \frac{1}{norm} \int_{0}^{\varepsilon} dt t^{k + \alpha - 1} (1 - t)^{N - k + \beta - 1} = \frac{1 \pm level}{2} \]

In the case of shortest interval the minimum interval around the mode is found by minimizing the length of all intervals width the given probability content. See TEfficiency::BetaShortestInterval

Definition at line 1330 of file TEfficiency.cxx.

◆ BetaCentralInterval()

Double_t TEfficiency::BetaCentralInterval ( Double_t level,
Double_t a,
Double_t b,
Bool_t bUpper )
static

Calculates the boundaries for a central confidence interval for a Beta distribution.

Parameters
[in]levelconfidence level
[in]aparameter > 0 for the beta distribution (for a posterior is passed + prior_alpha
[in]bparameter > 0 for the beta distribution (for a posterior is (total-passed) + prior_beta
[in]bUppertrue - upper boundary is returned false - lower boundary is returned

Definition at line 1354 of file TEfficiency.cxx.

◆ BetaMean()

Double_t TEfficiency::BetaMean ( Double_t a,
Double_t b )
static

Compute the mean (average) of the beta distribution.

Parameters
[in]aparameter > 0 for the beta distribution (for a posterior is passed + prior_alpha
[in]bparameter > 0 for the beta distribution (for a posterior is (total-passed) + prior_beta

Definition at line 1464 of file TEfficiency.cxx.

◆ BetaMode()

Double_t TEfficiency::BetaMode ( Double_t a,
Double_t b )
static

Compute the mode of the beta distribution.

Parameters
[in]aparameter > 0 for the beta distribution (for a posterior is passed + prior_alpha
[in]bparameter > 0 for the beta distribution (for a posterior is (total-passed) + prior_beta

note the mode is defined for a Beta(a,b) only if (a,b)>1 (a = passed+alpha; b = total-passed+beta) return then the following in case (a,b) < 1:

  • if (a==b) return 0.5 (it is really undefined)
  • if (a < b) return 0;
  • if (a > b) return 1;

Definition at line 1487 of file TEfficiency.cxx.

◆ BetaShortestInterval()

Bool_t TEfficiency::BetaShortestInterval ( Double_t level,
Double_t a,
Double_t b,
Double_t & lower,
Double_t & upper )
static

Calculates the boundaries for a shortest confidence interval for a Beta distribution.

Parameters
[in]levelconfidence level
[in]aparameter > 0 for the beta distribution (for a posterior is passed + prior_alpha
[in]bparameter > 0 for the beta distribution (for a posterior is (total-passed) + prior_beta
[out]upperupper boundary is returned
[out]lowerlower boundary is returned

The lower/upper boundary are then obtained by finding the shortest interval of the beta distribution contained the desired probability level. The length of all possible intervals is minimized in order to find the shortest one

Definition at line 1410 of file TEfficiency.cxx.

◆ Browse()

void TEfficiency::Browse ( TBrowser * b)
inlineoverridevirtual

Browse object. May be overridden for another default action.

Reimplemented from TObject.

Definition at line 98 of file TEfficiency.h.

◆ Build()

void TEfficiency::Build ( const char * name,
const char * title )
protected

Building standard data structure of a TEfficiency object.

Notes:

  • calls: SetName(name), SetTitle(title)
  • set the statistic option to the default (kFCP)
  • appends this object to the current directory SetDirectory(gDirectory) if TH1::AddDirectoryStatus() is active.

Definition at line 1512 of file TEfficiency.cxx.

◆ CheckBinning()

Bool_t TEfficiency::CheckBinning ( const TH1 & pass,
const TH1 & total )
static

Checks binning for each axis.

It is assumed that the passed histograms have the same dimension.

Definition at line 1535 of file TEfficiency.cxx.

◆ CheckConsistency()

Bool_t TEfficiency::CheckConsistency ( const TH1 & pass,
const TH1 & total,
Option_t * opt = "" )
static

Checks the consistence of the given histograms.

The histograms are considered as consistent if:

  • both have the same dimension
  • both have the same binning
  • pass.GetBinContent(i) <= total.GetBinContent(i) for each bin i

Definition at line 1584 of file TEfficiency.cxx.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ CheckEntries()

Bool_t TEfficiency::CheckEntries ( const TH1 & pass,
const TH1 & total,
Option_t * opt = "" )
static

Checks whether bin contents are compatible with binomial statistics.

The following inequality has to be valid for each bin i: total.GetBinContent(i) >= pass.GetBinContent(i)

Note:

  • It is assumed that both histograms have the same dimension and binning.

Definition at line 1616 of file TEfficiency.cxx.

◆ CheckWeights()

Bool_t TEfficiency::CheckWeights ( const TH1 & pass,
const TH1 & total )
static

Check if both histogram are weighted.

If they are weighted a true is returned

Definition at line 1646 of file TEfficiency.cxx.

◆ Class()

static TClass * TEfficiency::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TEfficiency::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TEfficiency::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 194 of file TEfficiency.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ Clear()

void TNamed::Clear ( Option_t * option = "")
overridevirtualinherited

Set name and title to empty strings ("").

Reimplemented from TObject.

Reimplemented in TStreamerInfo, TVirtualStreamerInfo, TProcessID, TTask, TPrincipal, and TVirtualFitter.

Definition at line 63 of file TNamed.cxx.

◆ Clone()

TObject * TNamed::Clone ( const char * newname = "") const
overridevirtualinherited

Make a clone of an object using the Streamer facility.

If newname is specified, this will be the name of the new object.

Reimplemented from TObject.

Reimplemented in TStreamerInfo, and TTreeIndex.

Definition at line 73 of file TNamed.cxx.

◆ ClopperPearson()

Double_t TEfficiency::ClopperPearson ( Double_t total,
Double_t passed,
Double_t level,
Bool_t bUpper )
static

Calculates the boundaries for the frequentist Clopper-Pearson interval.

This interval is recommended by the PDG.

Parameters
[in]totalnumber of total events
[in]passed0 <= number of passed events <= total
[in]levelconfidence level
[in]bUppertrue - upper boundary is returned ;false - lower boundary is returned

Calculation:

The lower boundary of the Clopper-Pearson interval is the "exact" inversion of the test:

\begin{eqnarray*} P(x \geq passed; total) &=& \frac{1 - level}{2}\\ P(x \geq passed; total) &=& 1 - P(x \leq passed - 1; total)\\ &=& 1 - \frac{1}{norm} * \int_{0}^{1 - \varepsilon} t^{total - passed} (1 - t)^{passed - 1} dt\\ &=& 1 - \frac{1}{norm} * \int_{\varepsilon}^{1} t^{passed - 1} (1 - t)^{total - passed} dt\\ &=& \frac{1}{norm} * \int_{0}^{\varepsilon} t^{passed - 1} (1 - t)^{total - passed} dt\\ &=& I_{\varepsilon}(passed,total - passed + 1) \end{eqnarray*}

The lower boundary is therefore given by the \( \frac{1 - level}{2}\) quantile of the beta distribution.

The upper boundary of the Clopper-Pearson interval is the "exact" inversion of the test:

\begin{eqnarray*} P(x \leq passed; total) &=& \frac{1 - level}{2}\\ P(x \leq passed; total) &=& \frac{1}{norm} * \int_{0}^{1 - \varepsilon} t^{total - passed - 1} (1 - t)^{passed} dt\\ &=& \frac{1}{norm} * \int_{\varepsilon}^{1} t^{passed} (1 - t)^{total - passed - 1} dt\\ &=& 1 - \frac{1}{norm} * \int_{0}^{\varepsilon} t^{passed} (1 - t)^{total - passed - 1} dt\\ \Rightarrow 1 - \frac{1 - level}{2} &=& \frac{1}{norm} * \int_{0}^{\varepsilon} t^{passed} (1 - t)^{total - passed -1} dt\\ \frac{1 + level}{2} &=& I_{\varepsilon}(passed + 1,total - passed) \end{eqnarray*}

The upper boundary is therefore given by the \(\frac{1 + level}{2}\) quantile of the beta distribution.

Note: The connection between the binomial distribution and the regularized incomplete beta function \( I_{\varepsilon}(\alpha,\beta)\) has been used.

Definition at line 2024 of file TEfficiency.cxx.

◆ Combine() [1/2]

Double_t TEfficiency::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 = "" )
static
Calculates the combined efficiency and its uncertainties

This method does a bayesian combination of the given samples.

\param[in] up  contains the upper limit of the confidence interval afterwards
\param[in] low  contains the lower limit of the confidence interval afterwards
\param[in] n    number of samples which are combined
\param[in] pass array of length n containing the number of passed events
\param[in] total array of length n containing the corresponding numbers of total events
\param[in] alpha  shape parameters for the beta distribution as prior
\param[in] beta   shape parameters for the beta distribution as prior
\param[in] level  desired confidence level
\param[in] w weights for each sample; if not given, all samples get the weight 1
          The weights do not need to be normalized, since they are internally renormalized
          to the number of effective entries.
\param[in] opt
  -  mode : The mode is returned instead of the mean of the posterior as best value
            When using the mode the shortest interval is also computed instead of the central one
  -  shortest: compute shortest interval (done by default if mode option is set)
  -  central: compute central interval (done by default if mode option is NOT set)

Calculation:

The combined posterior distributions is calculated from the Bayes theorem assuming a common prior Beta distribution.
    It is easy to proof that the combined posterior is then:

\begin{eqnarray*} P_{comb}(\epsilon |{w_{i}}; {k_{i}}; {N_{i}}) &=& B(\epsilon, \sum_{i}{ w_{i} k_{i}} + \alpha, \sum_{i}{ w_{i}(n_{i}-k_{i})}+\beta)\\ w_{i} &=& weight\ for\ each\ sample\ renormalized\ to\ the\ effective\ entries\\ w^{'}_{i} &=& w_{i} \frac{ \sum_{i} {w_{i} } } { \sum_{i} {w_{i}^{2} } } \end{eqnarray*}

The estimated efficiency is the mode (or the mean) of the obtained posterior distribution

The boundaries of the confidence interval for a confidence level (1 - a) are given by the a/2 and 1-a/2 quantiles of the resulting cumulative distribution.

Example (uniform prior distribution):

{
TCanvas* c1 = new TCanvas("c1","",600,800);
c1->Divide(1,2);
c1->SetFillStyle(1001);
c1->SetFillColor(kWhite);
TF1* p1 = new TF1("p1","TMath::BetaDist(x,19,9)",0,1);
TF1* p2 = new TF1("p2","TMath::BetaDist(x,4,8)",0,1);
TF1* comb = new TF1("comb2","TMath::BetaDist(x,[0],[1])",0,1);
double nrm = 1./(0.6*0.6+0.4*0.4); // weight normalization
double a = 0.6*18.0 + 0.4*3.0 + 1.0; // new alpha parameter of combined beta dist.
double b = 0.6*10+0.4*7+1.0; // new beta parameter of combined beta dist.
comb->SetParameters(nrm*a ,nrm *b );
TF1* const1 = new TF1("const1","0.05",0,1);
TF1* const2 = new TF1("const2","0.95",0,1);
p1->SetLineColor(kRed);
p1->SetTitle("combined posteriors;#epsilon;P(#epsilon|k,N)");
p2->SetLineColor(kBlue);
comb->SetLineColor(kGreen+2);
TLegend* leg1 = new TLegend(0.12,0.65,0.5,0.85);
leg1->AddEntry(p1,"k1 = 18, N1 = 26","l");
leg1->AddEntry(p2,"k2 = 3, N2 = 10","l");
leg1->AddEntry(comb,"combined: p1 = 0.6, p2=0.4","l");
c1->cd(1);
comb->Draw();
p1->Draw("same");
p2->Draw("same");
leg1->Draw("same");
c1->cd(2);
const1->SetLineWidth(1);
const2->SetLineWidth(1);
TGraph* gr = (TGraph*)comb->DrawIntegral();
gr->SetTitle("cumulative function of combined posterior with boundaries for cl = 95%;#epsilon;CDF");
const1->Draw("same");
const2->Draw("same");
c1->cd(0);
return c1;
}
#define b(i)
Definition RSha256.hxx:100
#define a(i)
Definition RSha256.hxx:99
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
void SetTitle(const char *title="") override
Change (i.e.
Definition TGraph.cxx:2442
TGraphErrors * gr
Definition legend1.C:25

Definition at line 2120 of file TEfficiency.cxx.

◆ Combine() [2/2]

TGraphAsymmErrors * TEfficiency::Combine ( TCollection * pList,
Option_t * option = "",
Int_t n = 0,
const Double_t * w = nullptr )
static

Combines a list of 1-dimensional TEfficiency objects.

A TGraphAsymmErrors object is returned which contains the estimated efficiency and its uncertainty for each bin. If the combination fails, a zero pointer is returned.

At the moment the combining is only implemented for bayesian statistics.

Parameters
[in]pListlist containing TEfficiency objects which should be combined only one-dimensional efficiencies are taken into account
[in]option
  • s : strict combining; only TEfficiency objects with the same beta prior and the flag kIsBayesian == true are combined If not specified the prior parameter of the first TEfficiency object is used
  • v : verbose mode; print information about combining
  • cl=x : set confidence level (0 < cl < 1). If not specified, the confidence level of the first TEfficiency object is used.
  • mode Use mode of combined posterior as estimated value for the efficiency
  • shortest: compute shortest interval (done by default if mode option is set)
  • central: compute central interval (done by default if mode option is NOT set)
[in]nnumber of weights (has to be the number of one-dimensional TEfficiency objects in pList) If no weights are passed, the internal weights GetWeight() of the given TEfficiency objects are used.
[in]warray of length n with weights for each TEfficiency object in pList (w[0] correspond to pList->First ... w[n-1] -> pList->Last) The weights do not have to be normalised.

For each bin the calculation is done by the Combine(double&, double& ...) method.

Definition at line 2210 of file TEfficiency.cxx.

◆ Compare()

Int_t TNamed::Compare ( const TObject * obj) const
overridevirtualinherited

Compare two TNamed objects.

Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp).

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 84 of file TNamed.cxx.

◆ Copy() [1/4]

void TAttFill::Copy ( TAttFill & attfill) const
inherited

Copy this fill attributes to a new TAttFill.

Definition at line 203 of file TAttFill.cxx.

◆ Copy() [2/4]

void TAttLine::Copy ( TAttLine & attline) const
inherited

Copy this line attributes to a new TAttLine.

Definition at line 176 of file TAttLine.cxx.

◆ Copy() [3/4]

void TAttMarker::Copy ( TAttMarker & attmarker) const
inherited

Copy this marker attributes to a new TAttMarker.

Definition at line 243 of file TAttMarker.cxx.

◆ Copy() [4/4]

void TNamed::Copy ( TObject & named) const
overridevirtualinherited

Copy this to obj.

Reimplemented from TObject.

Reimplemented in TSystemDirectory, TSystemFile, TProfile, TProfile2D, TProfile3D, TPieSlice, TStyle, TText, and TXTRU.

Definition at line 93 of file TNamed.cxx.

◆ CreateGraph()

TGraphAsymmErrors * TEfficiency::CreateGraph ( Option_t * opt = "") const

Create the graph used be painted (for dim=1 TEfficiency) The return object is managed by the caller.

Definition at line 1675 of file TEfficiency.cxx.

◆ CreateGraph2D()

TGraph2DAsymmErrors * TEfficiency::CreateGraph2D ( Option_t * opt = "") const

Create the graph used be painted (for dim=1 TEfficiency) The return object is managed by the caller.

Definition at line 1694 of file TEfficiency.cxx.

◆ CreateHistogram()

TH2 * TEfficiency::CreateHistogram ( Option_t * opt = "") const

Create the histogram used to be painted (for dim=2 TEfficiency) The return object is managed by the caller.

Definition at line 1900 of file TEfficiency.cxx.

◆ DeclFileName()

static const char * TEfficiency::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 194 of file TEfficiency.h.

◆ Delete()

void TObject::Delete ( Option_t * option = "")
virtualinherited

◆ DistancetoLine()

Int_t TAttLine::DistancetoLine ( Int_t px,
Int_t py,
Double_t xp1,
Double_t yp1,
Double_t xp2,
Double_t yp2 )
inherited

Compute distance from point px,py to a line.

Compute the closest distance of approach from point px,py to this line. The distance is computed in pixels units.

Algorithm:

A(x1,y1) P B(x2,y2)
-----------------+------------------------------
|
|
|
|
M(x,y)
Let us call a = distance AM A=a**2
b = distance BM B=b**2
c = distance AB C=c**2
d = distance PM D=d**2
u = distance AP U=u**2
v = distance BP V=v**2 c = u + v
D = A - U
D = B - V = B -(c-u)**2
==> u = (A -B +C)/2c
#define d(i)
Definition RSha256.hxx:102
#define c(i)
Definition RSha256.hxx:101
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
Double_t y[n]
Definition legend1.C:17

Definition at line 210 of file TAttLine.cxx.

◆ DistancetoPrimitive()

Int_t TEfficiency::DistancetoPrimitive ( Int_t px,
Int_t py )
overridevirtual

Compute distance from point px,py to a graph.

Compute the closest distance of approach from point px,py to this line. The distance is computed in pixels units.

Forward the call to the painted graph

Reimplemented from TObject.

Definition at line 2395 of file TEfficiency.cxx.

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TTreeViewer, and TThread.

Definition at line 1059 of file TObject.cxx.

◆ Draw()

void TEfficiency::Draw ( Option_t * opt = "")
overridevirtual

Draws the current TEfficiency object.

Parameters
[in]opt
  • 1-dimensional case: same options as TGraphAsymmErrors::Draw() but as default "AP" is used
  • 2-dimensional case: by default use an histogram and in this case same options as TH2::Draw() if using instad option "GRAPH" a TGraph2DAsymmErrors is used and the same options as for TGraph2D applies
  • 3-dimensional case: not yet supported

Specific TEfficiency drawing options:

  • E0 - plot bins where the total number of passed events is zero (the error interval will be [0,1] )

Reimplemented from TObject.

Definition at line 2418 of file TEfficiency.cxx.

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TSystemDirectory, TSystemFile, and TGFrame.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TSystemDirectory, TSystemFile, TGFrame, TAxis, and TCanvas.

Definition at line 319 of file TObject.cxx.

◆ Dump()

void TObject::Dump ( ) const
virtualinherited

Dump contents of object on stdout.

Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed

The following output is the Dump of a TArrow object:

fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fBits 50331648 bit field status word
fFillColor 19 fill area color
#define X(type, name)
Option_t Option_t TPoint TPoint angle
Option_t Option_t width
Option_t Option_t style
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:25
Color_t fFillColor
Fill area color.
Definition TAttFill.h:24
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
Style_t fLineStyle
Line style.
Definition TAttLine.h:25
Color_t fLineColor
Line color.
Definition TAttLine.h:24
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
UInt_t fBits
bit field status word
Definition TObject.h:47
TLine * line

Reimplemented in TSystemFile, TCollection, TClass, TGFrame, and TGPack.

Definition at line 367 of file TObject.cxx.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in TMethodCall, TCling, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in TCling, TMethodCall, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

void TEfficiency::ExecuteEvent ( Int_t event,
Int_t px,
Int_t py )
overridevirtual

Execute action corresponding to one event.

This member function is called when the drawn class is clicked with the locator If Left button clicked on one of the line end points, this point follows the cursor until button is released.

if Middle button clicked, the line is moved parallel to itself until the button is released. Forward the call to the underlying graph

Reimplemented from TObject.

Definition at line 2452 of file TEfficiency.cxx.

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ FeldmanCousins()

Double_t TEfficiency::FeldmanCousins ( Double_t total,
Double_t passed,
Double_t level,
Bool_t bUpper )
static

Calculates the boundaries for the frequentist Feldman-Cousins interval.

Parameters
totalnumber of total events
passed0 <= number of passed events <= total
levelconfidence level
bUppertrue - upper boundary is returned false - lower boundary is returned

Definition at line 1175 of file TEfficiency.cxx.

◆ FeldmanCousinsInterval()

Bool_t TEfficiency::FeldmanCousinsInterval ( Double_t total,
Double_t passed,
Double_t level,
Double_t & lower,
Double_t & upper )
static

Calculates the interval boundaries using the frequentist methods of Feldman-Cousins.

Parameters
[in]totalnumber of total events
[in]passed0 <= number of passed events <= total
[in]levelconfidence level
[out]lowerlower boundary returned on exit
[out]upperlower boundary returned on exit
Returns
a flag with the status of the calculation

Calculation:

The Feldman-Cousins is a frequentist method where the interval is estimated using a Neyman construction where the ordering is based on the likelihood ratio:

\[ LR = \frac{Binomial(k | N, \epsilon)}{Binomial(k | N, \hat{\epsilon} ) } \]

See G. J. Feldman and R. D. Cousins, Phys. Rev. D57 (1998) 3873 and R. D. Cousins, K. E. Hymes, J. Tucker, Nuclear Instruments and Methods in Physics Research A 612 (2010) 388

Implemented using classes developed by Jordan Tucker and Luca Lista See File hist/hist/src/TEfficiencyHelper.h

Definition at line 1208 of file TEfficiency.cxx.

◆ Fill()

void TEfficiency::Fill ( Bool_t bPassed,
Double_t x,
Double_t y = 0,
Double_t z = 0 )

This function is used for filling the two histograms.

Parameters
[in]bPassedflag whether the current event passed the selection
  • true: both histograms are filled
  • false: only the total histogram is filled
[in]xx-value
[in]yy-value (use default=0 for 1-D efficiencies)
[in]zz-value (use default=0 for 2-D or 1-D efficiencies)

Definition at line 2468 of file TEfficiency.cxx.

◆ FillBuffer()

void TNamed::FillBuffer ( char *& buffer)
virtualinherited

Encode TNamed into output buffer.

Reimplemented in TKeySQL, TSQLFile, TKeyXML, TXMLFile, TDirectoryFile, TFile, and TKey.

Definition at line 103 of file TNamed.cxx.

◆ FillGraph()

void TEfficiency::FillGraph ( TGraphAsymmErrors * graph,
Option_t * opt ) const
protected

Fill the graph to be painted with information from TEfficiency Internal method called by TEfficiency::Paint or TEfficiency::CreateGraph.

Definition at line 1816 of file TEfficiency.cxx.

◆ FillGraph2D()

void TEfficiency::FillGraph2D ( TGraph2DAsymmErrors * graph,
Option_t * opt ) const
protected

Fill the graph to be painted with information from TEfficiency Internal method called by TEfficiency::Paint or TEfficiency::CreateGraph.

Definition at line 1713 of file TEfficiency.cxx.

◆ FillHistogram()

void TEfficiency::FillHistogram ( TH2 * h2) const
protected

Fill the 2d histogram to be painted with information from TEfficiency 2D Internal method called by TEfficiency::Paint or TEfficiency::CreatePaintingGraph.

Definition at line 1938 of file TEfficiency.cxx.

◆ FillWeighted()

void TEfficiency::FillWeighted ( Bool_t bPassed,
Double_t weight,
Double_t x,
Double_t y = 0,
Double_t z = 0 )

This function is used for filling the two histograms with a weight.

Parameters
[in]bPassedflag whether the current event passed the selection
  • true: both histograms are filled
  • false: only the total histogram is filled
[in]weightweight for the event
[in]xx-value
[in]yy-value (use default=0 for 1-D efficiencies)
[in]zz-value (use default=0 for 2-D or 1-D efficiencies)

Note: - this function will call SetUseWeightedEvents if it was not called by the user before

Definition at line 2502 of file TEfficiency.cxx.

◆ FindFixBin()

Int_t TEfficiency::FindFixBin ( Double_t x,
Double_t y = 0,
Double_t z = 0 ) const

Returns the global bin number containing the given values.

Note:

  • values which belong to dimensions higher than the current dimension of the TEfficiency object are ignored (i.e. for 1-dimensional efficiencies only the x-value is considered)

Definition at line 2538 of file TEfficiency.cxx.

◆ FindObject() [1/2]

TObject * TObject::FindObject ( const char * name) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object by name inside this object.

Reimplemented in TListOfEnums, TMap, TDirectory, TFolder, TROOT, TListOfTypes, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 425 of file TObject.cxx.

◆ FindObject() [2/2]

TObject * TObject::FindObject ( const TObject * obj) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object inside this object.

Reimplemented in TMap, TDirectory, TFolder, TROOT, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 435 of file TObject.cxx.

◆ Fit()

TFitResultPtr TEfficiency::Fit ( TF1 * f1,
Option_t * opt = "" )

Fits the efficiency using the TBinomialEfficiencyFitter class.

The resulting fit function is added to the list of associated functions.

Options:

  • "+": previous fitted functions in the list are kept, by default all functions in the list are deleted
  • "N": do not store fitted function
  • for more fitting options see TBinomialEfficiencyFitter::Fit

Definition at line 2563 of file TEfficiency.cxx.

◆ GetBetaAlpha()

Double_t TEfficiency::GetBetaAlpha ( Int_t bin = -1) const
inline

Definition at line 110 of file TEfficiency.h.

◆ GetBetaBeta()

Double_t TEfficiency::GetBetaBeta ( Int_t bin = -1) const
inline

Definition at line 111 of file TEfficiency.h.

◆ GetConfidenceLevel()

Double_t TEfficiency::GetConfidenceLevel ( ) const
inline

Definition at line 112 of file TEfficiency.h.

◆ GetCopyPassedHisto()

TH1 * TEfficiency::GetCopyPassedHisto ( ) const

Returns a cloned version of fPassedHistogram.

Notes:

  • The histogram is filled with unit weights. You might want to scale it with the global weight GetWeight().
  • The returned object is owned by the user who has to care about the deletion of the new TH1 object.
  • This histogram is by default NOT attached to the current directory to avoid duplication of data. If you want to store it automatically during the next TFile::Write() command, you have to attach it to the corresponding directory.
TFile* pFile = new TFile("passed.root","update");
TEfficiency* pEff = (TEfficiency*)gDirectory->Get("my_eff");
TH1* copy = pEff->GetCopyPassedHisto();
pFile->Write();
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:9074

Definition at line 2625 of file TEfficiency.cxx.

◆ GetCopyTotalHisto()

TH1 * TEfficiency::GetCopyTotalHisto ( ) const

Returns a cloned version of fTotalHistogram.

Notes:

  • The histogram is filled with unit weights. You might want to scale it with the global weight GetWeight().
  • The returned object is owned by the user who has to care about the deletion of the new TH1 object.
  • This histogram is by default NOT attached to the current directory to avoid duplication of data. If you want to store it automatically during the next TFile::Write() command, you have to attach it to the corresponding directory.
TFile* pFile = new TFile("total.root","update");
TEfficiency* pEff = (TEfficiency*)gDirectory->Get("my_eff");
TH1* copy = pEff->GetCopyTotalHisto();
pFile->Write();

Definition at line 2655 of file TEfficiency.cxx.

◆ GetDimension()

Int_t TEfficiency::GetDimension ( ) const

returns the dimension of the current TEfficiency object

Definition at line 2667 of file TEfficiency.cxx.

◆ GetDirectory()

TDirectory * TEfficiency::GetDirectory ( ) const
inline

Definition at line 116 of file TEfficiency.h.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetEfficiency()

Double_t TEfficiency::GetEfficiency ( Int_t bin) const

Returns the efficiency in the given global bin.

Note:

  • The estimated efficiency depends on the chosen statistic option: for frequentist ones: \( \hat{\varepsilon} = \frac{passed}{total} \) for bayesian ones the expectation value of the resulting posterior distribution is returned: \( \hat{\varepsilon} = \frac{passed + \alpha}{total + \alpha + \beta} \) If the bit kPosteriorMode is set (or the method TEfficiency::UsePosteriorMode() has been called ) the mode (most probable value) of the posterior is returned: \( \hat{\varepsilon} = \frac{passed + \alpha -1}{total + \alpha + \beta -2} \)
    • If the denominator is equal to 0, an efficiency of 0 is returned.
    • When \( passed + \alpha < 1 \) or \( total - passed + \beta < 1 \) the above formula for the mode is not valid. In these cases values the estimated efficiency is 0 or 1.

Definition at line 2689 of file TEfficiency.cxx.

◆ GetEfficiencyErrorLow()

Double_t TEfficiency::GetEfficiencyErrorLow ( Int_t bin) const

Returns the lower error on the efficiency in the given global bin.

The result depends on the current confidence level fConfLevel and the chosen statistic option fStatisticOption. See SetStatisticOption(Int_t) for more details.

Note: If the histograms are filled with weights, only bayesian methods and the normal approximation are supported.

Definition at line 2740 of file TEfficiency.cxx.

◆ GetEfficiencyErrorUp()

Double_t TEfficiency::GetEfficiencyErrorUp ( Int_t bin) const

Returns the upper error on the efficiency in the given global bin.

The result depends on the current confidence level fConfLevel and the chosen statistic option fStatisticOption. See SetStatisticOption(Int_t) for more details.

Note: If the histograms are filled with weights, only bayesian methods and the normal approximation are supported.

Definition at line 2820 of file TEfficiency.cxx.

◆ GetFillColor()

virtual Color_t TAttFill::GetFillColor ( ) const
inlinevirtualinherited

Return the fill area color.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 32 of file TAttFill.h.

◆ GetFillStyle()

virtual Style_t TAttFill::GetFillStyle ( ) const
inlinevirtualinherited

Return the fill area style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 33 of file TAttFill.h.

◆ GetGlobalBin()

Int_t TEfficiency::GetGlobalBin ( Int_t binx,
Int_t biny = 0,
Int_t binz = 0 ) const

Returns the global bin number which can be used as argument for the following functions:

  • GetEfficiency(bin), GetEfficiencyErrorLow(bin), GetEfficiencyErrorUp(bin)
  • SetPassedEvents(bin), SetTotalEvents(bin)

see TH1::GetBin() for conventions on numbering bins

Definition at line 2898 of file TEfficiency.cxx.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in TSystemFile, TGeoVolume, TASImage, TGMainFrame, TKey, ROOT::Experimental::XRooFit::xRooNode, TBranch, TVirtualBranchBrowsable, TMethodBrowsable, and TBranchElement.

Definition at line 472 of file TObject.cxx.

◆ GetLineColor()

virtual Color_t TAttLine::GetLineColor ( ) const
inlinevirtualinherited

Return the line color.

Reimplemented in TGraphMultiErrors, and TGWin32VirtualXProxy.

Definition at line 36 of file TAttLine.h.

◆ GetLineStyle()

virtual Style_t TAttLine::GetLineStyle ( ) const
inlinevirtualinherited

Return the line style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 37 of file TAttLine.h.

◆ GetLineWidth()

virtual Width_t TAttLine::GetLineWidth ( ) const
inlinevirtualinherited

Return the line width.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 38 of file TAttLine.h.

◆ GetListOfFunctions()

TList * TEfficiency::GetListOfFunctions ( )

Definition at line 2905 of file TEfficiency.cxx.

◆ GetMarkerColor()

virtual Color_t TAttMarker::GetMarkerColor ( ) const
inlinevirtualinherited

Return the marker color.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 33 of file TAttMarker.h.

◆ GetMarkerLineWidth()

Width_t TAttMarker::GetMarkerLineWidth ( Style_t style)
staticinherited

Internal helper function that returns the line width of the given marker style (0 = filled marker)

Definition at line 305 of file TAttMarker.cxx.

◆ GetMarkerSize()

virtual Size_t TAttMarker::GetMarkerSize ( ) const
inlinevirtualinherited

Return the marker size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 35 of file TAttMarker.h.

◆ GetMarkerStyle()

virtual Style_t TAttMarker::GetMarkerStyle ( ) const
inlinevirtualinherited

Return the marker style.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 34 of file TAttMarker.h.

◆ GetMarkerStyleBase()

Style_t TAttMarker::GetMarkerStyleBase ( Style_t style)
staticinherited

Internal helper function that returns the corresponding marker style with line width 1 for the given style.

Definition at line 254 of file TAttMarker.cxx.

◆ GetName()

const char * TNamed::GetName ( ) const
inlineoverridevirtualinherited

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 49 of file TNamed.h.

◆ GetObjectInfo()

char * TObject::GetObjectInfo ( Int_t px,
Int_t py ) const
virtualinherited

Returns string containing info about the object at position (px,py).

This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).

Reimplemented in TGeoNode, TGeoVolume, TGeoTrack, TASImage, TColorWheel, TAxis3D, TNode, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TF1, TF2, TGraph, TH1, THistPainter, TPaletteAxis, TFileDrawMap, TParallelCoordVar, and TVirtualHistPainter.

Definition at line 491 of file TObject.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

virtual Option_t * TObject::GetOption ( ) const
inlinevirtualinherited

◆ GetPaintedGraph()

TGraphAsymmErrors * TEfficiency::GetPaintedGraph ( ) const
inline

Definition at line 121 of file TEfficiency.h.

◆ GetPaintedGraph2D()

TGraph2DAsymmErrors * TEfficiency::GetPaintedGraph2D ( ) const
inline

Definition at line 122 of file TEfficiency.h.

◆ GetPaintedHistogram()

TH2 * TEfficiency::GetPaintedHistogram ( ) const
inline

Definition at line 123 of file TEfficiency.h.

◆ GetPassedHistogram()

const TH1 * TEfficiency::GetPassedHistogram ( ) const
inline

Definition at line 125 of file TEfficiency.h.

◆ GetStatisticOption()

EStatOption TEfficiency::GetStatisticOption ( ) const
inline

Definition at line 126 of file TEfficiency.h.

◆ GetTitle()

const char * TNamed::GetTitle ( ) const
inlineoverridevirtualinherited

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented from TObject.

Definition at line 50 of file TNamed.h.

◆ GetTotalHistogram()

const TH1 * TEfficiency::GetTotalHistogram ( ) const
inline

Definition at line 127 of file TEfficiency.h.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GetWeight()

Double_t TEfficiency::GetWeight ( ) const
inline

Definition at line 128 of file TEfficiency.h.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGWindow, TGuiBldDragManager, TGraphTime, TGLEventHandler, TGCommandPlugin, TGDNDManager, TGFileContainer, TGPopupMenu, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGHtml, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TNamed::Hash ( ) const
inlineoverridevirtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

ULong_t Hash() const override
Return hash value for this object.
Definition TNamed.h:51
Mother of all ROOT objects.
Definition TObject.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented from TObject.

Definition at line 51 of file TNamed.h.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in TSystemFile, TInspectorObject, TGFrame, and ROOT::Experimental::XRooFit::xRooNode.

Definition at line 570 of file TObject.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TEfficiency::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 194 of file TEfficiency.h.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TObjString, TQCommand, TPair, and TGObject.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

◆ IsOnHeap()

R__ALWAYS_INLINE Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsSortable()

Bool_t TNamed::IsSortable ( ) const
inlineoverridevirtualinherited

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 52 of file TNamed.h.

◆ IsTransparent()

Bool_t TAttFill::IsTransparent ( ) const
inlinevirtualinherited

Reimplemented in TGWin32VirtualXProxy.

Definition at line 49 of file TAttFill.h.

◆ IsZombie()

R__ALWAYS_INLINE Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ ls()

void TNamed::ls ( Option_t * option = "") const
overridevirtualinherited

List TNamed name and title.

Reimplemented from TObject.

Reimplemented in ROOT::Experimental::XRooFit::xRooBrowser, TVirtualStreamerInfo, TROOT, TStreamerElement, TStreamerBase, TStreamerSTL, TText, TStreamerInfo, TTask, and TNode.

Definition at line 112 of file TNamed.cxx.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).

Definition at line 1160 of file TObject.cxx.

◆ Merge()

Long64_t TEfficiency::Merge ( TCollection * pList)

Merges the TEfficiency objects in the given list to the given TEfficiency object using the operator+=(TEfficiency&)

The merged result is stored in the current object. The statistic options and the confidence level are taken from the current object.

This function should be used when all TEfficiency objects correspond to the same process.

The new weight is set according to: \( \frac{1}{w_{new}} = \sum_{i} \frac{1}{w_{i}} \)

Definition at line 2923 of file TEfficiency.cxx.

◆ MidPInterval()

Double_t TEfficiency::MidPInterval ( Double_t total,
Double_t passed,
Double_t level,
Bool_t bUpper )
static

Calculates the boundaries using the mid-P binomial interval (Lancaster method) from B.

Cousing and J. Tucker. See http://arxiv.org/abs/0905.3831 for a description and references for the method

Modify equal_tailed to get the kind of interval you want. Can also be converted to interval on ratio of poisson means X/Y by the substitutions

total = X + Y
static unsigned int total

Definition at line 1233 of file TEfficiency.cxx.

◆ Modify() [1/3]

void TAttFill::Modify ( )
virtualinherited

Change current fill area attributes if necessary.

Definition at line 212 of file TAttFill.cxx.

◆ Modify() [2/3]

void TAttLine::Modify ( )
virtualinherited

Change current line attributes if necessary.

Definition at line 246 of file TAttLine.cxx.

◆ Modify() [3/3]

void TAttMarker::Modify ( )
virtualinherited

Change current marker attributes if necessary.

Definition at line 322 of file TAttMarker.cxx.

◆ ModifyOn() [1/3]

void TAttFill::ModifyOn ( TVirtualPad & pad)
virtualinherited

Change current fill area attributes on speicifed pad.

Definition at line 221 of file TAttFill.cxx.

◆ ModifyOn() [2/3]

void TAttLine::ModifyOn ( TVirtualPad & pad)
virtualinherited

Change current line attributes on specified pad.

Definition at line 255 of file TAttLine.cxx.

◆ ModifyOn() [3/3]

void TAttMarker::ModifyOn ( TVirtualPad & pad)
virtualinherited

Change current marker attributes if necessary on specified pad.

Definition at line 331 of file TAttMarker.cxx.

◆ Normal()

Double_t TEfficiency::Normal ( Double_t total,
Double_t passed,
Double_t level,
Bool_t bUpper )
static

Returns the confidence limits for the efficiency supposing that the efficiency follows a normal distribution with the rms below.

Parameters
[in]totalnumber of total events
[in]passed0 <= number of passed events <= total
[in]levelconfidence level
[in]bUpper
  • true - upper boundary is returned
  • false - lower boundary is returned

Calculation:

\begin{eqnarray*} \hat{\varepsilon} &=& \frac{passed}{total}\\ \sigma_{\varepsilon} &=& \sqrt{\frac{\hat{\varepsilon} (1 - \hat{\varepsilon})}{total}}\\ \varepsilon_{low} &=& \hat{\varepsilon} \pm \Phi^{-1}(\frac{level}{2},\sigma_{\varepsilon}) \end{eqnarray*}

Definition at line 2960 of file TEfficiency.cxx.

◆ Notify()

Bool_t TObject::Notify ( )
virtualinherited

This method must be overridden to handle object notification (the base implementation is no-op).

Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.

For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.

Reimplemented in TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TFileHandler, TSignalHandler, TStdExceptionHandler, TProcessEventTimer, TTimer, TIdleTimer, TSingleShotCleaner, TCollection, TRefTable, TBrowserTimer, TInterruptHandler, TTermInputHandler, TThreadTimer, TGLRedrawTimer, TViewTimer, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TViewUpdateTimer, TPopupDelayTimer, TRepeatTimer, TSBRepeatTimer, TGTextEditHist, TInsCharCom, TDelCharCom, TBreakLineCom, TInsTextCom, TDelTextCom, TBlinkTimer, TTipDelayTimer, TGuiBldDragManagerRepeatTimer, TARInterruptHandler, TASLogHandler, TASInterruptHandler, TASSigPipeHandler, TASInputHandler, TSocketHandler, TTimeOutTimer, TBranchElement, TBranchRef, TLeafObject, TSelector, TTree, TSelectorDraw, TSelectorEntries, TTreeFormula, TTreeFormulaManager, TTreeReader, h1analysis, h1analysisTreeReader, and TSysEvtHandler.

Definition at line 618 of file TObject.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ operator+=()

TEfficiency & TEfficiency::operator+= ( const TEfficiency & rhs)

Adds the histograms of another TEfficiency object to current histograms.

The statistic options and the confidence level remain unchanged.

fTotalHistogram += rhs.fTotalHistogram; fPassedHistogram += rhs.fPassedHistogram;

calculates a new weight: current weight of this TEfficiency object = \( w_{1} \) weight of rhs = \( w_{2} \) \( w_{new} = \frac{w_{1} \times w_{2}}{w_{1} + w_{2}} \)

Definition at line 2987 of file TEfficiency.cxx.

◆ operator=()

TEfficiency & TEfficiency::operator= ( const TEfficiency & rhs)

Assignment operator.

The histograms, statistic option, confidence level, weight and paint styles of rhs are copied to the this TEfficiency object.

Note: - The list of associated functions is not copied. After this operation the list of associated functions is empty.

Definition at line 3029 of file TEfficiency.cxx.

◆ Paint()

void TEfficiency::Paint ( Option_t * opt)
overridevirtual

Paints this TEfficiency object.

For details on the possible option see Draw(Option_t*)

Note for 1D classes In 1D the TEfficiency uses a TGraphAsymmErrors for drawing The TGraph is created only the first time Paint is used. The user can manipulate the TGraph via the method TEfficiency::GetPaintedGraph() The TGraph creates behing an histogram for the axis. The histogram is created also only the first time. If the axis needs to be updated because in the meantime the class changed use this trick which will trigger a re-calculation of the axis of the graph TEfficiency::GetPaintedGraph()->Set(0)

Note that in order to access the painted graph via GetPaintedGraph() you need either to call Paint or better gPad->Update();

Reimplemented from TObject.

Definition at line 3089 of file TEfficiency.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TPad, TFrame, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Print()

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TKeyXML, TBuffer, TKey, and TKeySQL.

Definition at line 673 of file TObject.cxx.

◆ RecursiveRemove()

void TEfficiency::RecursiveRemove ( TObject * obj)
overridevirtual

Recursively remove object from the list of functions.

Reimplemented from TObject.

Definition at line 3163 of file TEfficiency.cxx.

◆ ResetAttFill()

void TAttFill::ResetAttFill ( Option_t * option = "")
virtualinherited

Reset this fill attributes to default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 231 of file TAttFill.cxx.

◆ ResetAttLine()

void TAttLine::ResetAttLine ( Option_t * option = "")
virtualinherited

Reset this line attributes to default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 279 of file TAttLine.cxx.

◆ ResetAttMarker()

void TAttMarker::ResetAttMarker ( Option_t * toption = "")
virtualinherited

Reset this marker attributes to the default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 342 of file TAttMarker.cxx.

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ SaveAs()

void TObject::SaveAs ( const char * filename = "",
Option_t * option = "" ) const
virtualinherited

Save this object in the file specified by filename.

  • if "filename" contains ".root" the object is saved in filename as root binary file.
  • if "filename" contains ".xml" the object is saved in filename as a xml ascii file.
  • if "filename" contains ".cc" the object is saved in filename as C code independent from ROOT. The code is generated via SavePrimitive(). Specific code should be implemented in each object to handle this option. Like in TF1::SavePrimitive().
  • otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.

    The function is available via the object context menu.

Reimplemented in TSpline, TFolder, TGeoVolume, TClassTree, TPad, TPaveClass, TGObject, TSpline3, TSpline5, ROOT::Experimental::XRooFit::xRooNode, TTreePerfStats, TVirtualPad, TGraph, and TH1.

Definition at line 708 of file TObject.cxx.

◆ SaveFillAttributes()

void TAttFill::SaveFillAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1001 )
virtualinherited

Save fill attributes as C++ statement(s) on output stream out.

Definition at line 240 of file TAttFill.cxx.

◆ SaveLineAttributes()

void TAttLine::SaveLineAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t widdef = 1 )
virtualinherited

Save line attributes as C++ statement(s) on output stream out.

Definition at line 289 of file TAttLine.cxx.

◆ SaveMarkerAttributes()

void TAttMarker::SaveMarkerAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t sizdef = 1 )
virtualinherited

Save line attributes as C++ statement(s) on output stream out.

Definition at line 352 of file TAttMarker.cxx.

◆ SavePrimitive()

void TEfficiency::SavePrimitive ( std::ostream & out,
Option_t * opt = "" )
overridevirtual

Save primitive as a C++ statement(s) on output stream out.

Reimplemented from TObject.

Definition at line 3185 of file TEfficiency.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveNameTitle()

void TNamed::SavePrimitiveNameTitle ( std::ostream & out,
const char * variable_name )
protectedinherited

Save object name and title into the output stream "out".

Definition at line 135 of file TNamed.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ SetBetaAlpha()

void TEfficiency::SetBetaAlpha ( Double_t alpha)

Sets the shape parameter α.

The prior probability of the efficiency is given by the beta distribution:

\[ f(\varepsilon;\alpha;\beta) = \frac{1}{B(\alpha,\beta)} \varepsilon^{\alpha-1} (1 - \varepsilon)^{\beta-1} \]

Note: - both shape parameters have to be positive (i.e. > 0)

Definition at line 3291 of file TEfficiency.cxx.

◆ SetBetaBeta()

void TEfficiency::SetBetaBeta ( Double_t beta)

Sets the shape parameter β.

The prior probability of the efficiency is given by the beta distribution:

\[ f(\varepsilon;\alpha,\beta) = \frac{1}{B(\alpha,\beta)} \varepsilon^{\alpha-1} (1 - \varepsilon)^{\beta-1} \]

Note: - both shape parameters have to be positive (i.e. > 0)

Definition at line 3309 of file TEfficiency.cxx.

◆ SetBetaBinParameters()

void TEfficiency::SetBetaBinParameters ( Int_t bin,
Double_t alpha,
Double_t beta )

Sets different shape parameter α and β for the prior distribution for each bin.

By default the global parameter are used if they are not set for the specific bin The prior probability of the efficiency is given by the beta distribution:

\[ f(\varepsilon;\alpha;\beta) = \frac{1}{B(\alpha,\beta)} \varepsilon^{\alpha-1} (1 - \varepsilon)^{\beta-1} \]

Note:

  • both shape parameters have to be positive (i.e. > 0)
  • bin gives the global bin number (cf. GetGlobalBin)

Definition at line 3330 of file TEfficiency.cxx.

◆ SetBins() [1/6]

Bool_t TEfficiency::SetBins ( Int_t nx,
const Double_t * xBins )

Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.

Definition at line 3371 of file TEfficiency.cxx.

◆ SetBins() [2/6]

Bool_t TEfficiency::SetBins ( Int_t nx,
const Double_t * xBins,
Int_t ny,
const Double_t * yBins )

Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.

Definition at line 3411 of file TEfficiency.cxx.

◆ SetBins() [3/6]

Bool_t TEfficiency::SetBins ( Int_t nx,
const Double_t * xBins,
Int_t ny,
const Double_t * yBins,
Int_t nz,
const Double_t * zBins )

Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.

Definition at line 3452 of file TEfficiency.cxx.

◆ SetBins() [4/6]

Bool_t TEfficiency::SetBins ( Int_t nx,
Double_t xmin,
Double_t xmax )

Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.

Definition at line 3351 of file TEfficiency.cxx.

◆ SetBins() [5/6]

Bool_t TEfficiency::SetBins ( Int_t nx,
Double_t xmin,
Double_t xmax,
Int_t ny,
Double_t ymin,
Double_t ymax )

Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.

Definition at line 3391 of file TEfficiency.cxx.

◆ SetBins() [6/6]

Bool_t TEfficiency::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 )

Set the bins for the underlined passed and total histograms If the class have been already filled the previous contents will be lost.

Definition at line 3431 of file TEfficiency.cxx.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetCentralInterval()

void TEfficiency::SetCentralInterval ( Bool_t on = true)
inline

Definition at line 146 of file TEfficiency.h.

◆ SetConfidenceLevel()

void TEfficiency::SetConfidenceLevel ( Double_t level)

Sets the confidence level (0 < level < 1) The default value is 1-sigma :~ 0.683.

Definition at line 3473 of file TEfficiency.cxx.

◆ SetDirectory()

void TEfficiency::SetDirectory ( TDirectory * dir)

Sets the directory holding this TEfficiency object.

A reference to this TEfficiency object is removed from the current directory (if it exists) and a new reference to this TEfficiency object is added to the given directory.

Notes:

  • If the given directory is nullptr, the TEfficiency object does not belong to any directory and will not be written to file during the next TFile::Write() command. This also means that the user has ownership of this object.

Definition at line 3494 of file TEfficiency.cxx.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in TSystemDirectory, TSystemFile, TPad, TGFrame, TAxis, TBrowser, TPaveStats, TGedFrame, TRootBrowserLite, and RooPlot.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetFillAttributes()

void TAttFill::SetFillAttributes ( )
virtualinherited

Invoke the DialogCanvas Fill attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 251 of file TAttFill.cxx.

◆ SetFillColor() [1/2]

virtual void TAttFill::SetFillColor ( Color_t fcolor)
inlinevirtualinherited

Set the fill area color.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSVG, TTeXDump, TSpider, and TGraphMultiErrors.

Definition at line 40 of file TAttFill.h.

◆ SetFillColor() [2/2]

void TAttFill::SetFillColor ( TColorNumber lcolor)
inherited

Set a fill color.

Definition at line 270 of file TAttFill.cxx.

◆ SetFillColorAlpha()

void TAttFill::SetFillColorAlpha ( Color_t fcolor,
Float_t falpha )
virtualinherited

Set a transparent fill color.

Parameters
fcolordefines the fill color
falphadefines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
Note
falpha is ignored (treated as 1) if the TCanvas has no GL support activated.

Reimplemented in TGraphMultiErrors.

Definition at line 262 of file TAttFill.cxx.

◆ SetFillStyle()

virtual void TAttFill::SetFillStyle ( Style_t fstyle)
inlinevirtualinherited

Set the fill area style.

Reimplemented in TGraphMultiErrors, TPad, TSpider, TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 42 of file TAttFill.h.

◆ SetLineAttributes()

void TAttLine::SetLineAttributes ( )
virtualinherited

Invoke the DialogCanvas Line attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 306 of file TAttLine.cxx.

◆ SetLineColor() [1/2]

◆ SetLineColor() [2/2]

void TAttLine::SetLineColor ( TColorNumber lcolor)
inherited

Definition at line 322 of file TAttLine.cxx.

◆ SetLineColorAlpha()

void TAttLine::SetLineColorAlpha ( Color_t lcolor,
Float_t lalpha )
virtualinherited

Set a transparent line color.

Parameters
lcolordefines the line color
lalphadefines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
Note
lalpha is ignored (treated as 1) if the TCanvas has no GL support activated.

Reimplemented in TGraphMultiErrors.

Definition at line 317 of file TAttLine.cxx.

◆ SetLineStyle()

virtual void TAttLine::SetLineStyle ( Style_t lstyle)
inlinevirtualinherited

◆ SetLineWidth()

◆ SetMarkerAttributes()

void TAttMarker::SetMarkerAttributes ( )
virtualinherited

Invoke the DialogCanvas Marker attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 365 of file TAttMarker.cxx.

◆ SetMarkerColor() [1/2]

◆ SetMarkerColor() [2/2]

void TAttMarker::SetMarkerColor ( TColorNumber lcolor)
inherited

Definition at line 381 of file TAttMarker.cxx.

◆ SetMarkerColorAlpha()

void TAttMarker::SetMarkerColorAlpha ( Color_t mcolor,
Float_t malpha )
virtualinherited

Set a transparent marker color.

Parameters
mcolordefines the marker color
malphadefines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque).
Note
malpha is ignored (treated as 1) if the TCanvas has no GL support activated.

Definition at line 376 of file TAttMarker.cxx.

◆ SetMarkerSize()

virtual void TAttMarker::SetMarkerSize ( Size_t msize = 1)
inlinevirtualinherited

Set the marker size.

Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. They are meant to be very fast to draw and are always drawn with the same number of pixels; therefore this method does not apply on them.

Reimplemented in TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TTeXDump, TEvePointSet, TEvePointSetArray, ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, TEveTrackList, and ROOT::Experimental::REveTrackList.

Definition at line 48 of file TAttMarker.h.

◆ SetMarkerStyle()

virtual void TAttMarker::SetMarkerStyle ( Style_t mstyle = 1)
inlinevirtualinherited

◆ SetName()

void TEfficiency::SetName ( const char * name)
overridevirtual

Sets the name.

Note: The names of the internal histograms are set to "name + _total" and "name + _passed" respectively.

Reimplemented from TNamed.

Definition at line 3511 of file TEfficiency.cxx.

◆ SetNameTitle()

void TNamed::SetNameTitle ( const char * name,
const char * title )
virtualinherited

Set all the TNamed parameters (name and title).

WARNING: if the name is changed and the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.

Reimplemented in TContextMenu, TNode, TGraph2D, TH1, RooAbsArg, RooAbsData, RooDataHist, RooDataSet, RooFitResult, RooPlot, and TGraph.

Definition at line 163 of file TNamed.cxx.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetPassedEvents()

Bool_t TEfficiency::SetPassedEvents ( Int_t bin,
Double_t events )

Sets the number of passed events in the given global bin.

returns "true" if the number of passed events has been updated otherwise "false" ist returned

Note: - requires: 0 <= events <= fTotalHistogram->GetBinContent(bin)

Definition at line 3530 of file TEfficiency.cxx.

◆ SetPassedHistogram()

Bool_t TEfficiency::SetPassedHistogram ( const TH1 & rPassed,
Option_t * opt )

Sets the histogram containing the passed events.

The given histogram is cloned and stored internally as histogram containing the passed events. The given histogram has to be consistent with the current fTotalHistogram (see CheckConsistency(const TH1&,const TH1&)). The method returns whether the fPassedHistogram has been replaced (true) or not (false).

Note: The list of associated functions fFunctions is cleared.

Option:

  • "f": force the replacement without checking the consistency This can lead to inconsistent histograms and useless results or unexpected behaviour. But sometimes it might be the only way to change the histograms. If you use this option, you should ensure that the fTotalHistogram is replaced by a consistent one (with respect to rPassed) as well.

Definition at line 3561 of file TEfficiency.cxx.

◆ SetPosteriorAverage()

void TEfficiency::SetPosteriorAverage ( Bool_t on = true)
inline

Definition at line 144 of file TEfficiency.h.

◆ SetPosteriorMode()

void TEfficiency::SetPosteriorMode ( Bool_t on = true)
inline

Definition at line 143 of file TEfficiency.h.

◆ SetShortestInterval()

void TEfficiency::SetShortestInterval ( Bool_t on = true)
inline

Definition at line 145 of file TEfficiency.h.

◆ SetStatisticOption()

void TEfficiency::SetStatisticOption ( EStatOption option)

Sets the statistic option which affects the calculation of the confidence interval.

Options:

  • kFCP (=0)(default): using the Clopper-Pearson interval (recommended by PDG) sets kIsBayesian = false see also ClopperPearson
  • kFNormal (=1) : using the normal approximation sets kIsBayesian = false see also Normal
  • kFWilson (=2) : using the Wilson interval sets kIsBayesian = false see also Wilson
  • kFAC (=3) : using the Agresti-Coull interval sets kIsBayesian = false see also AgrestiCoull
  • kFFC (=4) : using the Feldman-Cousins frequentist method sets kIsBayesian = false see also FeldmanCousins
  • kBJeffrey (=5) : using the Jeffrey interval sets kIsBayesian = true, fBeta_alpha = 0.5 and fBeta_beta = 0.5 see also Bayesian
  • kBUniform (=6) : using a uniform prior sets kIsBayesian = true, fBeta_alpha = 1 and fBeta_beta = 1 see also Bayesian
  • kBBayesian (=7) : using a custom prior defined by fBeta_alpha and fBeta_beta sets kIsBayesian = true see also Bayesian
  • kMidP (=8) : using the Lancaster Mid-P method sets kIsBayesian = false

Definition at line 3626 of file TEfficiency.cxx.

◆ SetTitle()

void TEfficiency::SetTitle ( const char * title)
overridevirtual

Sets the title.

Notes:

  • The titles of the internal histograms are set to "title + (total)" or "title + (passed)" respectively.
  • It is possible to label the axis of the histograms as usual (see TH1::SetTitle).

Example: Setting the title to "My Efficiency" and label the axis pEff->SetTitle("My Efficiency;x label;eff");

Reimplemented from TNamed.

Definition at line 3690 of file TEfficiency.cxx.

◆ SetTotalEvents()

Bool_t TEfficiency::SetTotalEvents ( Int_t bin,
Double_t events )

Sets the number of total events in the given global bin.

returns "true" if the number of total events has been updated otherwise "false" ist returned

Note: - requires: fPassedHistogram->GetBinContent(bin) <= events

Definition at line 3724 of file TEfficiency.cxx.

◆ SetTotalHistogram()

Bool_t TEfficiency::SetTotalHistogram ( const TH1 & rTotal,
Option_t * opt )

Sets the histogram containing all events.

The given histogram is cloned and stored internally as histogram containing all events. The given histogram has to be consistent with the current fPassedHistogram (see CheckConsistency(const TH1&,const TH1&)). The method returns whether the fTotalHistogram has been replaced (true) or not (false).

Note: The list of associated functions fFunctions is cleared.

Option:

  • "f": force the replacement without checking the consistency This can lead to inconsistent histograms and useless results or unexpected behaviour. But sometimes it might be the only way to change the histograms. If you use this option, you should ensure that the fPassedHistogram is replaced by a consistent one (with respect to rTotal) as well.

Definition at line 3755 of file TEfficiency.cxx.

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ SetUseWeightedEvents()

void TEfficiency::SetUseWeightedEvents ( Bool_t on = kTRUE)

Definition at line 3789 of file TEfficiency.cxx.

◆ SetWeight()

void TEfficiency::SetWeight ( Double_t weight)

Sets the global weight for this TEfficiency object.

Note: - weight has to be positive ( > 0)

Definition at line 3807 of file TEfficiency.cxx.

◆ Sizeof()

Int_t TNamed::Sizeof ( ) const
virtualinherited

Return size of the TNamed part of the TObject.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TDirectoryFile, TFile, and TKey.

Definition at line 182 of file TNamed.cxx.

◆ Streamer()

void TEfficiency::Streamer ( TBuffer & R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

◆ StreamerNVirtual()

void TEfficiency::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 194 of file TEfficiency.h.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

R__ALWAYS_INLINE Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ UseCurrentStyle()

void TObject::UseCurrentStyle ( )
virtualinherited

Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.

Reimplemented in TCanvas, TPad, TFrame, TPaveStats, TPaveText, TAxis3D, TGraph, TH1, and TTree.

Definition at line 909 of file TObject.cxx.

◆ UsesBayesianStat()

Bool_t TEfficiency::UsesBayesianStat ( ) const
inline

Definition at line 162 of file TEfficiency.h.

◆ UsesCentralInterval()

Bool_t TEfficiency::UsesCentralInterval ( ) const
inline

Definition at line 166 of file TEfficiency.h.

◆ UsesPosteriorAverage()

Bool_t TEfficiency::UsesPosteriorAverage ( ) const
inline

Definition at line 165 of file TEfficiency.h.

◆ UsesPosteriorMode()

Bool_t TEfficiency::UsesPosteriorMode ( ) const
inline

Definition at line 163 of file TEfficiency.h.

◆ UsesShortestInterval()

Bool_t TEfficiency::UsesShortestInterval ( ) const
inline

Definition at line 164 of file TEfficiency.h.

◆ UsesWeights()

Bool_t TEfficiency::UsesWeights ( ) const
inline

Definition at line 167 of file TEfficiency.h.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Wilson()

Double_t TEfficiency::Wilson ( Double_t total,
Double_t passed,
Double_t level,
Bool_t bUpper )
static

Calculates the boundaries for the frequentist Wilson interval.

Parameters
[in]totalnumber of total events
[in]passed0 <= number of passed events <= total
[in]levelconfidence level
[in]bUpper
  • true - upper boundary is returned
  • false - lower boundary is returned

Calculation:

\begin{eqnarray*} \alpha &=& 1 - \frac{level}{2}\\ \kappa &=& \Phi^{-1}(1 - \alpha,1) ...\ normal\ quantile\ function\\ mode &=& \frac{passed + \frac{\kappa^{2}}{2}}{total + \kappa^{2}}\\ \Delta &=& \frac{\kappa}{total + \kappa^{2}} * \sqrt{passed (1 - \frac{passed}{total}) + \frac{\kappa^{2}}{4}}\\ return &=& max(0,mode - \Delta)\ or\ min(1,mode + \Delta) \end{eqnarray*}

Definition at line 3837 of file TEfficiency.cxx.

◆ Write() [1/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
virtualinherited

Write this object to the current directory.

For more see the const version of this method.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, ROOT::TBufferMergerFile, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 989 of file TObject.cxx.

◆ Write() [2/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
virtualinherited

Write this object to the current directory.

The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".

Writing an object to a file involves the following steps:

  • Creation of a support TKey object in the current directory. The TKey object creates a TBuffer object.
  • The TBuffer object is filled via the class::Streamer function.
  • If the file is compressed (default) a second buffer is created to hold the compressed buffer.
  • Reservation of the corresponding space in the file by looking in the TFree list of free blocks of the file.
  • The buffer is written to the file.

Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.

If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().

The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.

An object is read from the file into memory via TKey::Read() or via TObject::Read().

The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 964 of file TObject.cxx.

Member Data Documentation

◆ fBeta_alpha

Double_t TEfficiency::fBeta_alpha
protected

Global parameter for prior beta distribution (default = 1)

Definition at line 47 of file TEfficiency.h.

◆ fBeta_beta

Double_t TEfficiency::fBeta_beta
protected

Global parameter for prior beta distribution (default = 1)

Definition at line 48 of file TEfficiency.h.

◆ fBeta_bin_params

std::vector<std::pair<Double_t, Double_t> > TEfficiency::fBeta_bin_params
protected

Parameter for prior beta distribution different bin by bin (default vector is empty)

Definition at line 49 of file TEfficiency.h.

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fBoundary

Double_t(* TEfficiency::fBoundary) (Double_t, Double_t, Double_t, Bool_t)
protected

! Pointer to a method calculating the boundaries of confidence intervals

Definition at line 51 of file TEfficiency.h.

◆ fConfLevel

Double_t TEfficiency::fConfLevel
protected

Confidence level (default = 0.683, 1 sigma)

Definition at line 52 of file TEfficiency.h.

◆ fDirectory

TDirectory* TEfficiency::fDirectory
protected

! Pointer to directory holding this TEfficiency object

Definition at line 53 of file TEfficiency.h.

◆ fFillColor

Color_t TAttFill::fFillColor
protectedinherited

Fill area color.

Definition at line 24 of file TAttFill.h.

◆ fFillStyle

Style_t TAttFill::fFillStyle
protectedinherited

Fill area style.

Definition at line 25 of file TAttFill.h.

◆ fFunctions

TList* TEfficiency::fFunctions
protected

->Pointer to list of functions

Definition at line 54 of file TEfficiency.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fLineColor

Color_t TAttLine::fLineColor
protectedinherited

Line color.

Definition at line 24 of file TAttLine.h.

◆ fLineStyle

Style_t TAttLine::fLineStyle
protectedinherited

Line style.

Definition at line 25 of file TAttLine.h.

◆ fLineWidth

Width_t TAttLine::fLineWidth
protectedinherited

Line width.

Definition at line 26 of file TAttLine.h.

◆ fMarkerColor

Color_t TAttMarker::fMarkerColor
protectedinherited

Marker color.

Definition at line 24 of file TAttMarker.h.

◆ fMarkerSize

Size_t TAttMarker::fMarkerSize
protectedinherited

Marker size.

Definition at line 26 of file TAttMarker.h.

◆ fMarkerStyle

Style_t TAttMarker::fMarkerStyle
protectedinherited

Marker style.

Definition at line 25 of file TAttMarker.h.

◆ fName

TString TNamed::fName
protectedinherited

Definition at line 32 of file TNamed.h.

◆ fPaintGraph

TGraphAsymmErrors* TEfficiency::fPaintGraph =nullptr
protected

! Temporary graph for painting

Definition at line 55 of file TEfficiency.h.

◆ fPaintGraph2D

TGraph2DAsymmErrors* TEfficiency::fPaintGraph2D =nullptr
protected

! Temporary graph for painting

Definition at line 56 of file TEfficiency.h.

◆ fPaintHisto

TH2* TEfficiency::fPaintHisto =nullptr
protected

! Temporary histogram for painting

Definition at line 57 of file TEfficiency.h.

◆ fPassedHistogram

TH1* TEfficiency::fPassedHistogram
protected

Histogram for events which passed certain criteria.

Definition at line 58 of file TEfficiency.h.

◆ fStatisticOption

EStatOption TEfficiency::fStatisticOption
protected

Defines how the confidence intervals are determined.

Definition at line 59 of file TEfficiency.h.

◆ fTitle

TString TNamed::fTitle
protectedinherited

Definition at line 33 of file TNamed.h.

◆ fTotalHistogram

TH1* TEfficiency::fTotalHistogram
protected

Histogram for total number of events.

Definition at line 60 of file TEfficiency.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.

◆ fWeight

Double_t TEfficiency::fWeight
protected

Weight for all events (default = 1)

Definition at line 61 of file TEfficiency.h.


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