Generation of two particles with event using nd280Geant4Sim_7.14

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: nd280Geant4Sim_7.14
Operating System: Almalinux
Compiler/Version: Linux-AlmaLinux_9.4-gcc_11-x86_64
CMake Version:


Hello,

I would need to generate e+ and mu+ simultaneously with nd280Geant4Sim_7.14. I have tried different approaches but I don’t manage. Could you provide me a simple skeleton I could follow?

Thanks a lot, M. Pilar Casado

Track to track interactions are not built in to Geant4. GPS can be used if you need one of angular, energy, or time correlations between multiple “primaries” but not more than one of these at the same time. If you do need more than one of these than you will need to write your own primary generator class to do this.

Custom User Info (i.e. you write it) could be attached to the G4VUserTrackInformation or G4VUserPrimaryVertexInformation classes. Something like this i.e. set flags for the track based of if it is a “descendant” of the mu+ or e+ and then pass that to every subsequent secondary. That code block comes from the RE01 example.