Skip to content

Commit

Permalink
Extend fonll_b check
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 committed Oct 12, 2023
1 parent eb73599 commit 1b32ca0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
11 changes: 7 additions & 4 deletions src/pineko/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def is_dis(lumi):
return True


def is_fonll_b(fns, lumi):
"""Check if the fktable we are computing is a DIS FONLL-B fktable.
def is_fonll_mixed(fns, lumi):
"""Check if the fktable we are computing is FONLL-B, FONLL-D or, in general, a mixed FONLL fktable.
Parameters
----------
Expand All @@ -151,9 +151,12 @@ def is_fonll_b(fns, lumi):
Returns
-------
bool
true if the fktable is a FONLL-B DIS fktable
true if the fktable is a mixed FONLL DIS fktable
"""
if is_dis(lumi) and fns == "FONLL-B":
if not is_dis(lumi):
return False
mixed_FONLL_fns = ["FONLL-B", "FONLL-D", "FONLL-F"]
if fns in mixed_FONLL_fns:
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
"""
# Add a +1 to the orders for the difference in convention between nnpdf and pineappl
# NB: This would not happen for nFONLL
is_fns = int(check.is_fonll_b(tcard["FNS"], pineappl_grid.lumi()))
is_fns = int(check.is_fonll_mixed(tcard["FNS"], pineappl_grid.lumi()))
max_as = 1 + tcard["PTO"] + is_fns
max_al = 1 + tcard["QED"]
# ... in order to create a mask ...
Expand Down
2 changes: 1 addition & 1 deletion src/pineko/theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def fk(self, name, grid_path, tcard, pdf):
return
max_as = 1 + int(tcard["PTO"])
# Check if we are computing FONLL-B fktable and eventually change max_as
if check.is_fonll_b(
if check.is_fonll_mixed(
tcard["FNS"],
grid.lumi(),
):
Expand Down
18 changes: 11 additions & 7 deletions tests/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@ def test_is_dis():
assert pineko.check.is_dis(nondis_fake_lumi) is False


def test_is_fonll_b():
def test_is_fonll_mixed():
fns = "FONLL-B"
lumi_first = [[(-12, 1, 2.0), (-13, 1, 5.0)]]
lumi_second = [[(1, 11, 1.0), (3, 11, 5.0)]]
assert pineko.check.is_fonll_b(fns, lumi_first) is True
assert pineko.check.is_fonll_b(fns, lumi_second) is True
assert pineko.check.is_fonll_mixed(fns, lumi_first) is True
assert pineko.check.is_fonll_mixed(fns, lumi_second) is True
lumi_crazy = [[(1, 1, 4.0), (2, 11, 3.0)]]
assert pineko.check.is_fonll_b(fns, lumi_crazy) is False
assert pineko.check.is_fonll_mixed(fns, lumi_crazy) is False
fns = "FONLL-C"
assert pineko.check.is_fonll_b(fns, lumi_first) is False
assert pineko.check.is_fonll_b(fns, lumi_second) is False
assert pineko.check.is_fonll_b(fns, lumi_crazy) is False
assert pineko.check.is_fonll_mixed(fns, lumi_first) is False
assert pineko.check.is_fonll_mixed(fns, lumi_second) is False
assert pineko.check.is_fonll_mixed(fns, lumi_crazy) is False
fns = "FONLL-D"
assert pineko.check.is_fonll_mixed(fns, lumi_first) is True
assert pineko.check.is_fonll_mixed(fns, lumi_second) is True
assert pineko.check.is_fonll_mixed(fns, lumi_crazy) is False


def test_is_num_fonll():
Expand Down

0 comments on commit 1b32ca0

Please sign in to comment.