Skip to content

Commit

Permalink
separate bins
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed Mar 19, 2024
1 parent 7c71333 commit 2b3ef41
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/pinefarm/external/nnlojet/nnpdf_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ def select_selectors(experiment, process):
The experiment defines the cuts to be applied to each variable.
The process defines the name of the variables in NNLOJET
"""
cuts = {"rapidity": (None, None), "pt": (20.0, None), "inv_mass": (None, None), "mt": (None, None)}
cuts = {
"rapidity": (None, None),
"pt": (20.0, None),
"inv_mass": (None, None),
"mt": (None, None),
}

variables = {"rapidity": [], "pt": [], "inv_mass": [], "mt": []}

Expand Down Expand Up @@ -267,9 +272,10 @@ def generate_pinecard_from_nnpdf(nnpdf_dataset, scale="mz", output_path="."):
for i, val in enumerate(unique_m2):
idx = kin_df["M2"]["mid"] == val
tmp = _1d_histogram(kin_df[idx], another_v)
tmp["name"] = f"{another_v}_bin_{i}"
tmp["extra_selectors"] = [
{
"observable": m_name,
"observable": f"{m_name}",
"min": probable_bounds[i],
"max": probable_bounds[i + 1],
}
Expand All @@ -279,7 +285,9 @@ def generate_pinecard_from_nnpdf(nnpdf_dataset, scale="mz", output_path="."):
# inclusive cross section, just create a big enough histogram
histograms = [{"observable": "y", "bins": [-10.0, 10.0], "name": "tot"}]
else:
raise NotImplementedError("3D distributions not implemented or process not recognized")
raise NotImplementedError(
"3D distributions not implemented or process not recognized"
)

is_normalized = metadata.theory.operation.lower() == "ratio"
if is_normalized:
Expand Down

0 comments on commit 2b3ef41

Please sign in to comment.