Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JES uncertainties on T1(smear) MET with split JER (indentation) #256

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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