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

JERC #53

Merged
merged 48 commits into from
Oct 7, 2024
Merged

JERC #53

Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3ff31d9
JSONs for corrections
MatthewDittrich Jul 24, 2024
b3672d8
Initial JEC stuff
MatthewDittrich Jul 29, 2024
d181183
JEC
MatthewDittrich Jul 31, 2024
815fbca
More JEC
MatthewDittrich Aug 1, 2024
0131f37
JEC Stuff
MatthewDittrich Aug 11, 2024
f29ac6b
JEC
MatthewDittrich Aug 11, 2024
6952e4e
Jer and Jec corrections
MatthewDittrich Aug 12, 2024
b70396a
Temp Fix
MatthewDittrich Aug 13, 2024
e03c9fa
Smear Debugging
MatthewDittrich Aug 17, 2024
a2279f0
Fixed Run2 Data Samples
MatthewDittrich Aug 17, 2024
5702fd5
Run2 Test
MatthewDittrich Aug 18, 2024
aaea46d
JEC UP DOWN Issue
MatthewDittrich Aug 19, 2024
8fbb3e1
Small edits
MatthewDittrich Aug 20, 2024
fe7f610
Merge branch 'main' into jec
MatthewDittrich Aug 24, 2024
0da2a4d
Input Samples
MatthewDittrich Aug 24, 2024
d25d455
DataCard making
MatthewDittrich Aug 26, 2024
de99eba
DataCard Maker
MatthewDittrich Aug 27, 2024
80d8f22
Input Samples
MatthewDittrich Sep 8, 2024
9d30a78
Main Merge
MatthewDittrich Sep 8, 2024
2b8e21d
Small Changes
MatthewDittrich Sep 16, 2024
682de49
Small Changes
MatthewDittrich Sep 16, 2024
53ade77
Changes
MatthewDittrich Sep 22, 2024
f56a1e0
Small Edits
MatthewDittrich Sep 23, 2024
d625561
Main Merge
MatthewDittrich Sep 23, 2024
695f82c
Small Edits
MatthewDittrich Sep 26, 2024
c2c90e0
Andrea Method
MatthewDittrich Sep 30, 2024
c1bf63e
Syncing
MatthewDittrich Oct 1, 2024
4d3ad02
Final Chnages
MatthewDittrich Oct 2, 2024
05a4080
Data Fix
MatthewDittrich Oct 3, 2024
44262a7
Main Merge
MatthewDittrich Oct 4, 2024
0dd7a5c
Final Changes
MatthewDittrich Oct 4, 2024
b6f354f
Flake 8 and removing a bad plotting script
MatthewDittrich Oct 4, 2024
9d6bba9
DataCards
MatthewDittrich Oct 4, 2024
5f8e333
Last Flake8
MatthewDittrich Oct 4, 2024
460e283
Making HPG Work
MatthewDittrich Oct 4, 2024
fa8a2d4
Changes
MatthewDittrich Oct 4, 2024
40b4e89
Restore master branch naming
kmohrman Oct 5, 2024
3f370b3
Merge remote-tracking branch 'origin/main' into jec
kmohrman Oct 5, 2024
4a68372
Veto Maps and Addressing Comments
MatthewDittrich Oct 6, 2024
234114b
Flake 8 is the enemy
MatthewDittrich Oct 6, 2024
bf300e2
Update ref yields for jerc and jet veto maps
kmohrman Oct 6, 2024
b578f57
Use R3 as ref
kmohrman Oct 6, 2024
0610084
Clean up
kmohrman Oct 6, 2024
5c18630
Clean up datacard maker and ylds, pull out 27 jec vars
kmohrman Oct 7, 2024
150df3d
Flake8 why do you care about trailing spaces in comments
kmohrman Oct 7, 2024
10277bd
Do we need to checkout tc clib_jme for now
kmohrman Oct 7, 2024
d905d37
Update R3 ref after jet veto maps
kmohrman Oct 7, 2024
6d1c508
Clean up spaces
kmohrman Oct 7, 2024
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
141 changes: 130 additions & 11 deletions analysis/wwz/get_wwz_yields.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,121 @@




JERC_LST = [
kmohrman marked this conversation as resolved.
Show resolved Hide resolved
"AbsoluteMPFBias_correlated",
"AbsoluteScale_correlated",
"FlavorQCD_correlated",
"Fragmentation_correlated",
"PileUpDataMC_correlated",
"PileUpPtBB_correlated",
"PileUpPtEC1_correlated",
"PileUpPtEC2_correlated",
"PileUpPtHF_correlated",
"PileUpPtRef_correlated",
"RelativeFSR_correlated",
"RelativeJERHF_correlated",
"RelativePtBB_correlated",
"RelativePtHF_correlated",
"RelativeBal_correlated",
"SinglePionECAL_correlated",
"SinglePionHCAL_correlated",

"AbsoluteStat_uncorrelated_2016APV",
"RelativeJEREC1_uncorrelated_2016APV",
"RelativeJEREC2_uncorrelated_2016APV",
"RelativePtEC1_uncorrelated_2016APV",
"RelativePtEC2_uncorrelated_2016APV",
"TimePtEta_uncorrelated_2016APV",
"RelativeSample_uncorrelated_2016APV",
"RelativeStatEC_uncorrelated_2016APV",
"RelativeStatFSR_uncorrelated_2016APV",
"RelativeStatHF_uncorrelated_2016APV",
"JER_2016APV",

"AbsoluteStat_uncorrelated_2016",
"RelativeJEREC1_uncorrelated_2016",
"RelativeJEREC2_uncorrelated_2016",
"RelativePtEC1_uncorrelated_2016",
"RelativePtEC2_uncorrelated_2016",
"TimePtEta_uncorrelated_2016",
"RelativeSample_uncorrelated_2016",
"RelativeStatEC_uncorrelated_2016",
"RelativeStatFSR_uncorrelated_2016",
"RelativeStatHF_uncorrelated_2016",
"JER_2016",

"AbsoluteStat_uncorrelated_2017",
"RelativeJEREC1_uncorrelated_2017",
"RelativeJEREC2_uncorrelated_2017",
"RelativePtEC1_uncorrelated_2017",
"RelativePtEC2_uncorrelated_2017",
"TimePtEta_uncorrelated_2017",
"RelativeSample_uncorrelated_2017",
"RelativeStatEC_uncorrelated_2017",
"RelativeStatFSR_uncorrelated_2017",
"RelativeStatHF_uncorrelated_2017",
"JER_2017",

"AbsoluteStat_uncorrelated_2018",
"RelativeJEREC1_uncorrelated_2018",
"RelativeJEREC2_uncorrelated_2018",
"RelativePtEC1_uncorrelated_2018",
"RelativePtEC2_uncorrelated_2018",
"TimePtEta_uncorrelated_2018",
"RelativeSample_uncorrelated_2018",
"RelativeStatEC_uncorrelated_2018",
"RelativeStatFSR_uncorrelated_2018",
"RelativeStatHF_uncorrelated_2018",
"JER_2018",

"AbsoluteStat_uncorrelated_2022",
"RelativeJEREC1_uncorrelated_2022",
"RelativeJEREC2_uncorrelated_2022",
"RelativePtEC1_uncorrelated_2022",
"RelativePtEC2_uncorrelated_2022",
"TimePtEta_uncorrelated_2022",
"RelativeSample_uncorrelated_2022",
"RelativeStatEC_uncorrelated_2022",
"RelativeStatFSR_uncorrelated_2022",
"RelativeStatHF_uncorrelated_2022",
"JER_2022",

"AbsoluteStat_uncorrelated_2022EE",
"RelativeJEREC1_uncorrelated_2022EE",
"RelativeJEREC2_uncorrelated_2022EE",
"RelativePtEC1_uncorrelated_2022EE",
"RelativePtEC2_uncorrelated_2022EE",
"TimePtEta_uncorrelated_2022EE",
"RelativeSample_uncorrelated_2022EE",
"RelativeStatEC_uncorrelated_2022EE",
"RelativeStatFSR_uncorrelated_2022EE",
"RelativeStatHF_uncorrelated_2022EE",
"JER_2022EE",

"AbsoluteStat_uncorrelated_2023",
"RelativeJEREC1_uncorrelated_2023",
"RelativeJEREC2_uncorrelated_2023",
"RelativePtEC1_uncorrelated_2023",
"RelativePtEC2_uncorrelated_2023",
"TimePtEta_uncorrelated_2023",
"RelativeSample_uncorrelated_2023",
"RelativeStatEC_uncorrelated_2023",
"RelativeStatFSR_uncorrelated_2023",
"RelativeStatHF_uncorrelated_2023",
"JER_2023",

"AbsoluteStat_uncorrelated_2023BPix",
"RelativeJEREC1_uncorrelated_2023BPix",
"RelativeJEREC2_uncorrelated_2023BPix",
"RelativePtEC1_uncorrelated_2023BPix",
"RelativePtEC2_uncorrelated_2023BPix",
"TimePtEta_uncorrelated_2023BPix",
"RelativeSample_uncorrelated_2023BPix",
"RelativeStatEC_uncorrelated_2023BPix",
"RelativeStatFSR_uncorrelated_2023BPix",
"RelativeStatHF_uncorrelated_2023BPix",
"JER_2023BPix",
]


################### Getting and printing yields ###################
Expand Down Expand Up @@ -519,6 +633,7 @@ def make_syst_plots(histo_dict,grouping_mc,grouping_data,save_dir_path,year):

for var_name in histo_dict.keys():
#print(f"\n{var_name}")
#if var_name != "njets": continue
if var_name not in TMP_VAR_LST: continue
histo = histo_dict[var_name]

Expand Down Expand Up @@ -546,8 +661,8 @@ def make_syst_plots(histo_dict,grouping_mc,grouping_data,save_dir_path,year):
syst_var_lst = []
all_syst_var_lst = histo.axes["systematic"]
for syst_var_name in all_syst_var_lst:
if syst_var_name.endswith("Up"):
syst_name_base = syst_var_name.replace("Up","")
if syst_var_name.endswith("Down"):
syst_name_base = syst_var_name.replace("Down","")
kmohrman marked this conversation as resolved.
Show resolved Hide resolved
if syst_name_base not in syst_var_lst:
syst_var_lst.append(syst_name_base)

Expand All @@ -562,7 +677,8 @@ def make_syst_plots(histo_dict,grouping_mc,grouping_data,save_dir_path,year):
data_nom = merge_overflow(histo_grouped_data[{"systematic":"nominal"}])

for syst in syst_var_lst:
if "btag" not in syst: continue
if syst not in JERC_LST: continue
#if "btag" not in syst: continue
#if "uncorrelated" not in syst: continue
#if "lepSF" not in syst: continue
#if "PreFiring" not in syst: continue
Expand All @@ -571,13 +687,16 @@ def make_syst_plots(histo_dict,grouping_mc,grouping_data,save_dir_path,year):
#if "renorm" not in syst and "fact" not in syst: continue

# Skip the variations that don't apply (TODO: why are these in the hist to begin with??)
if year == "UL16APV": blacklist_years = ["2016","2017","2018","2022","2022EE"]
if year == "UL16": blacklist_years = ["2016APV","2017","2018","2022","2022EE"]
if year == "UL17": blacklist_years = ["2016APV","2016","2018","2022","2022EE"]
if year == "UL18": blacklist_years = ["2016APV","2016","2017","2022","2022EE"]
if year == "2022": blacklist_years = ["2016APV","2016","2017","2018","2022EE"]
if year == "2022EE": blacklist_years = ["2016APV","2016","2017","2018","2022"]
if year == "UL16APV": blacklist_years = ["2016","2017","2018","2022","2022EE","2023","2023BPix"]
if year == "UL16": blacklist_years = ["2016APV","2017","2018","2022","2022EE","2023","2023BPix"]
if year == "UL17": blacklist_years = ["2016APV","2016","2018","2022","2022EE","2023","2023BPix"]
if year == "UL18": blacklist_years = ["2016APV","2016","2017","2022","2022EE","2023","2023BPix"]
if year == "2022": blacklist_years = ["2016APV","2016","2017","2018","2022EE","2023","2023BPix"]
if year == "2022EE": blacklist_years = ["2016APV","2016","2017","2018","2022","2023","2023BPix"]
if year == "2023": blacklist_years = ["2016APV","2016","2017","2018","2022","2022EE","2023BPix"]
if year == "2023BPix": blacklist_years = ["2016APV","2016","2017","2018","2022","2022EE","2023"]
if year == "run3": blacklist_years = ["2016APV","2016","2017","2018"]
if year == "run2": blacklist_years = ["2022","2022EE","2023","2023BPix"]
if year == "all": blacklist_years = []
skip = False
for y in blacklist_years:
Expand All @@ -597,7 +716,7 @@ def make_syst_plots(histo_dict,grouping_mc,grouping_data,save_dir_path,year):
mc_down_arr = mc_down[{"process_grp":sum}].values()

# Print individual syst numbers
#if var_name != "nleps": continue
kmohrman marked this conversation as resolved.
Show resolved Hide resolved
#if var_name != "njets": continue
#n = sum(sum(mc_nom.values()))
#u = sum(mc_up_arr)
#d = sum(mc_down_arr)
Expand Down
Loading
Loading