From 840eb9e209d518b58b95726d080e2ccfc54bd089 Mon Sep 17 00:00:00 2001 From: Giacomo Magni Date: Thu, 6 Jun 2024 08:53:01 +0200 Subject: [PATCH] restore DIS polarized compatibility --- src/pineko/evolve.py | 15 +++++++++++++-- src/pineko/theory.py | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pineko/evolve.py b/src/pineko/evolve.py index b1250133..f5e96ac1 100644 --- a/src/pineko/evolve.py +++ b/src/pineko/evolve.py @@ -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 @@ -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 diff --git a/src/pineko/theory.py b/src/pineko/theory.py index 3a794476..2b049199 100644 --- a/src/pineko/theory.py +++ b/src/pineko/theory.py @@ -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 = [ @@ -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 = [