Skip to content

Commit d2b2541

Browse files
committed
switch on polarization in opcards
1 parent 0b4631f commit d2b2541

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pineko/evolve.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tools related to evolution/eko."""
22
import copy
3+
import json
34
import logging
45
import os
56
import pathlib
@@ -95,6 +96,8 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
9596
tcard: dict
9697
theory card for the run, since some information in EKO is now required
9798
in operator card, but before was in the theory card
99+
is_polarized: bool
100+
if True compute th
98101
99102
Returns
100103
-------
@@ -142,6 +145,13 @@ def write_operator_card(pineappl_grid, default_card, card_path, tcard):
142145
operators_card["eko_version"] = metadata.version("eko")
143146
pineko_version = metadata.version("pineko")
144147

148+
# switch on polarization, only in DIS
149+
if "runcard" in pineappl_grid.key_values():
150+
grid_runcard = pineappl_grid.key_values()["runcard"]
151+
# here a grid contains a single obrevable
152+
observable = list(json.loads(grid_runcard)["observables"])[0]
153+
operators_card["configs"]["polarized"] = "g" in observable.split("_")[0]
154+
145155
# Some safety checks
146156
if (
147157
operators_card["configs"]["evolution_method"] == "truncated"

0 commit comments

Comments
 (0)