When I use geant4.11.02 on windows (both Win10 and Win11), in function G4VUserPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent), when I use G4GeneralParticleSource::GetParticleEnergy(), it only can return 1. But the same codes can work well on Linux distros such as almalinux/rockylinux 8/9 and ubuntu 20.04/22.04. I use VS2022 to install msvc toolchains on both win10 21H2(19044) and win11 22H2(22621) to compile codes. At first, I guess problem maybe on character coding. Then I set the beta feature "Use Unicode UTF-8 for worldwide language support" and recompile codes, but it also has this problem.
Hi, Do you see actual generated primary tracks having incorrect primary kinetic energy? Or, do you get this wrong number from this GetParticleEnergy() method but actual generated primaries are OK? Thanks, Makoto