Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Jun 26, 2023
1 parent 91c52a6 commit 1ecaf71
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions validphys2/src/validphys/photon/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, theoryid, lux_params, replicas):
self.additional_errors = lux_params["additional_errors"]
self.luxseed = lux_params["luxseed"]

if not lux_params["component"]:
if "component" not in lux_params:
self.component = "total"
else:
self.component = lux_params["component"]
Expand Down Expand Up @@ -160,7 +160,6 @@ def compute_photon_array(self, replica):
photon_qin["inelastic"][i] = pht.inelastic_pf
photon_qin["msbar"][i] = pht.msbar_pf
# photon_qin += self.generate_errors(replica)
# fiatlux computes x * gamma(x)
# TODO : the different x points could be even computed in parallel

# Load eko and reshape it
Expand All @@ -175,6 +174,7 @@ def compute_photon_array(self, replica):
pdfs_init = np.zeros((len(eko.bases.inputpids), len(XGRID)))
for j, pid in enumerate(eko.bases.inputpids):
if pid == 22:
# fiatlux computes x * gamma(x)
pdfs_init[j] = value / XGRID
ph_id = j
else:
Expand All @@ -198,8 +198,10 @@ def __call__(self, xgrid, total):
Parameters
----------
xgrid : nd.array
xgrid: nd.array
array of x values with shape (1,xgrid,1)
total: bool
True for the total component, False for the others
Returns
-------
Expand Down

0 comments on commit 1ecaf71

Please sign in to comment.