Skip to content

Commit

Permalink
Merge pull request #645 from mmasciov/heppy_JetMatching80X
Browse files Browse the repository at this point in the history
Fixing issue with jet MC matching and jet smearing
  • Loading branch information
gpetruc authored Feb 14, 2017
2 parents 6f95dc4 + a5dbf90 commit d281ed7
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 @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d281ed7

Please sign in to comment.