Skip to content

Commit

Permalink
Merge pull request cms-sw#131 from cirkovic/CMG_MiniAOD_Lite_V6_0_fro…
Browse files Browse the repository at this point in the history
…m-CMSSW_7_0_6_221014

Modification needed to shift JEC while running on the miniAOD samples.
  • Loading branch information
gpetruc committed Oct 24, 2014
2 parents ff55682 + d56efb7 commit ef822f0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMGTools/RootTools/python/physicsobjects/JetReCalibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def correct(self,jet,rho,delta=0,metShift=[0,0]):
except RuntimeError, r:
print "Caught %s when getting uncertainty for jet of pt %.1f, eta %.2f\n" % (r,corr * jet.pt() * jet.rawFactor(),jet.eta())
jet.jetEnergyCorrUncertainty = 0.5
if jet.component(4).fraction() < 0.9 and jet.pt()*corr*jet.rawFactor() > 10:
metShift[0] -= jet.px()*(corr*jet.rawFactor() - 1)*(1-jet.component(3).fraction())
metShift[1] -= jet.py()*(corr*jet.rawFactor() - 1)*(1-jet.component(3).fraction())
if jet.photonEnergyFraction() < 0.9 and jet.pt()*corr*jet.rawFactor() > 10:
metShift[0] -= jet.px()*(corr*jet.rawFactor() - 1)*(1-jet.muonEnergyFraction())
metShift[1] -= jet.py()*(corr*jet.rawFactor() - 1)*(1-jet.muonEnergyFraction())
if delta != 0:
#print " jet with corr pt %6.2f has an uncertainty %.2f " % (jet.pt()*jet.rawFactor()*corr, jet.jetEnergyCorrUncertainty)
corr *= max(0, 1+delta*jet.jetEnergyCorrUncertainty)
Expand All @@ -64,7 +64,6 @@ def correct(self,jet,rho,delta=0,metShift=[0,0]):
if corr <= 0:
return False
jet.setP4(jet.p4() * (corr * jet.rawFactor()))
jet.setRawFactor(1.0/corr)
return True

class Type1METCorrection:
Expand Down

0 comments on commit ef822f0

Please sign in to comment.