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.2.0
_Operating System: Almalinux 9.4
_Compiler/Version: g++ (GCC) 13.1.0
_CMake Version: cmake version 3.26.2
Dear experts I’m new in Geant4 world, and I’m developing a geometry with various crystals starting from exampleB4d.
I’m using gps for creating a beam source, and I’m interested to get particle position and energy when generated from the beam and at the beginning of each volume, but it’s not clear to me how and where retrieving this information and how storing in a TTree.
Just for completeness these are the classes I’m using (as already existing in the example)
ActionInitialization.hh
DetectorConstruction.hh
RunAction.hh
ConfigFile.hh
EventAction.hh
Materials.hh (I created this class to have materials properly ordered)
PrimaryGeneratorAction.hh
Thanks for the attention.
Best regards,
Francesco