# set bin label
        fancyHist.GetXaxis().SetBinLabel(1 + i_SR * 5, "SR"+str(SR) )
        fancyHist.GetXaxis().SetBinLabel(5 + i_SR * 5, "Average" )

        # save the value in the dictionary
        N_QCD_dict["SR" + str(SR) + "_" + lept] = N_QCD_.nominal_value
        N_QCD_err_dict["SR" + str(SR) + "_" + lept] = N_QCD_.std_dev



        
        # calculate the systematic uncertainty
        TF_sys = (max(TFs_list) - min(TFs_list))
        TF_sys_rel = TF_sys/ TF_mean
        SRx_SingleArray.append(fl.floatToPercent(TF_sys_rel))
        SRx_Header.append("Systematic")

        # put it in a dict
        N_QCD_syst_dict["SR" + str(SR) + "_" + lept] = TF_sys_rel


        # put the single array in the double array
        SRx_doubleArray.append(SRx_SingleArray)

    # eo loop over the SRs

    # style
    fancyHist.SetMaximum(1)
    fancyHist.SetMinimum(0.0001)
    fancyHist.SetYTitle("TF(DCR->SRi)")
Exemplo n.º 2
1
qpython 31.08.2016
"""
import facoLib as fl


msg = "testing new function ...\n"


print msg
print fl.combinedRelUncertainty(100, [40., 80], True)

print msg
print fl.combinedUncertainty([40., 80], True)

print msg
x = 4
y = 6
z = 2.1
myDoubleArray = [[0, 1, 2], [x, y, z]]
myHeader = ["this", "stuff", "is great"]
print fl.makeTable("testOutput", myDoubleArray, myHeader, True, "any caption", True)


print msg
print fl.getDictFromJson("WW", "", True)


print msg
print fl.floatToPercent(0.12)