Esempio n. 1
0
    def makeJJ(self, event):
        output = []

        # loop on the leptons
        leptons = filter(
            lambda x: (abs(x.pdgId()) == 11 and x.heepID) or
            (abs(x.pdgId()) == 13 and x.highPtIDIso), event.selectedLeptons)
        fatJets = self.selectJets(
            event.jetsAK8, lambda x: x.pt() > 200.0 and abs(x.eta()) < 2.4 and
            x.jetID('POG_PFID_Tight'), leptons, 1.0)

        if len(fatJets) < 2:
            return output

        VV = Pair(fatJets[0], fatJets[1])

        # kinematics
        if abs(VV.leg1.eta() - VV.leg2.eta()) > 1.3 or VV.mass() < 1000:
            return output

        self.substructure(VV.leg1, event)
        self.substructure(VV.leg2, event)

        # substructure changes jet, so we need to recalculate the resonance
        # mass
        VV = Pair(fatJets[0], fatJets[1])

        # substructure truth
        if self.cfg_comp.isMC:
            self.substructureGEN(VV.leg2, event)
            self.substructureGEN(VV.leg1, event)
            if hasattr(VV.leg2, 'substructureGEN') and hasattr(
                    VV.leg1, 'substructureGEN'):
                VV.genPartialMass = (VV.leg1.substructureGEN.jet +
                                     VV.leg2.substructureGEN.jet).M()

        if not hasattr(VV.leg1, "substructure"):
            return output

        if not hasattr(VV.leg2, "substructure"):
            return output

        # check if there are subjets

        # if len(VV.leg2.substructure.prunedSubjets)<2 or len(VV.leg1.substructure.prunedSubjets)<2:
        #     print 'No substructure'
        #     return output

        # topology
        satteliteJets = self.selectJets(
            event.jets, lambda x: x.pt() > 30.0 and x.jetID('POG_PFID_Tight'),
            leptons, 0.3, [VV.leg1, VV.leg2], 0.8)
        self.topology(VV, satteliteJets, leptons)
        output.append(VV)
        return output
Esempio n. 2
0
    def makeJJ(self, event):
        output = []

        #loop on the leptons
        leptons = filter(
            lambda x: (abs(x.pdgId()) == 11 and x.heepID) or
            (abs(x.pdgId()) == 13 and x.highPtIDIso), event.selectedLeptons)
        fatJets = self.selectJets(
            event.jetsAK8, lambda x: x.pt() > 200.0 and abs(x.eta()) < 2.4 and
            x.jetID('POG_PFID_Tight'), leptons, 1.0)

        if len(fatJets) < 2:
            return output

        VV = Pair(fatJets[0], fatJets[1])

        #kinematics
        if abs(VV.leg1.eta() - VV.leg2.eta()) > 1.3 or VV.mass() < 1000:
            return output

        self.substructure(VV.leg1, event)
        self.substructure(VV.leg2, event)

        if not hasattr(VV.leg1, "substructure"):
            return output

        if not hasattr(VV.leg2, "substructure"):
            return output

        #check if there are subjets

#      if len(VV.leg2.substructure.prunedSubjets)<2 or len(VV.leg1.substructure.prunedSubjets)<2:
#          print 'No substructure'
#          return output

#topology
        satteliteJets = self.selectJets(
            event.jets, lambda x: x.pt() > 30.0 and x.jetID('POG_PFID_Loose'),
            leptons, 0.3, [VV.leg1, VV.leg2], 0.8)
        self.topology(VV, satteliteJets, leptons)
        output.append(VV)
        return output
Esempio n. 3
0
    def makeJJ(self, event):
        output = []

        if len(event.jetsAK8) == 0: return output

        if not (event.jetsAK8[0].jetID('POG_PFID_TightLepVeto')): return output

        evt = event.input.eventAuxiliary().id().event()
        lumi = event.input.eventAuxiliary().id().luminosityBlock()
        run = event.input.eventAuxiliary().id().run()
        debug = False
        #if evt == 7276 and lumi == 43: debug = True
        #if not debug: return output

        if debug: print "******** FOUND EVENT ************* ", run, lumi, evt

        # loop on the leptons
        leptons = filter(
            lambda x: (abs(x.pdgId()) == 11 and x.heepID) or
            (abs(x.pdgId()) == 13 and x.highPtIDIso), event.selectedLeptons)
        fatJets = self.selectJets(
            event.jetsAK8, lambda x: x.pt() > 200.0 and abs(x.eta()) < 2.4 and
            x.jetID('POG_PFID_TightLepVeto'), leptons, 0.8)

        if len(fatJets) < 2:
            return output

        if debug: print "----------------- BEFORE SORTING ----------------- "
        i = 1
        for j in fatJets:
            if debug:
                print " * jet ", i, " pt ", j.pt(), " eta ", j.eta(
                ), " phi ", j.phi()
            i += 1

        fatJets = fatJets[:2]
        if evt % 2 != 0: fatJets = list(reversed(fatJets))

        if debug:
            print "----------------- AFTER SORTING ----------------- "
            i = 1
            for j in fatJets:
                #print " * jet ",i," pt ", j.pt(), " eta ", j.eta(), " mass no corr ",j.substructure.softDropJetMassBare, " mass corr ",j.substructure.softDropJetMassBare*j.substructure.softDropJetMassCor," tau21 ", j.substructure.ntau[1]/j.substructure.ntau[0]
                print " * jet ", i, " pt ", j.pt(), " eta ", j.eta()
                i += 1

        VV = Pair(fatJets[0], fatJets[1])

        # kinematics
        if abs(VV.leg1.eta() - VV.leg2.eta()) > 1.3 or VV.mass() < 700:
            return output

        self.substructure(VV.leg1, event)
        self.substructure(VV.leg2, event)

        # substructure changes jet, so we need to recalculate the resonance mass
        VV = Pair(fatJets[0], fatJets[1])

        if debug:
            print "----------------- AFTER PARING ----------------- "
            print " * VV leg1 pt ", VV.leg1.pt(), " eta ", VV.leg1.eta()
            print " * VV leg2 pt ", VV.leg2.pt(), " eta ", VV.leg2.eta()
            print "    === VV mass ", VV.mass(), " deta ", abs(
                VV.leg1.eta() - VV.leg2.eta()), " ======"

        # substructure truth
        if self.cfg_comp.isMC:
            self.substructureGEN(VV.leg2, event)
            self.substructureGEN(VV.leg1, event)
            if hasattr(VV.leg2, 'substructureGEN') and hasattr(
                    VV.leg1, 'substructureGEN'):
                VV.genPartialMass = (VV.leg1.substructureGEN.jet +
                                     VV.leg2.substructureGEN.jet).M()

        if debug:
            print "    === VV gen mass ", (
                VV.leg1.substructureGEN.jet +
                VV.leg2.substructureGEN.jet).M(), " ======"

        if not hasattr(VV.leg1, "substructure"):
            return output

        if not hasattr(VV.leg2, "substructure"):
            return output

        # check if there are subjets

        # if len(VV.leg2.substructure.prunedSubjets)<2 or len(VV.leg1.substructure.prunedSubjets)<2:
        #     print 'No substructure'
        #     return output

        # topology
        satteliteJets = self.selectJets(
            event.jets, lambda x: x.pt() > 30.0 and x.jetID('POG_PFID_Tight'),
            leptons, 0.3, [VV.leg1, VV.leg2], 0.8)
        self.topology(VV, satteliteJets, leptons)
        output.append(VV)
        return output