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

Support Timelike with up to 2 ekos #192

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,21 @@ def get_grid_convolution_type(kv):
if check.islepton(int(part_2)):
conv_type_2 = None
else:
# new hadronic polarized and timelike grids contain convolution_type_2
# but old unpolarized do not
conv_type_2 = kv.get("convolution_type_2", "UnpolPDF")
return conv_type_1, conv_type_2


def check_convolution_types(grid, operators1, operators2):
"""Check that grid and eko convolution types are sorted correctly."""
grid_conv_1, grid_conv_2 = get_grid_convolution_type(grid.key_values())
conv_to_eko = {"UnpolPDF": (False, False), "PolPDF": (True, False)}
conv_to_eko = {
"UnpolPDF": (False, False),
"PolPDF": (True, False),
"UnpolFF": (False, True),
"PolFF": (True, True),
}

for op, pine_conv in [(operators1, grid_conv_1), (operators2, grid_conv_2)]:
is_pol, is_tl = conv_to_eko[pine_conv]
Expand Down Expand Up @@ -146,6 +153,7 @@ def dump_card(card_path, operators_card, conv_type, suffix=False):
"""
op_to_dump = copy.deepcopy(operators_card)
op_to_dump["configs"]["polarized"] = conv_type == "PolPDF"
op_to_dump["configs"]["time_like"] = "FF" in conv_type

if suffix:
card_path = card_path.parent / f"{card_path.stem}_{conv_type}.yaml"
Expand Down Expand Up @@ -237,10 +245,6 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
kv = pineappl_grid.key_values()
conv_type_1, conv_type_2 = get_grid_convolution_type(kv)

# fragmentation function grid?
if "timelike" in kv:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the previous implementation was not even working cause the "True" business

operators_card["configs"]["timelike"] = kv["timelike"] == "True"

# Choose the evolution method according to the theory if the key is included
if "ModEv" in tcard:
opconf = operators_card["configs"]
Expand Down
Loading