コード例 #1
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)
コード例 #2
0
    

    # canvas
    outfile.cd()
    c1 = rt.TCanvas(lept)
    c1.cd()
    fancyHist.Draw()
    c1.SetLogy()
    fancyHist.Write()
    c1.Write()
    c1.SaveAs("plots/TFs_" + lept + ".pdf")


    # make a table
    caption = "Values of the transfer factors and the yields in the " + str(lept) + "s final state."
    fl.makeTable("QCDSumaryTable_" + lept, SRx_doubleArray, SRx_Header, True, caption , False, True)



#eo lopp over the lept


outfile.Close()


# save the dict
with open ("jsonFiles/N_QCD.json", 'w') as f:
    json.dump(N_QCD_dict, f)

with open ("jsonFiles/N_QCD_err.json", 'w') as f:
    json.dump(N_QCD_err_dict, f)
コード例 #3
0
    # eo loop over the dataset
    

    # add bkgd sum
    Yield_Sum = bgMCSum1.GetBinContent(1)
    Yield_Sum_err = bgMCSum1.GetBinError(1)
    Yield_Sum_ = ufloat (Yield_Sum, Yield_Sum_err)

    skimmedDoubleArray.append(["Background Sum", Yield_Sum_])



    # save the double array into pdf
    myHeader= ["Source", "Yield"]
    fl.makeTable("YieldTable_DCR" + chan, skimmedDoubleArray, myHeader, True, "Yield in the DCR", False)


    # print the summary contained it the double array
#    for i in range (0,len(doubleArray)):
#
#        print "---------"
#        print "NEW SAMPLE!!!"
#        print "---------"
#        for j in range (0,len(doubleArray[i])):
#            print doubleArray[i][j]
#        print ""
#        print ""
#    
    
コード例 #4
0
			uncertaintyMaxPercent = "-"
		
        
                # Sum the square of the uncertainties
                CurrentUnc=uncertaintyMax
                SumUnc=SumUnc+CurrentUnc*CurrentUnc
    
                # 
                singleArray.append(uncertaintyMaxPercent)
    
    
            # eo systType loop 
            
            # add the tot uncertainty for each samples
            headers.append("total")
            singleArray.append(str(round(100*sqrt(SumUnc), 2))+" %")
            
    
            doubleArray.append(singleArray)
    
    # eo loop over the samples 



    # save the table in pdf
    fl.makeTable("SystematicsTable_"+chan, doubleArray, headers, True, "List of the systemtic uncertainties for each sample in the " + chan + " channel.", False)