Ejemplo n.º 1
0
"""
This script aims at testing each funtion of the facoLib.py file.

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 name
        

        
        # loop over the systShifts
        for systShift in systShifts:
            value = -99


            if systShift == "central" :
                value = 1.0

            # DYJets
            elif "DYJets" in name:
                if systShift == "down" :
                    value = 1 - fl.combinedRelUncertainty(1921.8,[0.6, 33.2], False)
                elif systShift == "up":
                    value = 1 + fl.combinedRelUncertainty(1921.8,[0.6, 33.2], False)
                else:
                    print "error!! ", systShift, "not in ", systShifts

            # TTjets
            elif "TTJets" in name:
                if systShift == "down" :
                    value = 1 - fl.combinedRelUncertainty(815,[28.61, 34.38, 21.95], False)
                elif systShift == "up":
                    value = 1 + fl.combinedRelUncertainty(815.96, [19.37, 34.38, 22.67], False)
                else:
                    print "error!! ", systShift, "not in ", systShifts
                    
            # tW