Skip to content

Commit

Permalink
Move the dampings construction in a separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 committed Oct 18, 2023
1 parent 115b820 commit ece695b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/pineko/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ def Q2grid(self):
FK_WITH_MINUS = ["ffn03", "ffn04"] # asy terms should be subtracted, therefore the sign


def produce_dampings(theorycard_constituent_fks, fonll_info, damp):
"""Return the damping factors for each of the relevant masses."""
mc = theorycard_constituent_fks["mc"]
mb = theorycard_constituent_fks["mb"]
q2grid = fonll_info.Q2grid
step_function_charm = mc**2 < q2grid
step_function_bottom = mb**2 < q2grid
damping_factor_charm = (1 - mc / q2grid) ** damp[1]
damping_factor_bottom = (1 - mb / q2grid) ** damp[1]
damping_factor_charm *= step_function_charm
damping_factor_bottom *= step_function_bottom
return {"mc": damping_factor_charm, "mb": damping_factor_bottom}


def produce_combined_fk(
ffns3,
ffn03,
Expand Down Expand Up @@ -132,16 +146,7 @@ def produce_combined_fk(
fk_dict[fk].write_lz4(tmpfile_path)
combined_fk.merge_from_file(tmpfile_path)
else:
mc = theorycard_constituent_fks["mc"]
mb = theorycard_constituent_fks["mb"]
q2grid = fonll_info.Q2grid
step_function_charm = mc**2 < q2grid
step_function_bottom = mb**2 < q2grid
damping_factor_charm = (1 - mc / q2grid) ** damp[1]
damping_factor_bottom = (1 - mb / q2grid) ** damp[1]
damping_factor_charm *= step_function_charm
damping_factor_bottom *= step_function_bottom
dampings = {"mc": damping_factor_charm, "mb": damping_factor_bottom}
dampings = produce_dampings(theorycard_constituent_fks, fonll_info, damp)
with tempfile.TemporaryDirectory() as tmpdirname:
combined_fk = fk_dict[list(fk_dict)[0]]
for fk in list(fk_dict)[1:]:
Expand Down

0 comments on commit ece695b

Please sign in to comment.