diff --git a/src/legendoptics/nylon.py b/src/legendoptics/nylon.py index 0cc160f..cccf89e 100644 --- a/src/legendoptics/nylon.py +++ b/src/legendoptics/nylon.py @@ -5,7 +5,7 @@ In: Astroparticle Physics 97 (2018). https://doi.org/10.1016/j.astropartphys.2017.10.003 .. [Benziger2007] J. Benziger et al. “The Nylon Scintillator Containment Vessels for the - Borexino Solar Neutrino Experiment” In: nternational Journal of Modern Physics A, 29(16) + Borexino Solar Neutrino Experiment” In: International Journal of Modern Physics A, 29(16) (2014). https://doi.org/10.1016/j.nima.2007.08.176 """ diff --git a/src/legendoptics/pyg4utils.py b/src/legendoptics/pyg4utils.py index 0f746db..68375e0 100644 --- a/src/legendoptics/pyg4utils.py +++ b/src/legendoptics/pyg4utils.py @@ -106,6 +106,8 @@ def _val_pint_to_gdml(v): def addVecPropertyPint(self, name, e, v): # noqa: N802 vunit, v = _val_pint_to_gdml(v) eunit, e = _val_pint_to_gdml(e) + v = np.array(v) + e = np.array(e) if name in length_props and vunit not in length_u: log.warning("Wrong unit %s for property %s", vunit, name) @@ -114,7 +116,10 @@ def addVecPropertyPint(self, name, e, v): # noqa: N802 if eunit not in ["", "eV", "keV", "MeV", "GeV", "TeV", "PeV"]: log.warning("Wrong energy unit %s", eunit) - # TODO: necessary to reorder values + # reorder the values to be in ascending energy order. + sort = np.argsort(e) + e = e[sort] + v = v[sort] return g4.Material.addVecProperty(self, name, e, v, eunit, vunit)