Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
9d24291
produce new theory cards if fns=fonll
RoyStegeman Jun 9, 2023
24cf458
first draft for merging of fonll grids
RoyStegeman Jun 12, 2023
16cce40
Merge branch 'main' into num_fonll
andreab1997 Jul 25, 2023
a3a4e76
First draft on cli producing theory cards for pinefarm
andreab1997 Jul 27, 2023
715f231
Add fonll-parts key
andreab1997 Jul 27, 2023
3df8311
Add fonll-parts key
andreab1997 Jul 27, 2023
73f4b81
First draft of full implementation
andreab1997 Jul 31, 2023
cbd6abe
Add possibility of doing the combination only with step func
andreab1997 Jul 31, 2023
3ca875c
Use DAMPPOWER key
andreab1997 Jul 31, 2023
b47308e
Add issimFONLL func
andreab1997 Jul 31, 2023
4620046
Remove wrong .self
andreab1997 Jul 31, 2023
9cc79dc
Add test on is_dis
andreab1997 Jul 31, 2023
80595d0
Add test on issimFONLL
andreab1997 Jul 31, 2023
34638e0
Add test for produce_fonll_tcards
andreab1997 Jul 31, 2023
761bdbc
Add test also for FONLL-B
andreab1997 Jul 31, 2023
a0201bb
Change naming conventions for theorycards
andreab1997 Jul 31, 2023
db43104
Add test for operator cards production
andreab1997 Jul 31, 2023
a189ff7
Add tests for FONLLInfo
andreab1997 Jul 31, 2023
bf985eb
Update pineappl
felixhekhorn Jul 31, 2023
986cf46
Change fonll-parts to FONLLParts
andreab1997 Jul 31, 2023
904cbb9
Merge branch 'num_fonll' of github.com:NNPDF/pineko into num_fonll
andreab1997 Jul 31, 2023
4b16a92
Fix case without damping
andreab1997 Jul 31, 2023
099523a
Use function scale instead of scale by bin
andreab1997 Jul 31, 2023
aecf0cd
Avoid counting the minus sign twice
andreab1997 Jul 31, 2023
0399a59
Fix damping
andreab1997 Jul 31, 2023
499f857
Make damping setting depend on theory card
andreab1997 Jul 31, 2023
48c83d4
Doing the damp correctly despite the paper...
andreab1997 Jul 31, 2023
b4ca9b7
Change fonll paths
andreab1997 Aug 2, 2023
b474004
Make all the fktables to be merged optional
andreab1997 Aug 2, 2023
8b45356
Correct small bug
andreab1997 Aug 2, 2023
1b206d0
Correct other small bug
andreab1997 Aug 2, 2023
12c1693
First draft of automation for combine_fonll
andreab1997 Aug 2, 2023
88e780d
Correct small bug
andreab1997 Aug 2, 2023
9ac3cb7
Correct other small bug
andreab1997 Aug 2, 2023
77bfad4
Add dot
andreab1997 Aug 2, 2023
967a9d7
Allow ingredients to not exists
andreab1997 Aug 2, 2023
6d6d310
Correct spelling error
andreab1997 Aug 2, 2023
f6906ec
Add some utility to the CLI
andreab1997 Aug 2, 2023
74eb2fa
Remove help for args
andreab1997 Aug 2, 2023
96394dd
Remove wrong stem
andreab1997 Aug 2, 2023
c0e613c
Write Success and Failure messages
andreab1997 Aug 2, 2023
e14e22f
Modify skipping message
andreab1997 Aug 2, 2023
ebcd6fe
fix theorycards check in case only one
RoyStegeman Aug 22, 2023
524429a
Add N3LO
andreab1997 Sep 18, 2023
24bfe64
Merge branch 'num_fonll' of github.com:NNPDF/pineko into num_fonll
andreab1997 Sep 18, 2023
c29463b
add config to nfonll cli
giacomomagni Sep 18, 2023
fbb7500
run pre-commit
andreab1997 Sep 19, 2023
3778f27
Use recipe for PTO of FNS
andreab1997 Sep 19, 2023
fa7a60b
Correct bug
andreab1997 Sep 19, 2023
523498a
Try to reduce theories form 7 to 5
giacomomagni Sep 20, 2023
acd6d81
fix tests
giacomomagni Sep 20, 2023
56ec7d9
black
giacomomagni Sep 20, 2023
6de60e0
Merge branch 'main' into num_fonll
giacomomagni Sep 21, 2023
b59b268
Merge branch 'num_fonll' into optimize_number_theories
giacomomagni Sep 21, 2023
4a44d08
Update src/pineko/check.py
andreab1997 Sep 21, 2023
c718a1f
Avoid repetition in fonll and change back to nFONLL
andreab1997 Sep 21, 2023
238f880
Fix bench_fonll
andreab1997 Sep 21, 2023
864742f
Fix bench_evolve
andreab1997 Sep 21, 2023
b4fd0d3
Merge branch 'num_fonll' into optimize_number_theories
andreab1997 Sep 21, 2023
175ee2a
Update src/pineko/cli/fonll.py
andreab1997 Sep 21, 2023
3708a89
add a check on FONLL theories
giacomomagni Sep 21, 2023
f4f0a2c
black
giacomomagni Sep 21, 2023
a7d64ca
fix merge
giacomomagni Sep 21, 2023
999daee
Merge pull request #119 from NNPDF/optimize_number_theories
giacomomagni Sep 25, 2023
9aad606
update theory ID in fonll tcards
giacomomagni Sep 28, 2023
5bca6e7
print theory card path for fonll_tcards
RoyStegeman Sep 29, 2023
a2998a3
Change simFONLL to num_fonll
andreab1997 Oct 3, 2023
1b310eb
Minor changes
andreab1997 Oct 3, 2023
315ed38
Remove cast to int for nf_default
andreab1997 Oct 3, 2023
04f0ed7
remove unused value in MIXED_NFFF_LIST
RoyStegeman Oct 3, 2023
e116783
Minor changes
andreab1997 Oct 4, 2023
034db70
fix mixed FONLL by decoupling PTO and PTODIS
RoyStegeman Oct 4, 2023
25a13d5
Fix benchmarks
andreab1997 Oct 5, 2023
fba7f9f
Update src/pineko/fonll.py
andreab1997 Oct 5, 2023
35371fd
Update src/pineko/fonll.py
andreab1997 Oct 5, 2023
860e5f4
Update src/pineko/fonll.py
andreab1997 Oct 5, 2023
43bcaa3
Update src/pineko/fonll.py
andreab1997 Oct 5, 2023
b21ee31
Update src/pineko/fonll.py
andreab1997 Oct 5, 2023
91c527f
Remove random names
andreab1997 Oct 5, 2023
c8b8f03
Remove unnecessary else
andreab1997 Oct 5, 2023
11d8f84
Remove print in the fonll cli
andreab1997 Oct 5, 2023
03d061b
tiny fix
RoyStegeman Oct 5, 2023
dada400
update PTO to PTODIS for covoluting with eko
RoyStegeman Oct 5, 2023
3f3c887
improve comment
RoyStegeman Oct 5, 2023
785fc11
fix check same tcards fonll
RoyStegeman Oct 9, 2023
233037b
don't add PTODIS because DAMP!=0
RoyStegeman Oct 9, 2023
3745e92
minor updates num fonll
RoyStegeman Oct 9, 2023
f0ec07c
Update tests/test_fonll.py
andreab1997 Oct 10, 2023
8ad2d1f
Update tests/test_fonll.py
andreab1997 Oct 10, 2023
f22cc27
Run pre-commit
andreab1997 Oct 10, 2023
5313744
Correct test error
andreab1997 Oct 10, 2023
cc66bb4
Print a warning for the fktables that do not exist during combination
andreab1997 Oct 10, 2023
4cfc8dd
pass cfg to configs.detect
giacomomagni Oct 10, 2023
e364fff
Update pineappl version
andreab1997 Oct 10, 2023
d59ea5c
Merge branch 'main' into num_fonll
felixhekhorn Oct 10, 2023
eb73599
Add explicit check for empty ekos
andreab1997 Oct 11, 2023
1b32ca0
Extend fonll_b check
andreab1997 Oct 12, 2023
025a578
improve empty eko error
giacomomagni Oct 12, 2023
1a495a7
Update check if the grid is empty
giacomomagni Oct 13, 2023
790c0a5
Put the paths check in the constructor of FONLLInfo
andreab1997 Oct 17, 2023
3e688bc
Correct bug in FONLLInfo constructor
andreab1997 Oct 17, 2023
d7b610f
Correct other small typo
andreab1997 Oct 17, 2023
b8ca270
Add grid name to tmp eko file
andreab1997 Oct 17, 2023
8a1c916
Merge branch 'main' into num_fonll
giacomomagni Oct 18, 2023
04374a4
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
efd9a0b
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
9b7edb1
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
73c5052
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
61b1802
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
837ce2a
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
f5cec44
Update src/pineko/fonll.py
andreab1997 Oct 18, 2023
115b820
Update src/pineko/check.py
andreab1997 Oct 18, 2023
ece695b
Move the dampings construction in a separate function
andreab1997 Oct 18, 2023
e406de6
Move update of fk theorycard to separate function
andreab1997 Oct 18, 2023
5efe537
Clarify the relation between damping and 5 subtheories
andreab1997 Oct 18, 2023
34fd85d
Move combination to separate function
andreab1997 Oct 18, 2023
babe6ae
Use bin_left to get the q2grid
andreab1997 Oct 18, 2023
5a3252e
Use CONFIG for FNS, NFFF and parts
andreab1997 Oct 18, 2023
8c9fcef
Cast explicitly theory cards entries
andreab1997 Oct 18, 2023
bb0d3f4
Correct missing test
andreab1997 Oct 18, 2023
bc78002
save NfFF as int instead of str
RoyStegeman Oct 18, 2023
bcfe6ef
Cast again
andreab1997 Oct 18, 2023
b284bb1
Merge branch 'num_fonll' of github.com:NNPDF/pineko into num_fonll
andreab1997 Oct 18, 2023
5ecc635
Correction to tests
andreab1997 Oct 18, 2023
eb6d734
fix: move PTO=PTODIS for fonll-b before extracting PTO value
RoyStegeman Oct 18, 2023
7e385a3
Rework nFONLL config
andreab1997 Oct 19, 2023
6d38acb
Correct error for pylint
andreab1997 Oct 19, 2023
2e76e57
Revert "Correct error for pylint"
felixhekhorn Oct 19, 2023
1165dd9
Revert "Rework nFONLL config"
felixhekhorn Oct 19, 2023
6d87995
Update src/pineko/cli/fonll.py
andreab1997 Oct 19, 2023
e64aa94
Use SubTheoryConfig
felixhekhorn Oct 19, 2023
61c487a
Update src/pineko/cli/fonll.py
felixhekhorn Oct 19, 2023
b5674d0
Booleanize subtheory scheme
felixhekhorn Oct 19, 2023
155200f
Merge branch 'num_fonll-fh-1' of github.com:N3PDF/pineko into num_fon…
felixhekhorn Oct 19, 2023
f28d9a2
adding some docstring about fonll mapping
giacomomagni Oct 19, 2023
17d5956
fix minor
giacomomagni Oct 19, 2023
fdf9a05
Merge branch 'num_fonll-fh-1' into num_fonll
felixhekhorn Oct 20, 2023
78ab9c9
Recover bench_fonll
felixhekhorn Oct 20, 2023
914dec1
Update benchmarks/bench_evolve.py
andreab1997 Oct 23, 2023
b37cb54
Update src/pineko/check.py
andreab1997 Oct 23, 2023
e35a95f
Update src/pineko/check.py
andreab1997 Oct 23, 2023
7dca3a4
Update src/pineko/check.py
felixhekhorn Oct 23, 2023
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
36 changes: 35 additions & 1 deletion benchmarks/bench_evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,47 @@
import pineappl
import pytest
import yaml
from eko import couplings as sc

import pineko
import pineko.evolve
import pineko.theory_card


@pytest.mark.parametrize("theoryid,is_mixed", [(400, False), (208, True)])
Comment thread
felixhekhorn marked this conversation as resolved.
def benchmark_write_operator_card_from_file_num_fonll(
tmp_path, test_files, test_configs, theoryid, is_mixed
):
tcard = pineko.theory_card.load(theoryid)
tcards_path_list = pineko.fonll.dump_tcards(tcard, tmp_path, theoryid)
pine_path = (
test_files
/ "data"
/ "grids"
/ "400"
/ "HERA_NC_225GEV_EP_SIGMARED.pineappl.lz4"
)
default_path = test_files / "data" / "operator_cards" / "400" / "_template.yaml"
num_opcard = 7 if is_mixed else 5
targets_path_list = [
tmp_path / f"test_opcard_{num}.yaml" for num in range(num_opcard)
]
for target_path, tcard_path in zip(targets_path_list, tcards_path_list):
with open(tcard_path, encoding="utf-8") as f:
tcard = yaml.safe_load(f)
_x_grid, _q2_grid = pineko.evolve.write_operator_card_from_file(
pine_path, default_path, target_path, tcard
)
# Check if the opcards are ok
for opcard_path, cfg in zip(
targets_path_list,
pineko.fonll.MIXED_FNS_CONFIG if is_mixed else pineko.fonll.FNS_CONFIG,
):
with open(opcard_path, encoding="utf-8") as f:
ocard = yaml.safe_load(f)
for entry in ocard["mugrid"]:
assert entry[1] == int(cfg.nf)


def benchmark_write_operator_card_from_file(tmp_path, test_files, test_configs):
pine_path = test_files / "data/grids/400/HERA_NC_225GEV_EP_SIGMARED.pineappl.lz4"
default_path = test_files / "data/operator_cards/400/_template.yaml"
Expand Down
28 changes: 28 additions & 0 deletions benchmarks/bench_fonll.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import numpy as np
import pytest
import yaml

import pineko


@pytest.mark.parametrize("theoryid,is_mixed", [(400, False), (208, True)])
def benchmark_produce_fonll_tcards(
tmp_path, test_files, test_configs, theoryid, is_mixed
):
tcard = pineko.theory_card.load(theoryid)
tcard_paths_list = pineko.fonll.dump_tcards(tcard, tmp_path, theoryid)
# Check they are correct
theorycards = []
for path in tcard_paths_list:
with open(path, encoding="UTF-8") as f:
theorycards.append(yaml.safe_load(f))
base_pto = pineko.fonll.FNS_BASE_PTO[tcard["FNS"]]
for num_fonll_tcard, cfg in zip(
theorycards,
pineko.fonll.MIXED_FNS_CONFIG if is_mixed else pineko.fonll.FNS_CONFIG,
):
po = int(base_pto) + (cfg.delta_pto if is_mixed else 0)
assert num_fonll_tcard["FNS"] == cfg.scheme
assert num_fonll_tcard["NfFF"] == int(cfg.nf)
assert num_fonll_tcard["PTO"] == po - 1 if is_mixed and cfg.asy else po
assert num_fonll_tcard["FONLLParts"] == cfg.parts
42 changes: 31 additions & 11 deletions src/pineko/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,49 @@ def check_grid_and_eko_compatible(pineappl_grid, operators, xif, max_as, max_al)
raise ValueError("x grid in pineappl grid and eko operator are NOT compatible!")


def is_fonll_b(fns, lumi):
"""Check if the fktable we are computing is a DIS FONLL-B fktable.
def is_dis(lumi):
"""Check if the fktable we are computing is a DIS fktable.

Parameters
----------
fns : str
flavor number scheme (from the theory card)
lumi : list(list(tuple))
luminosity info

Returns
-------
bool
true if the fktable is a FONLL-B DIS fktable
true if the fktable is a DIS fktable
"""
for lists in lumi:
for el in lists:
for entry in lumi:
for el in entry:
if (not islepton(el[0])) and (not islepton(el[1])):
# in this case we are sure it is not DIS so for sure it is not FONLL-B
# If neither of the incoming particles is a lepton we are sure
# it is not DIS
return False
if fns == "FONLL-B":
return True
return False
return True


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
----------
fns : str
flavor number scheme (from the theory card)
lumi : list(list(tuple))
luminosity info

Returns
-------
bool
true if the fktable is a mixed FONLL DIS fktable
"""
return is_dis(lumi) and fns in ["FONLL-B", "FONLL-D"]


def is_num_fonll(fns):
"""Check if the FNS is a nFONLL FNS."""
return fns in ["FONLL-FFNS", "FONLL-FFN0"]


def orders(grid, max_as, max_al) -> list:
Expand Down
12 changes: 11 additions & 1 deletion src/pineko/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""CLI entry point."""
from . import check, compare, convolute, gen_sv, kfactor, opcard, scaffold, theory_
from . import (
check,
compare,
convolute,
fonll,
gen_sv,
kfactor,
opcard,
scaffold,
theory_,
)
from ._base import command
174 changes: 174 additions & 0 deletions src/pineko/cli/fonll.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
"""CLI entry point to FONLL."""
import pathlib

import click
import rich

from .. import configs, fonll, parser, theory_card
from ._base import command

config_setting = click.option(
"-c",
"--configs",
"cfg",
default=None,
type=click.Path(resolve_path=True, path_type=pathlib.Path),
help="Explicitly specify config file (it has to be a valid TOML file).",
)


class TheoryCardError(Exception):
"""Raised when asked for FONLL theory cards with an original tcard as input that is not asking for FONLL."""


class InconsistentInputsError(Exception):
"""Raised if the inputs are not consistent with FONLL."""


def cfgpath(name, grid):
"""Path of the fktable in 'name' called 'grid' if it exists, else None."""
path = configs.configs["paths"]["fktables"] / name / grid
return path if path.exists() else None


def grids_names(yaml_file):
"""Return the list of the grids in the yaml file."""
yaml_content = parser._load_yaml(yaml_file)
# Turn the operands and the members into paths (and check all of them exist)
ret = []
for operand in yaml_content["operands"]:
for member in operand:
ret.append(f"{member}.{parser.EXT}")
return ret


@command.command("combine_fonll")
@click.argument("theoryID", type=int)
@click.argument("dataset", type=str)
@click.option("--FFNS3", type=int, help="theoryID containing the ffns3 fktable")
@click.option("--FFN03", type=int, help="theoryID containing the ffn03 fktable")
@click.option("--FFNS4", type=int, help="theoryID containing the ffns4 fktable")
@click.option("--FFNS4til", type=int, help="theoryID containing the ffns4til fktable")
@click.option("--FFNS4bar", type=int, help="theoryID containing the ffns4bar fktable")
@click.option("--FFN04", type=int, help="theoryID containing the ffn04 fktable")
@click.option("--FFNS5", type=int, help="theoryID containing the ffns5 fktable")
@click.option("--FFNS5til", type=int, help="theoryID containing the ffns5til fktable")
@click.option("--FFNS5bar", type=int, help="theoryID containing the ffns5bar fktable")
Comment on lines +48 to +56
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a thousand options, couldn't we just use a list of integers with some encoding?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe yes but they are all options because they are all optional. I believe that following your suggestion we may lose that flexibility or at least in clarity.

Copy link
Copy Markdown
Collaborator

@alecandido alecandido Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, is this really the case? I believe you can choose to not have a flavor, or some part of it, but not all the options are independent.

We may always have a scheme to interpret the list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the code point of view you have full flexibility. Of course from the physics point of view there are some choices that just do not make sense. The code would not fail though

@click.option("--overwrite", is_flag=True, help="Allow files to be overwritten")
@config_setting
def subcommand(
theoryid,
dataset,
ffns3,
ffn03,
ffns4,
ffns4til,
ffns4bar,
ffn04,
ffns5,
ffns5til,
ffns5bar,
overwrite,
cfg,
):
"""Combine the different FKs needed to produce the FONLL prescription."""
path = configs.detect(cfg)
base_configs = configs.load(path)
configs.configs = configs.defaults(base_configs)
if cfg is not None:
print(f"Configurations loaded from '{path}'")

# Checks

if not ffns3 or not ffn03:
raise InconsistentInputsError("ffns3 and/or ffn03 is not provided.")

if any([ffns4, ffns4til, ffns4bar]):
if ffns4:
if any([ffns4til, ffns4bar]):
raise InconsistentInputsError(
"If ffns4 is provided no ffnstil or ffnsbar should be provided."
)
else:
if ffns4til is None or ffns4bar is None:
raise InconsistentInputsError(
"if ffnstil is provided also ffnsbar should be provided, and vice versa."
)
else:
raise InconsistentInputsError("ffns4 is not provided.")

# Do we consider two masses, i.e. mc and mb
two_masses = False
if any([ffns5, ffns5til, ffns5bar]):
two_masses = True
if ffns5:
if any([ffns5til, ffns5bar]):
raise InconsistentInputsError(
"If ffns5 is provided no ffnstil or ffnsbar should be provided."
)
else:
if ffns5til is None or ffns5bar is None:
raise InconsistentInputsError(
"if ffnstil is provided also ffnsbar should be provided, and vice versa."
)

if (ffn04 is None and two_masses) or (ffn04 is not None and not two_masses):
raise InconsistentInputsError(
"If two masses are to be considered, both ffn04 and the nf=5 coefficient should be provided"
)

# Get theory info
tcard = theory_card.load(theoryid)
if not "DAMPPOWER" in tcard:
if tcard["DAMP"] != 0:
raise InconsistentInputsError("If DAMP is set, set also DAMPPOWER")
tcard["DAMPPOWER"] = None
# Getting the paths to the grids
grids_name = grids_names(configs.configs["paths"]["ymldb"] / f"{dataset}.yaml")
for grid in grids_name:
# Checking if it already exists
new_fk_path = configs.configs["paths"]["fktables"] / str(theoryid) / grid
if new_fk_path.exists():
if not overwrite:
rich.print(
f"[green]Success:[/] skipping existing FK Table {new_fk_path}"
)
return
fonll.produce_combined_fk(
*(
cfgpath(str(name), grid)
for name in (
ffns3,
ffn03,
ffns4,
ffns4til,
ffns4bar,
ffn04,
ffns5,
ffns5til,
ffns5bar,
)
),
theoryid,
damp=(tcard["DAMP"], tcard["DAMPPOWER"]),
cfg=cfg,
)
if new_fk_path.exists():
rich.print(f"[green]Success:[/] Wrote FK table to {new_fk_path}")
else:
rich.print(f"[red]Failure:[/]")


@command.command("fonll_tcards")
@click.argument("theoryID", type=int)
@config_setting
def fonll_tcards(theoryid, cfg):
"""Produce the FONLL tcards starting from the original tcard given by the theoryID."""
path = configs.detect(cfg)
base_configs = configs.load(path)
configs.configs = configs.defaults(base_configs)
tcard = theory_card.load(theoryid)
tcard_parent_path = theory_card.path(theoryid).parent
if "FONLL" not in tcard["FNS"]:
raise TheoryCardError("The theorycard does not correspond to an FONLL scheme.")
fonll.dump_tcards(tcard, tcard_parent_path, theoryid)
14 changes: 10 additions & 4 deletions src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ 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
is_fns = int(check.is_fonll_b(tcard["FNS"], pineappl_grid.lumi()))
# NB: This would not happen for nFONLL
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 All @@ -128,9 +129,14 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
matching_scales=heavy_quarks.MatchingScales(masses * thresholds_ratios),
origin=(tcard["Q0"] ** 2, tcard["nf0"]),
)
operators_card["mugrid"] = [
(float(np.sqrt(q2)), int(nf_default(q2, atlas))) for q2 in q2_grid
]
# If we are producing nFONLL FKs we need to look to NfFF...
if check.is_num_fonll(tcard["FNS"]):
Comment thread
RoyStegeman marked this conversation as resolved.
nf = tcard["NfFF"]
operators_card["mugrid"] = [(float(np.sqrt(q2)), int(nf)) for q2 in q2_grid]
else:
operators_card["mugrid"] = [
(float(np.sqrt(q2)), nf_default(q2, atlas)) for q2 in q2_grid
]
if "integrability_version" in pineappl_grid.key_values():
x_grid = evol_info.x1
x_grid = np.append(x_grid, 1.0)
Expand Down
Loading