in my application I simulate primary neutrons using GPS with a point-wise energy spectrum. I use
and then define many energy histogram points via /gps/hist/point.
In between the given points, the spectrum is interpolated.
Now, I see a strange behavior when choosing Spline interpolation (via /gps/hist/inter Spline). When creating a histogram of the primary particles’ energy, it seems like some energies are simulated too often, leading to small spikes in the spectrum. This problem doesn’t seem to occur when choosing Linear interpolation (/gps/hist/inter Lin). I attached the spectra to demonstrate the effect. On the left side of the image, one can see the results for Spline interpolation, on the right side for Linear interpolation.
When doing a cubic spline interpolation of the spectrum outside Geant4 (with scipy.interpolate), this effect does not occur.
I use Geant4 version 10.7.0.
Did anyone notice similar issues with the Spline interpolation? Thanks in advance!