Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!
_Geant4 Version: 11.1
_Operating System: Windows 10
_Compiler/Version: Microsoft Visual Studio Community 2022 (64-bit) - Version 17.9.0
_CMake Version: 3.25.1
Hello everybody,
Could anyone help me identify the following error? (Please see the attached snapshots.)
I am attempting to simulate the mass attenuation coefficient for various materials, such as alloys, glass, etc. No compilation issues were raised (see attached photo 1) . However, a runtime exception occurred during execution, leading to a crash (see the attached photo 2).
Please note that I can run the B1 example without any issues.
The error message is telling you that a nullptr was passed to some call to G4ParticleGun::SetParticleDefinition(), so check for calls to this in your code and see how/why a nullptr is getting passed.
Thank you @bmorgan for your answer. I didn’t use G4ParticleGun::SetParticleDefinition() in my code. Maybe this is my mistake. I use the following function in my PrimaryGenerator.cc. Let me play with it and I will update you with my results.