Hello Fluka experts,
I’ve written a muon source file that samples angles and energies from two spectra. This works fine. What I’d like to do is target a particular region of interest (ROI) in order to increase statistical yield. I treat the muons as straight trajectories and check a few parametric equations to determine if the muon will in fact intersect the ROI. The function I’ve written works if called in a standalone f90 file, but not in the simulation. The only error I get is:
executable returned RC=136. I’ll attach the source file, the input file, and the spectra for sampling. I’d appreciate anyone explaining why this doesn’t work.
- Running the latest FLUKA on MacOS with gcc version 10.4.0
mu_e_hist.txt (3.1 KB)
mu_zen_hist.txt (350 Bytes)
muon_source.f (26.9 KB)
NEWINPUT.inp (5.1 KB)
there are a couple issues:
You are using the
sample_spectrum function (which is now available as the built in function
sample_spectrum_momentum_energy), where you only ony one energy value, but your files has a minimum and maximum energy value, thus the appropriate sampling function is
These sampling function can handle only one file at the moment, so you need to duplicate them with a different name, to be able to use for the energy and direction sampling separately.
For the direction sampling you need to use
GeV instead of
MeV to avoid the unit conversion
Finally, the line
azimuth = acos(cos_x/sin(zenith))
creates an arithmetic error, probably because the
cos_z values are independently sampled and are not normalized.
P.S.: You can find the traceback of the error in the