Skip to content

Commit 611be6d

Browse files
Make sure that only Q2 is cut when using --q2_min
1 parent 2989715 commit 611be6d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/pineko/comparator.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import pandas as pd
55
import pineappl
66

7+
from .check import is_dis
8+
79

810
class GridtoFKError(Exception):
911
"""Raised when the difference between the Grid and FK table is above some threshold."""
@@ -71,7 +73,7 @@ def compare(pine, fktable, max_as, max_al, pdfs, scales, threshold=5.0, q2_min=1
7173
xfxs=[pdf.xfxQ2 for pdf in pdfsets],
7274
alphas=pdfsets[0].alphasQ2, # TODO: Choose which PDF should be used
7375
order_mask=order_mask,
74-
xi=[scales], # TODO: Exposes as a list
76+
xi=[scales],
7577
)
7678
fktable_predictions = fktable.convolve(
7779
pdg_convs=fktable.convolutions,
@@ -91,8 +93,12 @@ def compare(pine, fktable, max_as, max_al, pdfs, scales, threshold=5.0, q2_min=1
9193
df["FkTable"] = after
9294
df["permille_error"] = (after / before - 1.0) * 1000.0
9395

94-
# Remove Q2 points that are below 1 GeV2
95-
check_df = df[df["O2 left"] >= q2_min] if "O2 left" in df.columns else df
96+
# For some DIS girds, remove Q2 points that are below 1 GeV2
97+
check_df = (
98+
df[df["O2 left"] >= q2_min]
99+
if "O2 left" in df.columns and is_dis(pine.convolutions)
100+
else df
101+
)
96102
if (check_df["permille_error"].abs() >= threshold).any():
97103
print(check_df)
98104
raise GridtoFKError(

0 commit comments

Comments
 (0)