コード例 #1
0
ファイル: VTauBuilder.py プロジェクト: jeyserma/cmgtools-lite
 def makeTauTau(self,event,taus):
     output=[]
     #If two di-taus build pair
     taus=sorted(taus,key=lambda x: x.pt(),reverse=True)
     if len(taus)>1:
         VV=Pair(taus[0],taus[1])
         VV.LV=VV.LV+event.met.p4()
         output.append(VV)
     return output
コード例 #2
0
    def makeTauJet(self, event, taus, jets):
        output = []
        #If two di-taus build pair but you need a lepton!
        if len(taus) > 0 and len(jets) > 0:
            #since we trigger with lepton find taus that have a lepton
            tausWithLeptons = []
            for t in taus:
                if t.nMuons + t.nElectrons > 0:
                    leptonsOK = False
                    for c in t.signalConstituents:
                        if abs(c.pdgId()) == 11 and c.pt() > 100.0:
                            leptonsOK = True
                            break
                        if abs(c.pdgId()) == 13 and c.pt() > 55.0:
                            leptonsOK = True
                            break
                    if leptonsOK:
                        tausWithLeptons.append(t)

            if len(tausWithLeptons) == 0:
                return output

            tau = max(tausWithLeptons, key=lambda x: x.pt())

            jet = max(jets, key=lambda x: x.pt())

            if deltaPhi(tau.phi(), jet.phi()) < 1:
                return output

            self.substructure(jet)
            if not hasattr(jet, 'substructure'):
                print 'No substructure'
                return output
            VV = Pair(tau, jet)
            VV.LV = VV.LV + event.met.p4()
            output.append(VV)
        return output