Dear FLUKA experts.
I simulated a beam of protons hitting on the Pb target, and I wanted to collect all the neutrons information(mainly position and direction).I want to achieve this by writing a MGDRAW.F, and I learned that maybe using information from GENSTK.inc could do this.
At the moment, I want to get all the neutrons produced, but I don’t want to collect them twice, so I use LLOUSE. However, I can’t use the ‘ip’ in GENSTK.inc to get all the secondries.
In the following program, I have specified ‘ip’=1 without authorization, which I know is incorrect.
For the moment I would only like to count the neutrons produced directly by protons (i.e., produced by proton spallation reactions, excluding neutrons produced by (n, xn) reactions). For this purpose, I modified the program as shown in the figure below, will this cause repeated reading to generate neutron information?
The main reason for this doubt is that I am worried that the use of LLOUSE will cause protons that have undergone a spallation reaction to produce neutrons again, so the use of LLOUSE has been removed.
Your code seems reasonable. You should consider adding an additional check on the inelastic type of the reaction:
if (icode .eq.101 .and. jtrack.eq.1)
To ensure that you are not double counting, you could also write the coordinates of the primary particle interaction or cumulative track length Cmtrack.
As you mentioned, the same proton may produce neutrons in multiple reactions. You can distinguish these neutrons by a production vertex different from the first reaction.
Let me know if you will have additional questions,
Volodymyr