Skip to content

Commit

Permalink
restore DIS polarized compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Jun 6, 2024
1 parent b413bd6 commit 840eb9e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/pineko/evolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,18 @@ def get_ekos_convolution_type(kv):
conv_type_1 = "PolPDF"
else:
conv_type_1 = "UnpolPDF"
conv_type_2 = kv.get("convolution_type_2", "UnpolPDF")

# TODO: initial_state_2 is now deprecated, needed for comatibility
if "convolution_particle_2" in kv:
part_2 = kv["convolution_particle_2"]
else:
part_2 = kv["initial_state_2"]

# check for DIS
if check.islepton(float(part_2)):
conv_type_2 = None
else:
conv_type_2 = kv.get("convolution_type_2", "UnpolPDF")
return conv_type_1, conv_type_2


Expand Down Expand Up @@ -207,7 +218,7 @@ def dump_card(card_path, operators_card, conv_type, suffix=False):

# For hardonic obs we might need to dump 2 eko cards

if conv_type_a == conv_type_b:
if conv_type_b is None or conv_type_a == conv_type_b:
dump_card(card_path, operators_card, conv_type_a)
else:
# dump card_a
Expand Down
4 changes: 2 additions & 2 deletions src/pineko/theory.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def eko(self, name, grid, tcard):
# setup data
grid_kv = pineappl.grid.Grid.read(grid).key_values()
conv_type_a, conv_type_b = evolve.get_ekos_convolution_type(grid_kv)
if conv_type_a == conv_type_b:
if conv_type_b is None or conv_type_a == conv_type_b:
names = [name]
else:
names = [
Expand Down Expand Up @@ -411,7 +411,7 @@ def fk(self, name, grid_path, tcard, pdf):
conv_type_a, conv_type_b = evolve.get_ekos_convolution_type(kv)

# setup data
if conv_type_a == conv_type_b:
if conv_type_b is None or conv_type_a == conv_type_b:
eko_filename = [self.ekos_path() / f"{name}.tar"]
else:
eko_filename = [
Expand Down

0 comments on commit 840eb9e

Please sign in to comment.