Skip to content

Commit

Permalink
Merge pull request #256 from pieterdavid/fixJESuncMETwithsplitJER
Browse files Browse the repository at this point in the history
Fix JES uncertainties on T1(smear) MET with split JER (indentation)
  • Loading branch information
gouskos authored Dec 7, 2020
2 parents 079c9e1 + a12025b commit 7dd1380
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions python/postprocessing/modules/jme/jetmetUncertainties.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,28 +729,28 @@ def resolution_matching(jet, genjet):
jerID] - (jet_pt_L1L2L3 * jerDownVal -
jet_pt_L1) * jet_sinPhi

# Calculate JES uncertainties on unsmeared MET
for jesUncertainty in self.jesUncertainties:
met_T1_px_jesUp[
jesUncertainty] = met_T1_px_jesUp[
jesUncertainty] - (
jet_pt_jesUpT1[jesUncertainty]
- jet_pt_L1) * jet_cosPhi
met_T1_py_jesUp[
jesUncertainty] = met_T1_py_jesUp[
jesUncertainty] - (
jet_pt_jesUpT1[jesUncertainty]
- jet_pt_L1) * jet_sinPhi
met_T1_px_jesDown[
jesUncertainty] = met_T1_px_jesDown[
jesUncertainty] - (
jet_pt_jesDownT1[jesUncertainty]
- jet_pt_L1) * jet_cosPhi
met_T1_py_jesDown[
jesUncertainty] = met_T1_py_jesDown[
jesUncertainty] - (
jet_pt_jesDownT1[jesUncertainty]
- jet_pt_L1) * jet_sinPhi
# Calculate JES uncertainties on unsmeared MET
for jesUncertainty in self.jesUncertainties:
met_T1_px_jesUp[
jesUncertainty] = met_T1_px_jesUp[
jesUncertainty] - (
jet_pt_jesUpT1[jesUncertainty]
- jet_pt_L1) * jet_cosPhi
met_T1_py_jesUp[
jesUncertainty] = met_T1_py_jesUp[
jesUncertainty] - (
jet_pt_jesUpT1[jesUncertainty]
- jet_pt_L1) * jet_sinPhi
met_T1_px_jesDown[
jesUncertainty] = met_T1_px_jesDown[
jesUncertainty] - (
jet_pt_jesDownT1[jesUncertainty]
- jet_pt_L1) * jet_cosPhi
met_T1_py_jesDown[
jesUncertainty] = met_T1_py_jesDown[
jesUncertainty] - (
jet_pt_jesDownT1[jesUncertainty]
- jet_pt_L1) * jet_sinPhi
# Variations of T1Smear MET
if 'T1Smear' in self.saveMETUncs:
for jerID in self.splitJERIDs:
Expand All @@ -775,26 +775,26 @@ def resolution_matching(jet, genjet):
jet_pt_L1L2L3 * jerDownVal -
jet_pt_L1) * jet_sinPhi

# Calculate JES uncertainties on smeared MET
for jesUncertainty in self.jesUncertainties:
jesUp_correction_forT1SmearMET = (
jet_pt_L1L2L3 * jet_pt_jerNomVal -
jet_pt_L1) + (
jet_pt_jesUpT1[jesUncertainty] -
jet_pt_L1L2L3)
jesDown_correction_forT1SmearMET = (
jet_pt_L1L2L3 * jet_pt_jerNomVal -
jet_pt_L1) + (
jet_pt_jesDownT1[jesUncertainty] -
jet_pt_L1L2L3)
met_T1Smear_px_jesUp[jesUncertainty] = met_T1Smear_px_jesUp[jesUncertainty] - \
jesUp_correction_forT1SmearMET * jet_cosPhi
met_T1Smear_py_jesUp[jesUncertainty] = met_T1Smear_py_jesUp[jesUncertainty] - \
jesUp_correction_forT1SmearMET * jet_sinPhi
met_T1Smear_px_jesDown[jesUncertainty] = met_T1Smear_px_jesDown[jesUncertainty] - \
jesDown_correction_forT1SmearMET * jet_cosPhi
met_T1Smear_py_jesDown[jesUncertainty] = met_T1Smear_py_jesDown[jesUncertainty] - \
jesDown_correction_forT1SmearMET * jet_sinPhi
# Calculate JES uncertainties on smeared MET
for jesUncertainty in self.jesUncertainties:
jesUp_correction_forT1SmearMET = (
jet_pt_L1L2L3 * jet_pt_jerNomVal -
jet_pt_L1) + (
jet_pt_jesUpT1[jesUncertainty] -
jet_pt_L1L2L3)
jesDown_correction_forT1SmearMET = (
jet_pt_L1L2L3 * jet_pt_jerNomVal -
jet_pt_L1) + (
jet_pt_jesDownT1[jesUncertainty] -
jet_pt_L1L2L3)
met_T1Smear_px_jesUp[jesUncertainty] = met_T1Smear_px_jesUp[jesUncertainty] - \
jesUp_correction_forT1SmearMET * jet_cosPhi
met_T1Smear_py_jesUp[jesUncertainty] = met_T1Smear_py_jesUp[jesUncertainty] - \
jesUp_correction_forT1SmearMET * jet_sinPhi
met_T1Smear_px_jesDown[jesUncertainty] = met_T1Smear_px_jesDown[jesUncertainty] - \
jesDown_correction_forT1SmearMET * jet_cosPhi
met_T1Smear_py_jesDown[jesUncertainty] = met_T1Smear_py_jesDown[jesUncertainty] - \
jesDown_correction_forT1SmearMET * jet_sinPhi

# propagate "unclustered energy" uncertainty to MET
if self.metBranchName == 'METFixEE2017':
Expand Down

0 comments on commit 7dd1380

Please sign in to comment.