Neutron distance dose dependency

Dear community,

I ran a simulation measuring the deposited energy by protons and neutrons in a ball of water (r=15cm).
The ball is placed at the center (0,0,0) of an empty (G4_Galactic) mother volume.

The beam is pointlike and monoenergetic (Ebeam = 1 GeV) along the z-axis with a random initial position z between 16cm (just before the surface) to 1 meter from the center. I look at the deposited energy Edep as a function of the distance from the center of the ball.

Of course, I expect no dependency on Edep with z. Protons and neutrons are stable enough to reach the target without decaying and this is what I observe with protons, however with neutrons, I obtain a strong unexpected dependency.

(y-axis is Edep im MeV, x-axis z in mm)

Here is all the code where the result should be easy to reproduce:
[GitHub - sylvathle/NeutronChangingDose: Test of energy deposition in a ball of water by neutrons, varying distance of beam](https://Code source on Github)

What am I doing wrong?

So I am downloaded your source code and am looking at your issue, because I am curious. But you are missing includes in your files (your has no .hh and no includes). You also never include iostream. So I have to go through and add some of these before I can compile and run.

So my question is: is there a way you are compiling this without these preprocessor directives? Or are there files missing in your source code

Edit: I am not familiar with ROOT, but have since installed it and see now that is run via root and you do not need the includes. I am still unsure how you are running without iostream…

Looking at your issue now

I have run your code with 1M events. Here are protons and neutrons (assuming all I have to do is to change this line)

TTree* tree = (TTree*)f->Get("neutron");

proton.pdf (13.9 KB)

neutrons.pdf (13.8 KB)

I do not see the strong dependance that you have shown, from my simulation it looks like noise. I will run again overnight with 10M events

Hi loydms,

Thank you for trying this! I am glad to see that you could come over the setup. is indeed not part of the simulation itself, just a root code that does not require any include.

Really interesting and unexpected that you don’t get the same result with the same code. The deposited energy you get is around 132 MeV, consistent with the last point on my graph.

I ran this with Geant4 11.1.1, which version are you using?

This also gave me the idea to try on an old pc that has version 11.0.1 installed and this dependency disappeared, this is really odd.


I ran the code again with 10M events, and once again do not see the distance dependance

proton 10M.pdf (13.9 KB)
neutron 10M.pdf (13.7 KB)

I am using 11.0.0. I wonder what 11.1.1 would have introduced that would cause this discrepancy? It is also interesting that you have the correct energy value (~130MeV) at your closest distance, and you have higher energy depositions at further away? The only thing I could think of, is if G4Galactic is treated differently and your neutron is somehow being moderated and then depositing more energy in your sphere

So the only idea that came to my mind is to compile an older version of geant4 to keep going.
I suppose cannot trust any result of energy deposition if this effect remains.

Versions I have tried taken here, inform if the dependency is observed (Yes) or not (No)
v11.2.0.beta: Yes
v11.1.2: Yes
v11.1.1: Yes
v11.1.0: Yes
v11.1.0.beta: No
v11.0.4: No
v11.0.0: No

Something might have happened between versions 11.0.4 and 11.1.0.
And yes, I have installed a lot of G4 version.

This is the release notes for 11.1. I don’t see anything jumping out that might cause this.

Have you tried a different physics list? It would be interesting to see if this dependance is showing in all or only 1 physics list


First of all, thank you for posting a complete example. It is much easier to test.

I tried with geant4-11-01-patch-02 [MT] (15-June-2023), and I can see the original behavior with the code as it is.

However, if the builtin physics list FTFP_BERT [1] is used (see changes in file that replaces the original one) a pattern is drawn (looks physical) , this is for 1M events (2.4 KB)

I would bet the problem is in, particularly when registering two lists that cover the same things:

        RegisterPhysics(new G4HadronPhysicsFTFP_BERT());
        RegisterPhysics(new G4HadronPhysicsQGSP_BIC_HP());

The was also modified with modern way of calling the run manager in MT mode. The files are not merged automatically, but it can be done with hadd tool provided by ROOT.

Result with QGSP_BIC_HP [2] show some similar to builtin FTFp Bertini physics lists, but nothing like the OP

[1] FTFP_BERT — PhysicsListGuide 11.1 documentation
[2] QGSP_BIC — PhysicsListGuide 11.1 documentation

Thank you both for your constructive replies.
The original code does not even call the MyPhysicsList class, the corresponding line is commented in the main file, only the QBBC model is initialized:

//runManager->SetUserInitialization(new MyPhysicsList());
runManager->SetUserInitialization(new QBBC());

therefore the other models are not loaded. I tried inverting the commented lines (only MyPhysicsList) and the neutron distance disappeared, leaving both lines (MyPhysicsList+QBBC) the distance-dependency remains. So the problem looks inherent to QBBC.

In the release notes of the version 11.1.0 shared by @loydms, it is said that the QBBC physics list has been updated: “New G4NeutronGeneralProcess combined process”.

@atolosad The pattern shouldn’t just be a horizontal line + statistical fluctuation? I expect no dependence of deposited energy with the initial position. However the graphs you show look consistent with this. I tried with your 1e5 events and cannot see any pattern; it is compatible with horizontal line +/- ~10MeV.

Hello @sylvathle,

I’d like to suggest testing by switching the parameter param->SetEnableNeutronGeneralProcess(true); to false in the file: source/physics_lists/constructors/hadron_inelastic/src/ on line #L88.

Upon reviewing the Geant4 logs, I noticed this change was introduced in the following Merge Request:

The MR description states: “G4HadronInelasticQBBC - added option for neutron general process; utilized G4HadProcesses utility to construct neutron elastic, thereby enabling the option for the neutron general process.”

@civanch, would you be able to review this potential bug highlighted by Sylvain?

hey @sylvathle, I noticed the condition seems flipped in your code here: Not directly related to this current issue, though.

Hello @dkonst
I tried your suggestion, recompiled and rerun the simulation. The dependency of deposited energy with distance of neutrons indeed disappeared and found a value around 130MeV.
I ran this with version 11.1.0.

Your previous comment proves quite useful, I hadn’t realized that I wasn’t making use of the available computing power. Thanks for that!

Hello @sylvathle ,

I have created Geant4 Bugzilla ticket based on this thread:

Thanks @dkonst! I will follow this :slight_smile: