Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct c and bmatching to be squared and add separate damping for charm and bottom #140

Merged
merged 8 commits into from
Dec 1, 2023
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"] not in [-1,0]:
andreab1997 marked this conversation as resolved.
Show resolved Hide resolved
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]
andreab1997 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading