Skip to content
Snippets Groups Projects
Commit aa22adb5 authored by Johannes Schumann's avatar Johannes Schumann
Browse files

Add visible energy fraction to output data

parent a06a5eda
No related branches found
No related tags found
1 merge request!25Visible energy
......@@ -27,6 +27,7 @@ from scipy.optimize import curve_fit
import mendeleev
from datetime import datetime
from .physics import visible_energy_fraction
from .jobcard import Jobcard, read_jobcard, PDGID_LOOKUP
from .geometry import DetectorVolume, CanVolume
from .config import Config, read_default_media_compositions
......@@ -561,10 +562,14 @@ class GiBUUOutput:
zip(GIBUU_FIELDNAMES,
len(GIBUU_FIELDNAMES) * [float]))))
# Calculate additional information
counts = ak.num(retval.E)
retval["xsec"] = self._event_xsec(retval)
retval["Bx"] = GiBUUOutput.bjorken_x(retval)
retval["By"] = GiBUUOutput.bjorken_y(retval)
retval["Q2"] = GiBUUOutput.Qsquared(retval)
visEfrac = visible_energy_fraction(ak.flatten(retval.barcode),
ak.flatten(retval.E))
retval["visEfrac"] = ak.unflatten(visEfrac, counts)
return retval
@property
......
......@@ -98,7 +98,7 @@ HE_PARAMS = {
"Mkref": 2.698,
}
@np.vectorize
def visible_energy_fraction(pdgid, energy):
"""
Returns the visible energy fraction in the one particle approximation (OPA)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment