Skip to content

Commit

Permalink
Add the possibility of damping c and b with different damppower
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 committed Dec 1, 2023
1 parent dd852d8 commit eff1fab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/pineko/cli/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ def subcommand(

# 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
if tcard["DAMP"] != 0:
if not "DAMPPOWERC" in tcard or not "DAMPPOWERB" in tcard:
raise InconsistentInputsError("If DAMP is set, set also DAMPPOWERB and DAMPPOWERC")
else:
tcard["DAMPPOWERB"] = None
tcard["DAMPPOWERC"] = None
# Getting the paths to the grids
grids_name = grids_names(configs.configs["paths"]["ymldb"] / f"{dataset}.yaml")
for grid in grids_name:
Expand Down Expand Up @@ -150,7 +152,7 @@ def subcommand(
)
),
theoryid,
damp=(tcard["DAMP"], tcard["DAMPPOWER"]),
damp=(tcard["DAMP"], tcard["DAMPPOWERC"], tcard["DAMPPOWERB"]),
cfg=cfg,
)
if new_fk_path.exists():
Expand Down
4 changes: 2 additions & 2 deletions src/pineko/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def produce_dampings(theorycard_constituent_fks, fonll_info, damp):
step_function_charm = cmatching2 < q2grid
step_function_bottom = bmatching2 < q2grid
damping_factor_charm = (1 - cmatching2 / q2grid) ** damp[1]
damping_factor_bottom = (1 - bmatching2 / q2grid) ** damp[1]
damping_factor_bottom = (1 - bmatching2 / q2grid) ** damp[2]
damping_factor_charm *= step_function_charm
damping_factor_bottom *= step_function_bottom
return {"mc": damping_factor_charm, "mb": damping_factor_bottom}
Expand Down Expand Up @@ -162,7 +162,7 @@ def produce_combined_fk(
ffns5til,
ffns5bar,
theoryid,
damp=(0, None),
damp=(0, None, None),
cfg=None,
):
"""Combine the FONLL FK tables into one single FK table."""
Expand Down

0 comments on commit eff1fab

Please sign in to comment.