Hi,
For my efficiency calculation using two TH1D’s, I compared TEfficiency and the function Divide(), and I noticed a difference in the error estimation. This is an example code in pyRoot:
import ROOT
h1 = ROOT.TH1D(“h1”, “h1”, 1, 0, 100)
h2 = ROOT.TH1D(“h2”,“h2”, 1, 0, 100)r = ROOT.TRandom3()
for i in range(0, 100000):
h1.Fill(r.Gaus(50,50))
if i%10==0:
h2.Fill(r.Gaus(50,50))hTEff = ROOT.TEfficiency(h2,h1)
hTEff.SetStatisticOption(ROOT.TEfficiency.kFNormal)hDiv = ROOT.TH1D(“hDiv”, “hDiv”, 1, 0, 100)
hDiv.Divide(h2,h1,1,1,“B”)canv = ROOT.TCanvas()
canv.Divide(2,2)
canv.cd(1)
h1.Draw()
canv.cd(2)
h2.Draw()
canv.cd(3)
hDiv.Draw(“pe”)
canv.cd(4)
hTEff.Draw()
canv.Print(“TEff_vs_Divide.pdf”)
Does anyone know why my errors are not the same? Since I am using the same error estimation method, I expected the same result.
Thanks!
ROOT Version: v6-10-06
Platform: macOS
Compiler: Python