Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion Analysis/AnalysisCacheProducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ def createAnalysisCache(
Utilities.InitializeCorrections(setup, dataset_name, stage="AnalysisCache")
scale_uncertainties = set()
if setup.global_params["compute_unc_variations"]:
scale_uncertainties.update(unc_cfg_dict["shape"].keys())
for unc_name, unc_params in unc_cfg_dict["shape"].items():
if isinstance(unc_params, dict) and unc_params.get("data_driven", False):
continue
scale_uncertainties.add(unc_name)
print("Scale uncertainties to consider:", scale_uncertainties)

producer_config = setup.global_params["payload_producers"][producer_to_run]
Expand Down
9 changes: 5 additions & 4 deletions Analysis/HistMergerFromHists.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ def fill_hists(
unc_source="Central",
data_type="data",
):
load_source = "Central" if unc_source == "QCDScale" else unc_source
var_check = f"{var_input}"
for key_tuple, hist_map in items_dict.items():
for var, var_hist in hist_map.items():
scales = ["Up", "Down"] if unc_source != "Central" else ["Central"]
scales = ["Up", "Down"] if load_source != "Central" else ["Central"]
for scale in scales:
if unc_source != "Central" and dataset_type != data_type:
var_check = f"{var_input}_{unc_source}_{scale}"
if load_source != "Central" and dataset_type != data_type:
var_check = f"{var_input}_{load_source}_{scale}"
if var != var_check:
continue

final_key = (key_tuple, (unc_source, scale))
final_key = (key_tuple, (load_source, scale))
if dataset_type not in all_hist_dict.keys():
all_hist_dict[dataset_type] = {}
if final_key not in all_hist_dict[dataset_type]:
Expand Down
5 changes: 4 additions & 1 deletion Analysis/HistProducerFromNTuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ def BuildAllHistActions(
uncs_to_compute.update(
{
key: setup.global_params["scales"]
for key in unc_cfg_dict["shape"].keys()
for key, params in unc_cfg_dict["shape"].items()
if not (
isinstance(params, dict) and params.get("data_driven", False)
)
}
)
print(uncs_to_compute)
Expand Down
5 changes: 4 additions & 1 deletion Analysis/HistTupleProducer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def createHistTuple(
print("Norm uncertainties to consider:", norm_uncertainties)
scale_uncertainties = set()
if setup.global_params["compute_unc_variations"]:
scale_uncertainties.update(unc_cfg_dict["shape"].keys())
for unc_name, unc_params in unc_cfg_dict["shape"].items():
if isinstance(unc_params, dict) and unc_params.get("data_driven", False):
continue
scale_uncertainties.add(unc_name)
print("Scale uncertainties to consider:", scale_uncertainties)

print("Defining binnings for variables")
Expand Down
Loading