Skip to content

Commit

Permalink
Merge pull request #140 from NNPDF/correct_damping
Browse files Browse the repository at this point in the history
Correct c and bmatching to be squared and add separate damping for charm and bottom
  • Loading branch information
andreab1997 authored Dec 1, 2023
2 parents cd948b7 + 9ca4990 commit 68c41e7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
14 changes: 9 additions & 5 deletions src/pineko/cli/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ 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"] == 1:
if not "DAMPPOWERc" in tcard or not "DAMPPOWERb" in tcard:
raise InconsistentInputsError(
"If DAMP is set, set also DAMPPOWERb and DAMPPOWERc"
)
else:
tcard["DAMPPOWERb"] = 0
tcard["DAMPPOWERc"] = 0
# 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 +154,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
24 changes: 14 additions & 10 deletions src/pineko/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,19 @@ def update_fk_theorycard(combined_fk, input_theorycard_path):
combined_fk.set_key_value("theory", str(theorycard))


def produce_dampings(theorycard_constituent_fks, fonll_info, damp):
def produce_dampings(theorycard_constituent_fks, fonll_info, damppowerc, damppowerb):
"""Return the damping factors for each of the relevant masses."""
cmatching = theorycard_constituent_fks["kcThr"] * theorycard_constituent_fks["mc"]
bmatching = theorycard_constituent_fks["kbThr"] * theorycard_constituent_fks["mb"]
cmatching2 = (
theorycard_constituent_fks["kcThr"] * theorycard_constituent_fks["mc"]
) ** 2
bmatching2 = (
theorycard_constituent_fks["kbThr"] * theorycard_constituent_fks["mb"]
) ** 2
q2grid = fonll_info.Q2grid
step_function_charm = (cmatching) ** 2 < q2grid
step_function_bottom = (bmatching) ** 2 < q2grid
damping_factor_charm = (1 - cmatching / q2grid) ** damp[1]
damping_factor_bottom = (1 - bmatching / q2grid) ** damp[1]
step_function_charm = cmatching2 < q2grid
step_function_bottom = bmatching2 < q2grid
damping_factor_charm = (1 - cmatching2 / q2grid) ** damppowerc
damping_factor_bottom = (1 - bmatching2 / q2grid) ** damppowerb
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 +166,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 All @@ -173,8 +177,8 @@ def produce_combined_fk(
fk_dict = fonll_info.fks
dampings = (
None
if damp[0] == 0
else produce_dampings(theorycard_constituent_fks, fonll_info, damp)
if damp[0] == -1
else produce_dampings(theorycard_constituent_fks, fonll_info, damp[1], damp[2])
)
combined_fk = combine(fk_dict, dampings=dampings)
input_theorycard_path = (
Expand Down

0 comments on commit 68c41e7

Please sign in to comment.