Skip to content

Commit

Permalink
Adding option to do jet MC matching with pT threhsold or not, to solv…
Browse files Browse the repository at this point in the history
…e issue with smearJets
  • Loading branch information
mmasciov committed May 26, 2016
1 parent c715177 commit 588351c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, cfg_ana, cfg_comp, looperName):
# instantiate the jet re-calibrator
self.jetReCalibrator = JetReCalibrator(GT, cfg_ana.recalibrationType, doResidual, cfg_ana.jecPath, **kwargs)
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)
Expand Down Expand Up @@ -166,7 +167,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)

Expand Down Expand Up @@ -508,6 +512,7 @@ def smearJets(self, event, jets):
cleanJetsFromIsoTracks = False,
alwaysCleanPhotons = False,
do_mc_match=True,
matchJetsWithThreshold=False,
cleanGenJetsFromPhoton = False,
jetGammaDR=0.4,
cleanFromLepAndGammaSimultaneously = False,
Expand Down

0 comments on commit 588351c

Please sign in to comment.