Problem 2508 - G4GeneralParticleSource::GetParticleEnergy() only return 1 on windows
Summary: G4GeneralParticleSource::GetParticleEnergy() only return 1 on windows
Status: ASSIGNED
Alias: None
Product: Geant4
Classification: Unclassified
Component: event (show other problems)
Version: 11.0
Hardware: PC Windows
: P4 normal
Assignee: Makoto.Asai
URL:
Depends on:
Blocks:
 
Reported: 2022-09-12 10:39 CEST by Cheng Yz
Modified: 2022-12-15 21:12 CET (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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