@@ -69,7 +69,8 @@ def __init__(
6969 self .save_to_disk = save_to_disk
7070 self .q_in = q_in
7171 self .luxpdfset = lux_params ["luxset" ].load ()
72- self .luxpdfset_members = self .luxpdfset .n_members - 1 #
72+ self .luxpdfset_members = self .luxpdfset .n_members - 1
73+ self .path_to_eko_photon = self .theoryid .path / "eko_photon.tar"
7374
7475 # Compute or load photon_qin
7576 if force_computation :
@@ -88,15 +89,14 @@ def _load_photon(self):
8889 log .info (f"Loading photon QED set from { path_to_photon } " )
8990
9091 # Load the needed replicas
91- photon_qin_array = []
92+ photon_qin_array = {}
9293 for replica in self .replicas :
9394 # As input replica for the photon computation we take the MOD of the luxset_members to
9495 # avoid failing due to limited number of replicas in the luxset
9596 photonreplica = (replica % self .luxpdfset_members ) or self .luxpdfset_members
9697 photon_qin = np .load (path_to_photon / f"replica_{ photonreplica } .npz" )["photon_qin" ]
97- photon_qin_array . append ( photon_qin )
98+ photon_qin_array [ replica ] = photon_qin
9899
99- photon_qin_array = np .stack (photon_qin_array , axis = 0 )
100100 return photon_qin_array
101101
102102 def _compute_photon_set (self ):
@@ -149,7 +149,7 @@ def _compute_photon_set(self):
149149 )
150150 path_to_photon .mkdir (parents = True , exist_ok = True )
151151
152- photon_qin_array = []
152+ photon_qin_array = {}
153153 for replica in replicas :
154154 # Avoid failing due to limited number of replicas in the luxset
155155 photonreplica = (replica % self .luxpdfset_members ) or self .luxpdfset_members
@@ -180,9 +180,8 @@ def _compute_photon_set(self):
180180 )
181181 log .info (f"Saved photon replica { photonreplica } to { path_to_photon } " )
182182
183- photon_qin_array . append ( photon_qin )
183+ photon_qin_array [ replica ] = photon_qin
184184
185- photon_qin_array = np .stack (photon_qin_array , axis = 0 )
186185 return photon_qin_array
187186
188187 def _setup_fiatlux_runcard (self ):
@@ -206,7 +205,7 @@ def _setup_fiatlux_runcard(self):
206205 @property
207206 def error_matrix (self ):
208207 """Generate error matrix to be used in generate_errors."""
209- if "additional_errors" not in self .lux_params :
208+ if not self .lux_params [ "additional_errors" ] :
210209 return None
211210 extra_set = self .lux_params ["additional_errors" ].load ()
212211 qs = [self .q_in ] * len (XGRID )
@@ -241,8 +240,7 @@ def _evolve(self):
241240 interpolator = []
242241 integral = []
243242
244- path_to_eko_photon = self .theoryid .path / "eko_photon.tar"
245- with EKO .read (path_to_eko_photon ) as eko_photon :
243+ with EKO .read (self .path_to_eko_photon ) as eko_photon :
246244 # Check that qin mathces with the one in the EKO
247245 if not np .isclose (self .q_in , np .sqrt (eko_photon .mu20 )):
248246 log .error (
@@ -262,7 +260,7 @@ def _evolve(self):
262260 pdfs_init = np .zeros_like (eko_op [0 , 0 ])
263261 for j , pid in enumerate (basis_rotation .flavor_basis_pids ):
264262 if pid == 22 :
265- pdfs_init [j ] = photon_qin_array [replica - 1 ]
263+ pdfs_init [j ] = photon_qin_array [replica ]
266264 ph_id = j
267265 elif pid not in self .luxpdfset .flavors :
268266 continue
0 commit comments