Spectrum plot issue for 3-4 GeV electrons

Hi!

I have an electron spectrum ranging from 0.6 GeV to 8+ GeV, as it is plotted in the Initial spectrum file. In the output, it confirms that the spectrum from the user routine has been correctly taken into account, as in the .txt file. Runs with even 10E7 primaries don’t show the same peaks for the 3-4 GeV region through the USRTRACK card. How can I solve this issue?

Thank you in advance!

Dear Mara,

Could you please upload the files of your simulation, so we can take a look at the issue?

Cheers,
David

Dear David,

I attach here the spectrum, source routine and the input of the simulations that me and my colleagues we work on, dealing with that issue. Mention - there are many disabled cards since I tried to plot only the spectrum and focus only a part of the geometry.

Cheers,
Mara

electronsE6.flair (33.6 KB)
electronsE6.inp (47.7 KB)
source_newgen.f (20.8 KB)
spectrum.txt (48.4 KB)

Dear Mara,

it seems the issue is that you use the sample_discrete_momentum_energy() in the source routine which is for discrete energy lines. For a contious spectrum you need to use the sample_spectrum_momentum_energy() function.

Cheers,
David