diff --git a/PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py b/PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py index 5301c5a237bf5..776cfc907e065 100644 --- a/PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py +++ b/PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py @@ -99,6 +99,7 @@ def __init__(self, cfg_ana, cfg_comp, looperName): self.runsGT.append(run) self.doPuId = getattr(self.cfg_ana, 'doPuId', True) + self.matchJetsWithThreshold = getattr(self.cfg_ana, 'matchJetsWithThreshold', False) self.jetLepDR = getattr(self.cfg_ana, 'jetLepDR', 0.4) self.jetLepArbitration = getattr(self.cfg_ana, 'jetLepArbitration', lambda jet,lepton: lepton) self.lepPtMin = getattr(self.cfg_ana, 'minLepPt', -1) @@ -179,7 +180,10 @@ def process(self, event): for igj, gj in enumerate(self.genJets): gj.index = igj # self.matchJets(event, allJets) - self.matchJets(event, [ j for j in allJets if j.pt()>self.cfg_ana.jetPt ]) # To match only jets above chosen threshold + if self.matchJetsWithThreshold and not getattr(self.cfg_ana, 'smearJets', False): + self.matchJets(event, [ j for j in allJets if j.pt()>self.cfg_ana.jetPt ]) # To match only jets above chosen threshold + else: + self.matchJets(event, allJets) if getattr(self.cfg_ana, 'smearJets', False): self.smearJets(event, allJets) @@ -528,6 +532,7 @@ def smearJets(self, event, jets): cleanJetsFromIsoTracks = False, alwaysCleanPhotons = False, do_mc_match=True, + matchJetsWithThreshold=False, cleanGenJetsFromPhoton = False, jetGammaDR=0.4, cleanFromLepAndGammaSimultaneously = False,