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.
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 plot.cc 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 plot.cc is run via root and you do not need the includes. I am still unsure how you are running without iostream…
Thank you for trying this! I am glad to see that you could come over the setup.
plot.cc 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 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.
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 sim.cc file that replaces the original one) a pattern is drawn (looks physical) , this is for 1M events
The sim.cc 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
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 sim.cc, only the QBBC model is initialized:
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 sim.cc 1e5 events and cannot see any pattern; it is compatible with horizontal line +/- ~10MeV.
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/G4HadronInelasticQBBC.cc 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?
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!