diff --git a/H2TauTau/python/proto/analyzers/LeptonWeighter.py b/H2TauTau/python/proto/analyzers/LeptonWeighter.py index 613ac1d6d69a..3e0a7f18a7b2 100644 --- a/H2TauTau/python/proto/analyzers/LeptonWeighter.py +++ b/H2TauTau/python/proto/analyzers/LeptonWeighter.py @@ -70,10 +70,10 @@ def process(self, event): iso = None if hasattr(lep, 'muonId'): # muon - iso = lep.relIsoR(R=0.4, dBetaFactor=0.5) + iso = lep.relIso(0.4, dbeta_factor=0.5) if hasattr(lep, 'mvaNonTrigV0'): # electron - iso = lep.relIsoR(R=0.3, dBetaFactor=0.5) + iso = lep.relIso(R=0.3, dbeta_factor=0.5) # Get scale factors for sf_name, sf in self.scaleFactors.items(): diff --git a/H2TauTau/python/proto/analyzers/MuEleAnalyzer.py b/H2TauTau/python/proto/analyzers/MuEleAnalyzer.py index 84cc04197dc4..c7a7f669de79 100644 --- a/H2TauTau/python/proto/analyzers/MuEleAnalyzer.py +++ b/H2TauTau/python/proto/analyzers/MuEleAnalyzer.py @@ -183,7 +183,7 @@ def testLeg2Iso(self, muon, isocut): '''Muon isolation to be implemented''' if isocut is None: isocut = self.cfg_ana.iso2 - return muon.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) < isocut + return muon.relIso(0.4, dbeta_factor=0.5, all_charged=0) < isocut def testVertex(self, lepton): '''Tests vertex constraints, for mu and electron''' @@ -202,7 +202,7 @@ def testLeg1Iso(self, electron, isocut): ''' if isocut is None: isocut = self.cfg_ana.iso2 - return electron.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < isocut + return electron.relIso(0.3, dbeta_factor=0.5, all_charged=0) < isocut def otherLeptonVeto(self, leptons, otherLeptons, isocut=None): '''Second electron veto ''' @@ -212,7 +212,7 @@ def otherLeptonVeto(self, leptons, otherLeptons, isocut=None): electron.passConversionVeto() and electron.gsfTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS) <= 1 and electron.mvaIDRun2('NonTrigSpring15MiniAOD', 'POG90') and - electron.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < 0.3] + electron.relIso(0.3, dbeta_factor=0.5, all_charged=0) < 0.3] if len(vOtherLeptons) > 1: return False @@ -226,7 +226,7 @@ def thirdLeptonVeto(self, leptons, otherLeptons, isocut=None): muon.muonIDMoriond17() and self.testVertex(muon) and self.testLegKine(muon, ptcut=10, etacut=2.4) and - muon.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=False) < 0.3] + muon.relIso(0.4, dbeta_factor=0.5, all_charged=False) < 0.3] if len(vLeptons) > 1: return False @@ -247,9 +247,10 @@ def bestDiLepton(self, diLeptons): if len(diLeptons) == 1: return diLeptons[0] - minRelIso = min(d.leg2().relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) for d in diLeptons) + minRelIso = min(d.leg2().relIso(0.4, dbeta_factor=0.5, all_charged=0) for d in diLeptons) - diLeps = [dil for dil in diLeptons if dil.leg2().relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) == minRelIso] + diLeps = [dil for dil in diLeptons if dil.leg2().relIso(0.4, + dbeta_factor=0.5, all_charged=0) == minRelIso] if len(diLeps) == 1: return diLeps[0] @@ -261,9 +262,9 @@ def bestDiLepton(self, diLeptons): if len(diLeps) == 1: return diLeps[0] - minIso = min(d.leg1().relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) for d in diLeps) + minIso = min(d.leg1().relIso(0.3, dbeta_factor=0.5, all_charged=0) for d in diLeps) - diLeps = [dil for dil in diLeps if dil.leg1().relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) == minIso] + diLeps = [dil for dil in diLeps if dil.leg1().relIso(0.3, dbeta_factor=0.5, all_charged=0) == minIso] if len(diLeps) == 1: return diLeps[0] diff --git a/H2TauTau/python/proto/analyzers/MuMuAnalyzer.py b/H2TauTau/python/proto/analyzers/MuMuAnalyzer.py index 92691083ba7e..c63186b9687d 100644 --- a/H2TauTau/python/proto/analyzers/MuMuAnalyzer.py +++ b/H2TauTau/python/proto/analyzers/MuMuAnalyzer.py @@ -186,7 +186,7 @@ def testLeg2Iso(self, muon, isocut): if isocut is None: isocut = self.cfg_ana.iso2 - return muon.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) < isocut + return muon.relIso(0.4, dbeta_factor=0.5, all_charged=0) < isocut def testElectronID(self, electron): return electron.mvaIDRun2('Spring16', 'POG90') @@ -212,7 +212,7 @@ def otherLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): self.testElectronID(electron) and electron.passConversionVeto() and electron.physObj.gsfTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS) <= 1 and - electron.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) < 0.3] + electron.relIso(0.4, dbeta_factor=0.5, all_charged=0) < 0.3] if len(vOtherLeptons) > 0: return False @@ -239,7 +239,7 @@ def bestDiLepton(self, diLeptons): if len(diLeptons) == 1: return diLeptons[0] - least_iso_highest_pt = lambda dl: (dl.leg1().relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0), -dl.leg1().pt(), dl.leg2().relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0), -dl.leg2().pt()) + least_iso_highest_pt = lambda dl: (dl.leg1().relIso(0.4, dbeta_factor=0.5, all_charged=0), -dl.leg1().pt(), dl.leg2().relIso(0.4, dbeta_factor=0.5, all_charged=0), -dl.leg2().pt()) return sorted(diLeptons, key=lambda dil : least_iso_highest_pt(dil))[0] diff --git a/H2TauTau/python/proto/analyzers/TauEleAnalyzer.py b/H2TauTau/python/proto/analyzers/TauEleAnalyzer.py index 507cf42ed709..ebf44317ba76 100644 --- a/H2TauTau/python/proto/analyzers/TauEleAnalyzer.py +++ b/H2TauTau/python/proto/analyzers/TauEleAnalyzer.py @@ -97,7 +97,7 @@ def buildLeptons(self, cms_leptons, event): pyl.rho = event.rho pyl.event = event.input.object() - if pyl.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) > 0.3: + if pyl.relIso(0.3, dbeta_factor=0.5, all_charged=0) > 0.3: continue leptons.append(pyl) @@ -212,14 +212,14 @@ def testLeg1ID(self, electron): def testLeg1Iso(self, leg, isocut): # electron if isocut is None: isocut = self.cfg_ana.iso2 - return leg.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < isocut + return leg.relIso(0.3, dbeta_factor=0.5, all_charged=0) < isocut def testLooseleg1(self, leg): # electrons ''' pt, eta and isolation selection for electrons used in the di-electron veto. pt 15, eta 2.5, dB relIso 0.3 ''' - if (leg.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) > 0.3 or + if (leg.relIso(0.3, dbeta_factor=0.5, all_charged=0) > 0.3 or abs(leg.eta()) > 2.5 or leg.pt() < 15 or not self.testVetoElectronID(leg) or @@ -233,7 +233,7 @@ def testTightOtherLepton(self, muon): self.testVertex(muon) and \ abs(muon.eta()) < 2.4 and \ muon.pt() > 10. and \ - muon.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) < 0.3 + muon.relIso(0.4, dbeta_factor=0.5, all_charged=0) < 0.3 def otherLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): # count veto muons @@ -241,7 +241,7 @@ def otherLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): muon.muonIDMoriond17() and self.testVertex(muon) and self.testLegKine(muon, ptcut=10, etacut=2.4) and - muon.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) < 0.3] + muon.relIso(0.4, dbeta_factor=0.5, all_charged=0) < 0.3] if len(vOtherLeptons) > 0: return False @@ -254,7 +254,7 @@ def thirdLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): self.testLegKine(electron, ptcut=10, etacut=2.5) and self.testVertex(electron) and self.testElectronID(electron) and - electron.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < 0.3] + electron.relIso(0.3, dbeta_factor=0.5, all_charged=0) < 0.3] if len(vLeptons) > 1: return False @@ -285,7 +285,7 @@ def bestDiLepton(self, diLeptons): if len(diLeptons) == 1: return diLeptons[0] - least_iso_highest_pt = lambda dl: (dl.leg1().relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0), -dl.leg1().pt(), -dl.leg2().tauID("byIsolationMVArun2v1DBoldDMwLTraw"), -dl.leg2().pt()) + least_iso_highest_pt = lambda dl: (dl.leg1().relIso(0.3, dbeta_factor=0.5, all_charged=0), -dl.leg1().pt(), -dl.leg2().tauID("byIsolationMVArun2v1DBoldDMwLTraw"), -dl.leg2().pt()) return sorted(diLeptons, key=lambda dil : least_iso_highest_pt(dil))[0] diff --git a/H2TauTau/python/proto/analyzers/TauJetMuAnalyzer.py b/H2TauTau/python/proto/analyzers/TauJetMuAnalyzer.py index fdd05dc4f449..0ccf20805ca3 100644 --- a/H2TauTau/python/proto/analyzers/TauJetMuAnalyzer.py +++ b/H2TauTau/python/proto/analyzers/TauJetMuAnalyzer.py @@ -162,7 +162,7 @@ def testLeg1Iso(self, muon, isocut): if isocut is None: isocut = self.cfg_ana.iso2 - return muon.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=False) < isocut + return muon.relIso(0.3, dbeta_factor=0.5, all_charged=False) < isocut def thirdLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): # count tight muons @@ -170,7 +170,7 @@ def thirdLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): muon.muonIDMoriond17() and self.testVertex(muon) and self.testLegKine(muon, ptcut=10, etacut=2.4) and - muon.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=False) < 0.3] + muon.relIso(0.3, dbeta_factor=0.5, all_charged=False) < 0.3] if len(vLeptons) > 1: return False @@ -189,7 +189,7 @@ def otherLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): self.testElectronID(electron) and electron.passConversionVeto() and electron.physObj.gsfTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS) <= 1 and - electron.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < 0.3] + electron.relIso(0.3, dbeta_factor=0.5, all_charged=0) < 0.3] if len(vOtherLeptons) > 0: return False @@ -233,7 +233,7 @@ def bestDiLepton(self, diLeptons): if len(diLeptons) == 1: return diLeptons[0] - least_iso_highest_pt = lambda dl: (dl.leg1().relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0), -dl.leg1().pt(), -dl.leg2().pt()) + least_iso_highest_pt = lambda dl: (dl.leg1().relIso(0.3, dbeta_factor=0.5, all_charged=0), -dl.leg1().pt(), -dl.leg2().pt()) return sorted(diLeptons, key=lambda dil : least_iso_highest_pt(dil))[0] diff --git a/H2TauTau/python/proto/analyzers/TauMuAnalyzer.py b/H2TauTau/python/proto/analyzers/TauMuAnalyzer.py index 7a2c5a6a3439..e373475b136e 100644 --- a/H2TauTau/python/proto/analyzers/TauMuAnalyzer.py +++ b/H2TauTau/python/proto/analyzers/TauMuAnalyzer.py @@ -187,7 +187,7 @@ def testLeg1Iso(self, muon, isocut): if isocut is None: isocut = self.cfg_ana.iso2 - return muon.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=False) < isocut + return muon.relIso(0.4, dbeta_factor=0.5, all_charged=False) < isocut def thirdLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): # count tight muons @@ -215,7 +215,7 @@ def otherLeptonVeto(self, leptons, otherLeptons, isoCut=0.3): self.testElectronID(electron) and electron.passConversionVeto() and electron.physObj.gsfTrack().hitPattern().numberOfHits(ROOT.reco.HitPattern.MISSING_INNER_HITS) <= 1 and - electron.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < 0.3] + electron.relIso(0.3, dbeta_factor=0.5, all_charged=0) < 0.3] if len(vOtherLeptons) > 0: return False @@ -259,7 +259,7 @@ def bestDiLepton(self, diLeptons): if len(diLeptons) == 1: return diLeptons[0] - least_iso_highest_pt = lambda dl: (dl.leg1().relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0), -dl.leg1().pt(), -dl.leg2().tauID("byIsolationMVArun2v1DBoldDMwLTraw"), -dl.leg2().pt()) + least_iso_highest_pt = lambda dl: (dl.leg1().relIso(0.4, dbeta_factor=0.5, all_charged=0), -dl.leg1().pt(), -dl.leg2().tauID("byIsolationMVArun2v1DBoldDMwLTraw"), -dl.leg2().pt()) return sorted(diLeptons, key=lambda dil : least_iso_highest_pt(dil))[0] diff --git a/H2TauTau/python/proto/analyzers/TauTauAnalyzer.py b/H2TauTau/python/proto/analyzers/TauTauAnalyzer.py index 755ff69ef948..3031b2757d06 100644 --- a/H2TauTau/python/proto/analyzers/TauTauAnalyzer.py +++ b/H2TauTau/python/proto/analyzers/TauTauAnalyzer.py @@ -168,7 +168,7 @@ def buildOtherLeptons(self, cmgLeptons, event): pyl.event = event.input.object() if not pyl.muonIDMoriond17(): continue - if not pyl.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0) < 0.3: + if not pyl.relIso(0.4, dbeta_factor=0.5, all_charged=0) < 0.3: continue if not self.testLegKine(pyl, ptcut=10, etacut=2.4): continue @@ -185,7 +185,7 @@ def buildLeptons(self, cmgOtherLeptons, event): pyl.event = event.input.object() if not pyl.mvaIDRun2('Spring16', 'POG90'): continue - if not pyl.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0) < 0.3: + if not pyl.relIso(0.3, dbeta_factor=0.5, all_charged=0) < 0.3: continue if not self.testLegKine(pyl, ptcut=10, etacut=2.5): continue diff --git a/H2TauTau/python/proto/analyzers/TreeVariables.py b/H2TauTau/python/proto/analyzers/TreeVariables.py index 09643de20380..8b2be897cf34 100644 --- a/H2TauTau/python/proto/analyzers/TreeVariables.py +++ b/H2TauTau/python/proto/analyzers/TreeVariables.py @@ -145,16 +145,16 @@ def default(): Variable('eid_tight', lambda ele : ele.cutBasedId('POG_SPRING15_25ns_v1_Tight')), Variable('nhits_missing', lambda ele : ele.physObj.gsfTrack().hitPattern().numberOfHits(1), int), Variable('pass_conv_veto', lambda ele : ele.passConversionVeto()), - Variable('reliso05', lambda lep : lep.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0)), - Variable('reliso05_04', lambda lep : lep.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0)), - Variable('reliso05_04', lambda lep : lep.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0)), + Variable('reliso05', lambda lep : lep.relIso(0.3, dbeta_factor=0.5, all_charged=0)), + Variable('reliso05_04', lambda lep : lep.relIso(0.4, dbeta_factor=0.5, all_charged=0)), + Variable('reliso05_04', lambda lep : lep.relIso(0.4, dbeta_factor=0.5, all_charged=0)), Variable('weight_tracking', lambda lep : getattr(lep, 'weight_tracking', 1.)), ] # muon muon_vars = [ - Variable('reliso05', lambda lep : lep.relIsoR(R=0.4, dBetaFactor=0.5, allCharged=0)), - Variable('reliso05_03', lambda lep : lep.relIsoR(R=0.3, dBetaFactor=0.5, allCharged=0)), + Variable('reliso05', lambda lep : lep.relIso(0.4, dbeta_factor=0.5, all_charged=0)), + Variable('reliso05_03', lambda lep : lep.relIso(0.3, dbeta_factor=0.5, all_charged=0)), Variable('muonid_loose', lambda muon : muon.muonID('POG_ID_Loose')), Variable('muonid_medium', lambda muon : muon.muonID('POG_ID_Medium_ICHEP')), Variable('muonid_tight', lambda muon : muon.muonID('POG_ID_Tight')), diff --git a/HToZZ4L/python/analyzers/zzTypes.py b/HToZZ4L/python/analyzers/zzTypes.py index ca40da7a0c25..e45a944192a4 100644 --- a/HToZZ4L/python/analyzers/zzTypes.py +++ b/HToZZ4L/python/analyzers/zzTypes.py @@ -7,16 +7,16 @@ # ---------------------- # Extra isolation variables NTupleVariable("relIsoAfterFSR", lambda x : x.relIsoAfterFSR, help="RelIso after FSR"), - NTupleVariable("chargedHadIso04", lambda x : x.chargedHadronIsoR(0.4), help="PF Abs Iso, R=0.4, charged hadrons only"), - NTupleVariable("neutralHadIso04", lambda x : x.neutralHadronIsoR(0.4), help="PF Abs Iso, R=0.4, neutral hadrons only"), - NTupleVariable("photonIso04", lambda x : x.photonIsoR(0.4), help="PF Abs Iso, R=0.4, photons only"), - NTupleVariable("puChargedHadIso04", lambda x : x.puChargedHadronIsoR(0.4), help="PF Abs Iso, R=0.4, pileup charged hadrons only"), + NTupleVariable("chargedHadIso04", lambda x : x.chargedHadronIso(0.4), help="PF Abs Iso, R=0.4, charged hadrons only"), + NTupleVariable("neutralHadIso04", lambda x : x.neutralHadronIso(0.4), help="PF Abs Iso, R=0.4, neutral hadrons only"), + NTupleVariable("photonIso04", lambda x : x.photonIso(0.4), help="PF Abs Iso, R=0.4, photons only"), + NTupleVariable("puChargedHadIso04", lambda x : x.puChargedHadronIso(0.4), help="PF Abs Iso, R=0.4, pileup charged hadrons only"), NTupleVariable("rho", lambda x : x.rho, help="rho for isolation"), NTupleVariable("EffectiveArea04", lambda x : x.EffectiveArea04, help="EA for isolation"), - NTupleVariable("chargedHadIso03", lambda x : x.chargedHadronIsoR(0.3), help="PF Abs Iso, R=0.3, charged hadrons only"), - NTupleVariable("neutralHadIso03", lambda x : x.neutralHadronIsoR(0.3), help="PF Abs Iso, R=0.3, neutral hadrons only"), - NTupleVariable("photonIso03", lambda x : x.photonIsoR(0.3), help="PF Abs Iso, R=0.3, photons only"), - NTupleVariable("puChargedHadIso03", lambda x : x.puChargedHadronIsoR(0.3), help="PF Abs Iso, R=0.3, pileup charged hadrons only"), + NTupleVariable("chargedHadIso03", lambda x : x.chargedHadronIso(0.3), help="PF Abs Iso, R=0.3, charged hadrons only"), + NTupleVariable("neutralHadIso03", lambda x : x.neutralHadronIso(0.3), help="PF Abs Iso, R=0.3, neutral hadrons only"), + NTupleVariable("photonIso03", lambda x : x.photonIso(0.3), help="PF Abs Iso, R=0.3, photons only"), + NTupleVariable("puChargedHadIso03", lambda x : x.puChargedHadronIso(0.3), help="PF Abs Iso, R=0.3, pileup charged hadrons only"), NTupleVariable("EffectiveArea03", lambda x : x.EffectiveArea03, help="EA for isolation"), # ---------------------- NTupleVariable("hasFSR", lambda x : len(x.fsrPhotons), int), @@ -67,7 +67,7 @@ NTupleVariable("mvaIdSpring15", lambda lepton : lepton.mvaRun2("NonTrigSpring15MiniAOD") if abs(lepton.pdgId()) == 11 else 1, help="EGamma POG MVA ID for non-triggering electrons, Spring15 re-training; 1 for muons"), # ---------------------- NTupleVariable("relIsoAfterFSR", lambda x : x.relIsoAfterFSR, help="RelIso after FSR"), - NTupleVariable("chargedHadIso03", lambda x : x.chargedHadronIsoR(0.3), help="PF Abs Iso, R=0.3, charged hadrons only"), + NTupleVariable("chargedHadIso03", lambda x : x.chargedHadronIso(0.3), help="PF Abs Iso, R=0.3, charged hadrons only"), # ---------------------- NTupleVariable("hasOwnFSR", lambda x : len(x.ownFsrPhotons), int), NTupleSubObject("p4WithFSR", lambda x : x.p4WithFSR(), fourVectorType), diff --git a/TTHAnalysis/python/analyzers/ttHTypes.py b/TTHAnalysis/python/analyzers/ttHTypes.py index 76dced121f22..6d496a30a3d1 100644 --- a/TTHAnalysis/python/analyzers/ttHTypes.py +++ b/TTHAnalysis/python/analyzers/ttHTypes.py @@ -25,7 +25,7 @@ NTupleVariable("miniRelIsoNeutral", lambda x : getattr(x,'miniAbsIsoNeutral',-99)/x.pt()), NTupleVariable("jetNDauChargedMVASel", lambda lepton : sum((deltaR(x.eta(),x.phi(),lepton.jet.eta(),lepton.jet.phi())<=0.4 and x.charge()!=0 and x.fromPV()>1 and x.hasTrackDetails() and qualityTrk(x.pseudoTrack(),lepton.associatedVertex)) for x in lepton.jet.daughterPtrVector()) if hasattr(lepton,'jet') and lepton.jet != lepton else 0, help="n charged daughters (with selection for ttH lepMVA) of nearest jet"), # More ID - NTupleVariable("chargedHadRelIso04", lambda x : x.chargedHadronIsoR(0.4)/x.pt(), help="PF Rel Iso, R=0.4, charged hadrons only"), + NTupleVariable("chargedHadRelIso04", lambda x : x.chargedHadronIso(0.4)/x.pt(), help="PF Rel Iso, R=0.4, charged hadrons only"), NTupleVariable("trackerLayers", lambda x : (x.track() if abs(x.pdgId())==13 else x.gsfTrack()).hitPattern().trackerLayersWithMeasurement(), int, help="Tracker Layers"), NTupleVariable("pixelLayers", lambda x : (x.track() if abs(x.pdgId())==13 else x.gsfTrack()).hitPattern().pixelLayersWithMeasurement(), int, help="Pixel Layers"), NTupleVariable("chargeConsistency", lambda lepton : ( lepton.isGsfCtfScPixChargeConsistent() + lepton.isGsfScPixChargeConsistent() ) if abs(lepton.pdgId()) == 11 else abs(lepton.muonBestTrack().charge() + lepton.innerTrack().charge() + lepton.tunePMuonBestTrack().charge() + ( lepton.globalTrack().charge() + lepton.outerTrack().charge() if lepton.isGlobalMuon() else 0) ), int, help="Tight charge criteria: for electrons, 2 if isGsfCtfScPixChargeConsistent, 1 if only isGsfScPixChargeConsistent, 0 otherwise; for muons, absolute value of the sum of all the charges (5 for global-muons, 3 for global muons)"), diff --git a/VVResonances/python/tools/VectorBosonToolBox.py b/VVResonances/python/tools/VectorBosonToolBox.py index 66d7c3b99099..aab29b457749 100644 --- a/VVResonances/python/tools/VectorBosonToolBox.py +++ b/VVResonances/python/tools/VectorBosonToolBox.py @@ -11,7 +11,7 @@ class VectorBosonToolBox(object): def WMuNuPFIsolation(self,z):#does nothing / for common interface footPrintLeg1=0.0 cleanedChargedIso = max(z.leg1.pfIsolationR04().sumChargedHadronPt,0.0) - cleanedNeutralIsoDB=max( z.leg1.neutralHadronIsoR(0.4)+z.leg1.photonIsoR(0.4)-z.leg1.puChargedHadronIsoR(0.4)/2, 0.0) + cleanedNeutralIsoDB=max( z.leg1.neutralHadronIso(0.4)+z.leg1.photonIso(0.4)-z.leg1.puChargedHadronIso(0.4)/2, 0.0) return (cleanedChargedIso+cleanedNeutralIsoDB)/z.leg1.pt()<0.2 @@ -27,8 +27,8 @@ def ZMuMuPFIsolation(self,z): cleanedChargedIso1 = max(z.leg1.pfIsolationR04().sumChargedHadronPt-footPrintLeg1,0.0) cleanedChargedIso2 = max(z.leg2.pfIsolationR04().sumChargedHadronPt-footPrintLeg2,0.0) - cleanedNeutralIsoDB1=max( z.leg1.neutralHadronIsoR(0.4)+z.leg1.photonIsoR(0.4)-z.leg1.puChargedHadronIsoR(0.4)/2, 0.0) - cleanedNeutralIsoDB2=max( z.leg2.neutralHadronIsoR(0.4)+z.leg2.photonIsoR(0.4)-z.leg2.puChargedHadronIsoR(0.4)/2, 0.0) + cleanedNeutralIsoDB1=max( z.leg1.neutralHadronIso(0.4)+z.leg1.photonIso(0.4)-z.leg1.puChargedHadronIso(0.4)/2, 0.0) + cleanedNeutralIsoDB2=max( z.leg2.neutralHadronIso(0.4)+z.leg2.photonIso(0.4)-z.leg2.puChargedHadronIso(0.4)/2, 0.0) return (cleanedChargedIso1+cleanedNeutralIsoDB1)/z.leg1.pt()<0.4 and (cleanedChargedIso2+cleanedNeutralIsoDB2)/z.leg2.pt()<0.4 @@ -48,8 +48,8 @@ def WENuPFIsolation(self,z): else: footPrintNeutralLeg1=footPrintNeutralLeg1+c.pt() - cleanedChargedIso = max(z.leg1.chargedHadronIsoR(0.4)-footPrintChargedLeg1,0.0) - cleanedNeutralIsoRho=max(z.leg1.neutralHadronIsoR(0.4)+z.leg1.photonIsoR(0.4)-footPrintNeutralLeg1-z.leg1.rho*z.leg1.EffectiveArea04,0) + cleanedChargedIso = max(z.leg1.chargedHadronIso(0.4)-footPrintChargedLeg1,0.0) + cleanedNeutralIsoRho=max(z.leg1.neutralHadronIso(0.4)+z.leg1.photonIso(0.4)-footPrintNeutralLeg1-z.leg1.rho*z.leg1.EffectiveArea04,0) return (cleanedChargedIso + cleanedNeutralIsoRho)/z.leg1.pt()<0.2 @@ -94,10 +94,10 @@ def ZEEPFIsolation(self,z): footPrintNeutralLeg1=footPrintNeutralLeg1+c.pt() - cleanedChargedIso1 = max(z.leg1.chargedHadronIsoR(0.4)-footPrintChargedLeg1,0.0) - cleanedChargedIso2 = max(z.leg1.chargedHadronIsoR(0.4)-footPrintChargedLeg2,0.0) - cleanedNeutralIsoRho1=max(z.leg1.neutralHadronIsoR(0.4)+z.leg1.photonIsoR(0.4)-footPrintNeutralLeg1-z.leg1.rho*z.leg1.EffectiveArea04,0) - cleanedNeutralIsoRho2=max(z.leg2.neutralHadronIsoR(0.4)+z.leg2.photonIsoR(0.4)--footPrintNeutralLeg2-z.leg2.rho*z.leg2.EffectiveArea04,0) + cleanedChargedIso1 = max(z.leg1.chargedHadronIso(0.4)-footPrintChargedLeg1,0.0) + cleanedChargedIso2 = max(z.leg1.chargedHadronIso(0.4)-footPrintChargedLeg2,0.0) + cleanedNeutralIsoRho1=max(z.leg1.neutralHadronIso(0.4)+z.leg1.photonIso(0.4)-footPrintNeutralLeg1-z.leg1.rho*z.leg1.EffectiveArea04,0) + cleanedNeutralIsoRho2=max(z.leg2.neutralHadronIso(0.4)+z.leg2.photonIso(0.4)--footPrintNeutralLeg2-z.leg2.rho*z.leg2.EffectiveArea04,0) return (cleanedChargedIso1+cleanedNeutralIsoRho1)/z.leg1.pt()<0.4 and (cleanedChargedIso2+cleanedNeutralIsoRho2)/z.leg2.pt()<0.4