Difference in ion simulation between G4-11.1.2 and G4-11.2.0

Geant4 Version: 4.11.1.2 and 4.11.2.0
Operating System: linux/fedora39
Compiler/Version: gcc 13.2.1
CMake Version: 3.27.7


Hello,

I simulate the energy loss through a thin carbon foil (100nm) of alpa (5 MeV) and ion (Y-98, 90MeV, charge 21) with geant4 11.1.2 and 11.2.0 and I obtain big difference:

  • for alpha, the energy after the foil is 4.984 MeV for both G4 version
  • for Y-98, G4-11.1.2 gives 88.65 MeV whereas G4-11.2.0 give 81.13 MeV

Of course in both case, all the g4 files (DetectorConstruction, PhysicLists, …) are exactly the same.
I saw that the GEMLOW has been upgraded but I am really very surprise for such a change in energy loss (for ions).
Thanks for your help/comments
Cheers
Olivier

olivier.mac.txt (390 Bytes)
olivier1.out.txt (571 Bytes)
olivier2.out.txt (580 Bytes)

Thank you for your answer ; I can reproduced your results. But there is something that I don’t understand in my compiled version : I use for my PhysicsList a copy of the TestEm7 one. In the constructor, I have

 fEmName = G4String("emstandard_opt4");  
 fEmPhysicsList = new G4EmStandardPhysics_option4();
 AddPhysicsList(fEmName)

The problem is if I do that, my ions slow down even in the vacuum whereas if in the constructor I initialize fEmPhysicsList with G4EmStandardPhysics_option2 everything works as it should.
The energy of ions decreases in the vacuum (before the foil) with G4EmStandardPhysics_option4 and I don’t understand why. It is constant with opt2.
Thanks for your help.

And to add an probably linked problem due to my misunderstanding of PhysicsList, definining the carbon as

 Gr = manager -> FindOrBuildMaterial("G4_C");

or

 fGr = new G4Material ("graphite", 2.0 * g / cm3, 1);
 fGr -> AddElement (elC, 1);

change significantly the results while the printed material seems to be the same with G4-11.2 while the impact is negligible with G4-11.1.2 (with G4EmStandardPhysics_option2)

Here, a copy of TestEm7/src/PhysicsList.cc as it is in G4 11.2 distribution.
I do not understand why emstandard_opt4 would have different
behavior than in G4 11.1
PhysicsList.cc.txt (9.2 KB)

Try to reproduce the effect in one of the G4 examples

Since your macro file is working, I start to slightly modify TestEm5 to reproduce the result directly from a compiled version. The modification are

  • defined the wanted geom parameters in DetectorConstruction
  • remove messengers (not useful here) and not use material from DetectorConstruction::DefineMaterials
  • comment some output stuff
  • and modify TestEm5.cc to directly run my case

Then I declare fAbsorberMaterial and fWorldMaterial (graphite and vacuum) in DetectorConstruction::Construct() using new Material().
And now the strange results (for me):

  1. Calling DefinesMaterials in the constructor and redefining these materials in the Construct() method gives :

Total energy deposit in absorber per event = 1.148 MeV ± 286.1 eV
Leakage : primary = 88.85 MeV ± 286.1 eV secondaries = 0 eV ± 0 eV

  1. Calling DefinesMaterials where graphite definition has been comment and defining these materials in the Construct() method gives :

Total energy deposit in absorber per event = 1.033 MeV ± 286.1 eV
Leakage : primary = 88.97 MeV ± 286.1 eV secondaries = 0 eV ± 0 eV

  1. Don’t call DefinesMaterials and defining the materials in the Construct() method gives :

Total energy deposit in absorber per event = 1.029 MeV ± 278.6 eV
Leakage : primary = 73.82 MeV ± 262.4 eV secondaries = 0 eV ± 0 eV

I am completely lost with these results…I probably do something wrong but I don"t undertand why the simple definition of materials (which are not use any where) in the DetectorConstruction constructor has an impact on the result. You will find my code in the joint document (as a tar gz archive)
myTestEm5.tar.gz.txt (53.4 KB).
Again, thank you for your help,
Cheers
Olivier