Skip to content

Commit

Permalink
Merge branch 'dev' into feature/trigger
Browse files Browse the repository at this point in the history
hopefully fixes issues with jet veto map
  • Loading branch information
BalduinLetzer committed Jul 24, 2024
2 parents ebeeaf6 + 5e8ad03 commit 9d98b8f
Show file tree
Hide file tree
Showing 16 changed files with 99 additions and 95 deletions.
40 changes: 22 additions & 18 deletions hbw/config/defaults_and_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def default_producers(cls, container, task_params):
""" Default producers chosen based on the Inference model and the ML Model """

# per default, use the ml_inputs and event_weights
default_producers = [ml_inputs_producer(container), "event_weights", "pre_ml_cats"]
default_producers = ["event_weights", "pre_ml_cats", ml_inputs_producer(container)]

if hasattr(cls, "ml_model"):
# do no further resolve the ML categorizer when this task is part of the MLTraining pipeline
Expand Down Expand Up @@ -127,22 +127,22 @@ def set_config_defaults_and_groups(config_inst):
# (used in wrapper_factory and during plotting)
config_inst.x.process_groups = {
"all": ["*"],
"default": [default_signal_process, "tt", "st", "w_lnu", "dy_lep"],
"with_qcd": [default_signal_process, "tt", "qcd", "st", "w_lnu", "dy_lep"],
"much": [default_signal_process, "tt", "qcd_mu", "st", "w_lnu", "dy_lep"],
"2much": [default_signal_process, "tt", "st", "w_lnu", "dy_lep"],
"ech": [default_signal_process, "tt", "qcd_ele", "st", "w_lnu", "dy_lep"],
"2ech": [default_signal_process, "tt", "st", "w_lnu", "dy_lep"],
"emuch": [default_signal_process, "tt", "st", "w_lnu", "dy_lep"],
"inference": ["hh_ggf_*", "tt", "st", "w_lnu", "dy_lep", "qcd_*"],
"k2v": ["hh_vbf_*", "tt", "st", "w_lnu", "dy_lep", "qcd_*"],
"ml": [default_signal_process, "tt", "st", "w_lnu", "dy_lep"],
"default": [default_signal_process, "tt", "st", "w_lnu", "dy"],
"with_qcd": [default_signal_process, "tt", "qcd", "st", "w_lnu", "dy"],
"much": [default_signal_process, "tt", "qcd_mu", "st", "w_lnu", "dy"],
"2much": [default_signal_process, "tt", "st", "w_lnu", "dy"],
"ech": [default_signal_process, "tt", "qcd_ele", "st", "w_lnu", "dy"],
"2ech": [default_signal_process, "tt", "st", "w_lnu", "dy"],
"emuch": [default_signal_process, "tt", "st", "w_lnu", "dy"],
"inference": ["hh_ggf_*", "tt", "st", "w_lnu", "dy", "qcd_*"],
"k2v": ["hh_vbf_*", "tt", "st", "w_lnu", "dy", "qcd_*"],
"ml": [default_signal_process, "tt", "st", "w_lnu", "dy"],
"ml_test": [default_signal_process, "st", "w_lnu"],
"mldl": ["hh_ggf_kl1_kt1_hbb_hvv2l2nu", "tt", "st", "dy_lep"],
"mlsl": ["hh_ggf_kl1_kt1_hbb_hvvqqlnu", "tt", "st", "w_lnu", "dy_lep"],
"mldl": ["hh_ggf_kl1_kt1_hbb_hvv2l2nu", "tt", "st", "dy"],
"mlsl": ["hh_ggf_kl1_kt1_hbb_hvvqqlnu", "tt", "st", "w_lnu", "dy"],
"test": [default_signal_process, "tt_sl"],
"small": [default_signal_process, "tt", "st"],
"bkg": ["tt", "st", "w_lnu", "dy_lep"],
"bkg": ["tt", "st", "w_lnu", "dy"],
"signal": ["hh_ggf_*", "hh_vbf_*"], "hh_ggf": ["hh_ggf_*"], "hh_vbf": ["hh_vbf_*"],
}
config_inst.x.process_groups["dmuch"] = ["data_mu"] + config_inst.x.process_groups["much"]
Expand Down Expand Up @@ -170,12 +170,16 @@ def set_config_defaults_and_groups(config_inst):
# category groups for conveniently looping over certain categories
# (used during plotting and for rebinning)
config_inst.x.category_groups = {
"sl": ["sr__1e", "sr__1mu"],
"sl_resolved": ["sr__1e__resolved", "sr__1mu__resolved"],
"sl_much": ["sr__1mu", "sr__1mu__resolved", "sr__1mu__boosted"],
"sl_ech": ["sr__1e", "sr__1e__resolved", "sr__1e__boosted"],
"sl_much_resolved": ["sr__1mu__resolved", "sr__1mu__resolved__1b", "sr__1mu__resolved__2b"],
"sl_ech_resolved": ["sr__1e__resolved", "sr__1e__resolved__1b", "sr__1e__resolved__2b"],
"sl_much_boosted": ["sr__1mu__boosted"],
"sl_ech_boosted": ["sr__1e__boosted"],
"dl": ["sr__2e", "sr__2mu", "sr__emu"],
"dl_resolved": ["sr__2e__resolved", "sr__2mu__resolved", "sr__emu__resolved"],
"dl_2much": ["sr__2mu", "sr__2mu__resolved", "sr__2mu__boosted"],
"dl_2ech": ["sr__2e", "sr__2e__resolved", "sr__2e__boosted"],
"dl_emuch": ["sr__emu", "sr__emu__resolved", "sr__emu__boosted"],
Expand Down Expand Up @@ -227,9 +231,9 @@ def set_config_defaults_and_groups(config_inst):
"sr__emu__1b__ml_hh_ggf_kl1_kt1_hbb_hvv2l2nu", "sr__emu__2b__ml_hh_ggf_kl1_kt1_hbb_hvv2l2nu",
),
"BR_dl": (
"sr__2e__ml_tt", "sr__2e__ml_st", "sr__2e__ml_dy_lep",
"sr__2mu__ml_tt", "sr__2mu__ml_st", "sr__2mu__ml_dy_lep",
"sr__emu__ml_tt", "sr__emu__ml_st", "sr__emu__ml_dy_lep",
"sr__2e__ml_tt", "sr__2e__ml_st", "sr__2e__ml_dy",
"sr__2mu__ml_tt", "sr__2mu__ml_st", "sr__2mu__ml_dy",
"sr__emu__ml_tt", "sr__emu__ml_st", "sr__emu__ml_dy",
),
}

Expand Down Expand Up @@ -299,7 +303,7 @@ def set_config_defaults_and_groups(config_inst):
},
}
# when drawing DY as a line, use a different type of yellow
config_inst.x.process_settings_groups["unstack_all"].update({"dy_lep": {"unstack": True, "color": "#e6d800"}})
config_inst.x.process_settings_groups["unstack_all"].update({"dy": {"unstack": True, "color": "#e6d800"}})

config_inst.x.variable_settings_groups = {
"test": {
Expand Down
8 changes: 4 additions & 4 deletions hbw/config/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def add_dummy_xsecs(config: od.Config, dummy_xsec: float = 0.1):
process_inst.xsecs[ecm] = Number(dummy_xsec)

# # temporary xsecs from XSDB
# config.get_process("dy_lep").xsecs[13.6] = Number(67710.0) # https://xsdb-temp.app.cern.ch/xsdb/?columns=37814272&currentPage=0&pageSize=10&searchQuery=DAS%3DWtoLNu-2Jets_TuneCP5_13p6TeV_amcatnloFXFX-pythia8 # noqa
# config.get_process("dy").xsecs[13.6] = Number(67710.0) # https://xsdb-temp.app.cern.ch/xsdb/?columns=37814272&currentPage=0&pageSize=10&searchQuery=DAS%3DWtoLNu-2Jets_TuneCP5_13p6TeV_amcatnloFXFX-pythia8 # noqa
# config.get_process("w_lnu").xsecs[13.6] = Number(5558.0) # https://xsdb-temp.app.cern.ch/xsdb/?columns=37814272&currentPage=0&ordDirection=1&ordFieldName=process_name&pageSize=10&searchQuery=DAS%3DWtoLNu-2Jets_TuneCP5_13p6TeV_amcatnloFXFX-pythia8 # noqa

# temporary xsecs that were missing in xsdb
Expand Down Expand Up @@ -93,11 +93,11 @@ def configure_hbw_processes(config: od.Config):

# custom v_lep process for ML Training, combining W+DY
w_lnu = config.get_process("w_lnu", default=None)
dy_lep = config.get_process("dy_lep", default=None)
if w_lnu and dy_lep:
dy = config.get_process("dy", default=None)
if w_lnu and dy:
v_lep = add_parent_process( # noqa
config,
[w_lnu, dy_lep],
[w_lnu, dy],
name="v_lep",
id=64575573, # random number
label="W and DY",
Expand Down
6 changes: 3 additions & 3 deletions hbw/config/styling.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"higgs": "#984ea3", # purple
"st": "#ff7f00", # orange
"t_bkg": "#e41a1c", # orange
"dy_lep": "#ffff33", # yellow
"dy": "#ffff33", # yellow
"ttV": "#a65628", # brown
"VV": "#f781bf", # pink
"other": "#999999", # grey
Expand Down Expand Up @@ -71,7 +71,7 @@
"graviton_hh_ggf_bbww_m1000": "grav1000",
"st": "st",
"w_lnu": "W",
"dy_lep": "DY",
"dy": "DY",
"v_lep": "W+DY",
"t_bkg": "tt+st",
}
Expand Down Expand Up @@ -101,7 +101,7 @@
"hh_vbf_kv0p5_k2v1_kl1_hbb_hvv2l2nu": r"$HH_{vbf}^{0.5,1,1} (DL)$",
"hh_vbf_kv1p5_k2v1_kl1_hbb_hvv2l2nu": r"$HH_{vbf}^{1.5,1,1} (DL)$",
"w_lnu": r"$W \rightarrow l\nu$",
"dy_lep": r"$Z \rightarrow ll$",
"dy": r"$Z \rightarrow ll$",
"qcd_mu": r"$QCD \mu$",
"qcd_ele": r"$QCD e$",
}
Expand Down
8 changes: 4 additions & 4 deletions hbw/inference/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# mapping, which processes are used for which QCDScale (rate) uncertainty
processes_per_QCDScale = {
"ttbar": ["tt", "st_tchannel", "st_schannel", "st_twchannel", "ttW", "ttZ"],
"V": ["dy_lep", "w_lnu"],
"V": ["dy", "w_lnu"],
"VV": ["WW", "ZZ", "WZ", "qqZZ"],
"VVV": ["vvv"],
"ggH": ["ggH"],
Expand All @@ -59,7 +59,7 @@
# mapping, which processes are used for which pdf (rate) uncertainty
processes_per_pdf_rate = {
"gg": ["tt", "ttZ", "ggZZ"],
"qqbar": ["st_schannel", "st_tchannel", "dy_lep", "w_lnu", "vvv", "qqZZ", "ttW"],
"qqbar": ["st_schannel", "st_tchannel", "dy", "w_lnu", "vvv", "qqZZ", "ttW"],
"qg": ["st_twchannel"],
"Higgs_gg": ["ggH"],
"Higgs_qqbar": ["qqH", "ZH", "WH", "VH"],
Expand Down Expand Up @@ -100,7 +100,7 @@
"pdf_shape_hh_ggf_kl5_kt1_hbb_hvv2l2nu": ["hh_ggf_kl5_kt1_hbb_hvv2l2nu"],
"pdf_shape_tt": ["tt"],
"pdf_shape_st": ["st_schannel", "st_twchannel"], # TODO: there was some bug with "st_tchannel"
"pdf_shape_dy": ["dy_lep"],
"pdf_shape_dy": ["dy"],
"pdf_shape_w": ["w_lnu"],
"murf_envelope_hh_ggf_kl0_kt1_hbb_hvvqqlnu": ["hh_ggf_kl0_kt1_hbb_hvvqqlnu"],
"murf_envelope_hh_ggf_kl1_kt1_hbb_hvvqqlnu": ["hh_ggf_kl1_kt1_hbb_hvvqqlnu"],
Expand All @@ -112,7 +112,7 @@
"murf_envelope_hh_ggf_kl5_kt1_hbb_hvv2l2nu": ["hh_ggf_kl5_kt1_hbb_hvv2l2nu"],
"murf_envelope_tt": ["tt"],
"murf_envelope_st": ["st_schannel", "st_tchannel", "st_twchannel"],
"murf_envelope_dy": ["dy_lep"],
"murf_envelope_dy": ["dy"],
"murf_envelope_w": ["w_lnu"],
}

Expand Down
14 changes: 7 additions & 7 deletions hbw/inference/dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"tt",
# "ttv", "ttvv",
"st_schannel", "st_tchannel", "st_twchannel",
"dy_lep",
"dy",
"w_lnu",
# "vv",
# "vvv",
Expand Down Expand Up @@ -93,14 +93,14 @@
# "murf_envelope_hh_ggf_kl1_kt1_hbb_hvv2l2nu",
"murf_envelope_tt",
"murf_envelope_st",
"murf_envelope_dy_lep",
"murf_envelope_dy",
"murf_envelope_w_lnu",
"murf_envelope_ttV",
"murf_envelope_VV",
# Shape PDF Uncertainties
"pdf_shape_tt",
"pdf_shape_st",
"pdf_shape_dy_lep",
"pdf_shape_dy",
"pdf_shape_w_lnu",
"pdf_shape_ttV",
"pdf_shape_VV",
Expand Down Expand Up @@ -169,7 +169,7 @@
"tt",
# "st_schannel",
"st_tchannel", "st_twchannel",
"dy_lep",
"dy",
"w_lnu",
]

Expand All @@ -184,13 +184,13 @@
# Background regions
"sr__2e__ml_tt",
"sr__2e__ml_st",
"sr__2e__ml_dy_lep",
"sr__2e__ml_dy",
"sr__2mu__ml_tt",
"sr__2mu__ml_st",
"sr__2mu__ml_dy_lep",
"sr__2mu__ml_dy",
"sr__emu__ml_tt",
"sr__emu__ml_st",
"sr__emu__ml_dy_lep",
"sr__emu__ml_dy",
]

dl_22 = dl.derive("dl_22", cls_dict={
Expand Down
8 changes: 4 additions & 4 deletions hbw/inference/old_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def default(self):
"tt",
"st",
"w_lnu",
"dy_lep",
"dy",
]

for proc in ml_model_processes:
Expand Down Expand Up @@ -69,7 +69,7 @@ def default(self):
"tt",
# "ttv", "ttvv",
"st_schannel", "st_tchannel", "st_twchannel",
"dy_lep",
"dy",
"w_lnu",
# "vv",
# "vvv",
Expand Down Expand Up @@ -112,7 +112,7 @@ def default(self):
# add QCD scale uncertainties to inference model
proc_QCDscale = {
"ttbar": ["tt", "st_tchannel", "st_schannel", "st_twchannel", "ttW", "ttZ"],
"V": ["dy_lep", "w_lnu"],
"V": ["dy", "w_lnu"],
"VV": ["WW", "ZZ", "WZ", "qqZZ"],
"VVV": ["vvv"],
"ggH": ["ggH"],
Expand Down Expand Up @@ -151,7 +151,7 @@ def default(self):
# add PDF rate uncertainties to inference model
proc_pdf = {
"gg": ["tt", "ttZ", "ggZZ"],
"qqbar": ["st_schannel", "st_tchannel", "dy_lep", "w_lnu", "vvv", "qqZZ", "ttW"],
"qqbar": ["st_schannel", "st_tchannel", "dy", "w_lnu", "vvv", "qqZZ", "ttW"],
"qg": ["st_twchannel"],
"Higgs_gg": ["ggH"],
"Higgs_qqbar": ["qqH", "ZH", "WH", "VH"],
Expand Down
8 changes: 4 additions & 4 deletions hbw/inference/sl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tt",
# "ttv", "ttvv",
"st_schannel", "st_tchannel", "st_twchannel",
"dy_lep",
"dy",
"w_lnu",
# "vv",
# "vvv",
Expand Down Expand Up @@ -92,14 +92,14 @@
# "murf_envelope_hh_ggf_kl1_kt1_hbb_hvv2l2nu",
"murf_envelope_tt",
"murf_envelope_st",
"murf_envelope_dy_lep",
"murf_envelope_dy",
"murf_envelope_w_lnu",
"murf_envelope_ttV",
"murf_envelope_VV",
# Shape PDF Uncertainties
"pdf_shape_tt",
"pdf_shape_st",
"pdf_shape_dy_lep",
"pdf_shape_dy",
"pdf_shape_w_lnu",
"pdf_shape_ttV",
"pdf_shape_VV",
Expand Down Expand Up @@ -176,7 +176,7 @@
"tt",
# "st_schannel",
"st_tchannel", "st_twchannel",
"dy_lep",
"dy",
"w_lnu",
]

Expand Down
20 changes: 10 additions & 10 deletions hbw/inference/sl_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def add_inference_categories(self: InferenceModel):
"graviton_hh_ggf_bbww_m600",
"tt",
"st",
"dy_lep",
"dy",
"w_lnu",
# "v_lep",
# "t_bkg",
Expand All @@ -64,15 +64,15 @@ def add_inference_categories(self: InferenceModel):
"cat__1e_graviton_hh_ggf_bbww_m600",
# "1e__ml_tt",
# "1e__ml_st",
# "1e__ml_dy_lep",
# "1e__ml_dy",
# "1e__ml_w_lnu",
"1e__ml_v_lep",
"1e__ml_t_bkg",
# "1mu__ml",
"1mu__ml_graviton_hh_ggf_bbww_m600",
# "1mu__ml_tt",
# "1mu__ml_st",
# "1mu__ml_dy_lep",
# "1mu__ml_dy",
# "1mu__ml_w_lnu",
"1mu__ml_v_lep",
"1mu__ml_t_bkg",
Expand All @@ -83,15 +83,15 @@ def add_inference_categories(self: InferenceModel):
"1e_graviton_hh_ggf_bbww_m600",
# "1e__ml_tt",
# "1e__ml_st",
# "1e__ml_dy_lep",
# "1e__ml_dy",
# "1e__ml_w_lnu",
"1e__ml_v_lep",
"1e__ml_t_bkg",
# "1mu__ml",
"1mu__ml_graviton_hh_ggf_bbww_m600",
# "1mu__ml_tt",
# "1mu__ml_st",
# "1mu__ml_dy_lep",
# "1mu__ml_dy",
# "1mu__ml_w_lnu",
"1mu__ml_v_lep",
"1mu__ml_t_bkg",
Expand Down Expand Up @@ -139,7 +139,7 @@ def add_inference_categories(self: InferenceModel):
# "murf_envelope_st_schannel",
# "murf_envelope_st_tchannel",
# "murf_envelope_st_twchannel",
# "murf_envelope_dy_lep",
# "murf_envelope_dy",
# "murf_envelope_w_lnu",
# "murf_envelope_ttV",
# "murf_envelope_VV",
Expand All @@ -148,7 +148,7 @@ def add_inference_categories(self: InferenceModel):
# "pdf_shape_st_schannel",
# "pdf_shape_st_tchannel",
# "pdf_shape_st_twchannel",
# "pdf_shape_dy_lep",
# "pdf_shape_dy",
# "pdf_shape_w_lnu",
# "pdf_shape_ttV",
# "pdf_shape_VV",
Expand Down Expand Up @@ -193,7 +193,7 @@ def add_inference_categories(self: InferenceModel):
f"graviton_hh_ggf_bbww_m{m}",
"tt",
"st",
"dy_lep",
"dy",
"w_lnu",
]

Expand All @@ -215,12 +215,12 @@ def add_inference_categories(self: InferenceModel):
f"1e__ml_graviton_hh_ggf_bbww_m{m}",
"1e__ml_tt",
"1e__ml_st",
"1e__ml_dy_lep",
"1e__ml_dy",
"1e__ml_w_lnu",
f"1mu__ml_graviton_hh_ggf_bbww_m{m}",
"1mu__ml_tt",
"1mu__ml_st",
"1mu__ml_dy_lep",
"1mu__ml_dy",
"1mu__ml_w_lnu",
]
ml_model_name = f"dense_graviton{m}"
Expand Down
Loading

0 comments on commit 9d98b8f

Please sign in to comment.