e15190.hira.spectra¶
Functions
|
Convert particle notation into Rensheng's convention. |
Classes
|
|
|
Dictionary of particle in the convention of Hira's file. |
|
|
|
|
|
|
|
A class to create pseudo-neutron spectrum from light charged particles. |
|
- e15190.hira.spectra.convert_particle(notation: str) str¶
Convert particle notation into Rensheng’s convention.
The ROOT file contains spectra for multiple particles. This function converts user’s particle notation into the one that is used to named to spectra in the ROOT file.
- Parameters
notation (str) – Particle notation, e.g. “H1”, “He4”.
- Returns
converted – Converted particle notation.
- Return type
str
:raises KeyError : If the particle is not found in the file.:
Example
>>> file = HiraFile('ca48ni64e140') >>> file.convert_particle('H1') 'p'
- class e15190.hira.spectra.HiraDict(arg=None)¶
Dictionary of particle in the convention of Hira’s file.
- class e15190.hira.spectra.PseudoNeutron(spectra: dict[str, pandas.core.frame.DataFrame])¶
A class to create pseudo-neutron spectrum from light charged particles.
Examples
>>> from e15190.hira.spectra import LabPtransverseRapidity, PseudoNeutron >>> pt_spec = LabPtransverseRapidity('ca40ni58e140', 'p') >>> spectra = { ... particle: pt_spec.get_ptA_spectrum( ... rapidity_range=(0.4, 0.6), ... correct_coverage=True, ... range=(200, 400), ... bins=10, ... drop_outliers=10.0, ... ) ... for particle in ['p', 'd', 't', 'He3'] ... } >>> print(PseudoNeutron(spectra).get_spectrum( ... fit_range=(200, 350), ... switch_point=350, ... )) x y yerr yferr 0 210.0 0.031069 0.000265 0.008542 1 230.0 0.027968 0.000289 0.010341 2 250.0 0.025876 0.000311 0.012022 3 270.0 0.021639 0.000297 0.013733 4 290.0 0.018715 0.000295 0.015768 5 310.0 0.015789 0.000286 0.018140 6 330.0 0.013411 0.000283 0.021093 7 350.0 0.010500 0.000311 0.029595 8 370.0 0.007961 0.000063 0.007875 9 390.0 0.005974 0.000062 0.010353
- get_spectrum(fit_range: tuple[float, float], switch_point: float) pandas.core.frame.DataFrame¶
Get the pseudo-neutron spectrum.
This method “stitiches” the deuteron-proton spectrum to the triton-helium3 spectrum by a scaling factor. The scaling factor is determined by a simple scaling fit.
- Parameters
fit_range (tuple[float, float]) – The range to fit the deuteron-proton spectrum to the triton-helium3 spectrum. The limits are inclusive.
switch_point (float) – The point where the two spectra are combined. If both triton-helium3 and deuteron-proton spectra contain this point, the point from the in the triton-helium3 is used.