Exemplo n.º 1
0
class TauEnergyScale:
    
    def __init__(self, year, algorithm):
        self.testool = TauESTool(YEARLIB[year], ALGOLIB[algorithm])
        self.tfestool = TauESTool(YEARLIB[year])

    #tlv is four vector to correct
    def applyES(self, tlv, dm, genmatch):
        if genmatch == 1 or genmatch == 3:
            if dm == 0 or dm == 1:
                tlv *= self.tfestool.getFES(tlv.Eta(), dm, genmatch)
            else:
                pass
        else:
            tlv *= self.tfestool.getTES(tlv.Pt(), dm, genmatch)
        return tlv

    #tlv is four vector to correct
    def readES(self, tlv, dm, genmatch):
        if genmatch == 1 or genmatch == 3:
            if dm == 0 or dm == 1:
                return self.tfestool.getFES(tlv.Eta(), dm, genmatch)
            else:
                return 1.
        else:
            return self.tfestool.getTES(tlv.Pt(), dm, genmatch)
Exemplo n.º 2
0
class TauEnergyScale:
    def __init__(self, year, algorithm):
        self.testool = TauESTool(YEARLIB[year], algorithm)
        self.tfestool = TauESTool(YEARLIB[year])

    def applyES(tlv, dm, genmatch):
        if genmatch == 1 or genmatch == 3:
            tlv *= self.tfestool.getFES(tlv.Eta(), dm, genmatch)
        else:
            tlv *= self.tfestool.getTES(tlv.Pt(), dm, genmatch)
        return tlv