Efficiency uncertainties to be computed with Copper-Pearson
Formula to be used for uncertainty computation in line: https://gitlab.cern.ch/cms-muonPOG/spark_tnp/-/blob/master/prepare.py#L27
should be something like:
def generateClopperPearsonInterval(num,den):
confidenceLevel = 0.68
alpha = 1 - confidenceLevel
lowerLimit = round(ROOT.Math.beta_quantile(alpha/2,num,den-num + 1),4)
if num==den:
upperLimit=1
else:
upperLimit = round(ROOT.Math.beta_quantile(1-alpha/2,num + 1,den-num),4)
return lowerLimit,upperLimit
the function computeEff
will then provide 3 numbers (eff, up_err, low_err)
This is called in many parts of prepare.py
:
-
getEff
function -
geDatatEff
function
Both propagated to getSF_cutAndCount
and getSF
For the plotting part: we define histograms bin-by-bin https://gitlab.cern.ch/cms-muonPOG/spark_tnp/-/blob/master/prepare.py#L454
Should switch to TGraphAsymmErrors https://root.cern.ch/root/html534/TGraphAsymmErrors.html