Problem 2508

Summary: G4GeneralParticleSource::GetParticleEnergy() only return 1 on windows
Product: Geant4 Reporter: Cheng Yz <chyzh>
Component: eventAssignee: Makoto.Asai
Status: ASSIGNED ---    
Severity: normal CC: Alberto.Ribon, asai
Priority: P4    
Version: 11.0   
Hardware: PC   
OS: Windows   

Description Cheng Yz 2022-09-12 10:39:14 CEST
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.
Comment 1 asai 2022-12-15 21:12:28 CET
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