Skip to content

Commit

Permalink
fix issue #138
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Mar 8, 2024
1 parent 2c755c6 commit 1b88551
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/source/theory/fonll.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Manual procedure

6. Combine the various |FK| tables into a single file, using the command::

pineko fonll combine THEORY_ID DATASET --FFNS3 THEORY_ID00 --FFN03 THEORY_ID01 --FFNS4til THEORY_ID02 --FFNS4bar THEORY_ID03 --FFN04 THEORY_ID04 --FFNS5til THEORY_ID05 --FFNS5bar THEORY_ID06
pineko fonll combine THEORY_ID DATASET --FFNS3 THEORY_ID00 --FFN03 THEORY_ID01 --FFNS4zeromass THEORY_ID02 --FFNS4massive THEORY_ID03 --FFN04 THEORY_ID04 --FFNS5zeromass THEORY_ID05 --FFNS5massive THEORY_ID06

where the first 3 theories are needed to perform |FONLL| on charm effects,
while the last 4 are needed to include also bottom effects.
Expand Down
2 changes: 1 addition & 1 deletion src/pineko/cli/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def command():

def load_config(cfg):
"""Load configuration files."""
# if just help is needed, return before loading
# if only help is needed, return before loading
if help_requested():
return
path = configs.detect(cfg)
Expand Down
40 changes: 24 additions & 16 deletions src/pineko/cli/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,30 @@ def fonll_(cfg):
@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("--FFNS4til", type=int, help="theoryID containing the ffns4til fktable")
@click.option("--FFNS4bar", type=int, help="theoryID containing the ffns4bar fktable")
@click.option(
"--FFNS4zeromass", type=int, help="theoryID containing the ffns4 zeromass fktable"
)
@click.option(
"--FFNS4massive", type=int, help="theoryID containing the ffns4massive fktable"
)
@click.option("--FFN04", type=int, help="theoryID containing the ffn04 fktable")
@click.option("--FFNS5til", type=int, help="theoryID containing the ffns5til fktable")
@click.option("--FFNS5bar", type=int, help="theoryID containing the ffns5bar fktable")
@click.option(
"--FFNS5zeromass", type=int, help="theoryID containing the ffns5 zeromass fktable"
)
@click.option(
"--FFNS5massive", type=int, help="theoryID containing the ffns5massive fktable"
)
@click.option("--overwrite", is_flag=True, help="Allow files to be overwritten")
def combine(
theoryid,
dataset,
ffns3,
ffn03,
ffns4til,
ffns4bar,
ffns4zeromass,
ffns4massive,
ffn04,
ffns5til,
ffns5bar,
ffns5zeromass,
ffns5massive,
overwrite,
):
"""Combine the different FKs needed to produce the FONLL prescription."""
Expand All @@ -44,11 +52,11 @@ def combine(
dataset,
ffns3,
ffn03,
ffns4til,
ffns4bar,
ffns4zeromass,
ffns4massive,
ffn04,
ffns5til,
ffns5bar,
ffns5zeromass,
ffns5massive,
overwrite,
)

Expand Down Expand Up @@ -139,10 +147,10 @@ def fks(theoryid, datasets, pdf, overwrite):
dataset,
ffns3=f"{theoryid}00",
ffn03=f"{theoryid}01",
ffns4til=f"{theoryid}02",
ffns4bar=f"{theoryid}03",
ffns4zeromass=f"{theoryid}02",
ffns4massive=f"{theoryid}03",
ffn04=f"{theoryid}04",
ffns5til=f"{theoryid}05",
ffns5bar=f"{theoryid}06",
ffns5zeromass=f"{theoryid}05",
ffns5massive=f"{theoryid}06",
overwrite=overwrite,
)
59 changes: 34 additions & 25 deletions src/pineko/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"""FONLL schemes with mixed orders."""
# Notice we rely on the order defined by the FONLLInfo class
FK_TO_DAMP = {
"mc": ["ffn03", "ffns4til", "ffn04", "ffns5til"],
"mb": ["ffn04", "ffns5til"],
"mc": ["ffn03", "ffns4zeromass", "ffn04", "ffns5zeromass"],
"mb": ["ffn04", "ffns5zeromass"],
}
FK_WITH_MINUS = ["ffn03", "ffn04"] # asy terms should be subtracted, therefore the sign
"""FNS schemes to be subtracted during the FONLL procedure."""
Expand All @@ -48,17 +48,24 @@ class FONLLInfo:
"""Class containing all the information for FONLL predictions."""

def __init__(
self, ffns3, ffn03, ffns4til, ffns4bar, ffn04, ffns5til, ffns5bar
self,
ffns3,
ffn03,
ffns4zeromass,
ffns4massive,
ffn04,
ffns5zeromass,
ffns5massive,
) -> None:
"""Initialize fonll info."""
self.paths = {
"ffns3": ffns3,
"ffn03": ffn03,
"ffns4til": ffns4til,
"ffns4bar": ffns4bar,
"ffns4zeromass": ffns4zeromass,
"ffns4massive": ffns4massive,
"ffn04": ffn04,
"ffns5til": ffns5til,
"ffns5bar": ffns5bar,
"ffns5zeromass": ffns5zeromass,
"ffns5massive": ffns5massive,
}
actually_existing_paths = [p for p, g in self.paths.items() if g is not None]
for p in self.paths:
Expand Down Expand Up @@ -187,28 +194,28 @@ def assembly_combined_fk(
dataset,
ffns3,
ffn03,
ffns4til,
ffns4bar,
ffns4zeromass,
ffns4massive,
ffn04,
ffns5til,
ffns5bar,
ffns5zeromass,
ffns5massive,
overwrite,
):
"""Perform consistency checks and combine the FONLL FK tables into one single FK table."""
# Checks
if not ffns3 or not ffn03:
raise InconsistentInputsError("ffns3 and/or ffn03 is not provided.")

if ffns4til is None or ffns4bar is None:
if ffns4zeromass is None or ffns4massive is None:
raise InconsistentInputsError(
"At least one of ffns4til and ffns4bar should be provided."
"At least one of ffns4 zeromass and ffns4 massive should be provided."
)

# Do we consider two masses, i.e. mc and mb
if any([ffns5til, ffns5bar, ffn04]):
if (ffns5til is None and ffns5bar is None) or ffn04 is None:
if any([ffns5zeromass, ffns5massive, ffn04]):
if (ffns5zeromass is None and ffns5massive is None) or ffn04 is None:
raise InconsistentInputsError(
"To include nf5 contributions, ffn04 and at least one between ffns5til and ffns5bar are mandatory"
"To include nf5 contributions, ffn04 and at least one between ffns5 zeromass and ffns5 massive are mandatory"
)

# Get theory info
Expand Down Expand Up @@ -238,11 +245,11 @@ def assembly_combined_fk(
for name in (
ffns3,
ffn03,
ffns4til,
ffns4bar,
ffns4zeromass,
ffns4massive,
ffn04,
ffns5til,
ffns5bar,
ffns5zeromass,
ffns5massive,
)
),
theoryid,
Expand All @@ -257,16 +264,18 @@ def assembly_combined_fk(
def produce_combined_fk(
ffns3,
ffn03,
ffns4til,
ffns4bar,
ffns4zeromass,
ffns4massive,
ffn04,
ffns5til,
ffns5bar,
ffns5zeromass,
ffns5massive,
theoryid,
damp=(0, None, None),
):
"""Combine the FONLL FK tables into one single FK table."""
fonll_info = FONLLInfo(ffns3, ffn03, ffns4til, ffns4bar, ffn04, ffns5til, ffns5bar)
fonll_info = FONLLInfo(
ffns3, ffn03, ffns4zeromass, ffns4massive, ffn04, ffns5zeromass, ffns5massive
)
theorycard_constituent_fks = fonll_info.theorycard_no_fns_pto
fk_dict = fonll_info.fks
dampings = (
Expand Down

0 comments on commit 1b88551

Please sign in to comment.