Hi all,
I have a question about the TEfficiency class. I am trying to calculate the error given by the division of two efficiencies (data and simulation) and for that I will try to generate random numbers using the posterior pdf of the efficiencies. If I understood correctly the documentation of TEfficiency, when using a uniform prior the posterior is still a Beta distribution with modified a,b parameters: a’=a+k, b’=a+n-k.
The following code shows the efficiency calculation in one bin. The efficiency returned is: 0.0176604693439. However, the function’s integral tells me that the mode is in a higher position (around 0.0183 as shown in the plot). Do you know what might be the cause of this?
Thanks,
Christos Vergis
if(ROOT.TEfficiency.CheckConsistency(hpas2,htot2)):
ef = ROOT.TEfficiency(hpas2, htot2)
ef.SetPosteriorMode()
ef.SetStatisticOption(ROOT.TEfficiency.kBUniform)
n = htot2.GetBinContent(5) #969.47479248
k = hpas2.GetBinContent(5) #17.1213798523
apr = ef.GetBetaAlpha(5)+k
bpr = ef.GetBetaBeta(5)+n-k
fun = ROOT.TF1("fun","TMath::BetaDist(x,%s,%s)"%(apr,bpr),0,1)
fun.SetNpx(10000)
fun.DrawIntegral()
print ef.GetEfficiency(5),ef.GetEfficiencyErrorLow(5),ef.GetEfficiencyErrorUp(5)