Can I emit two particles （electron and gamma） at the same time? How do I set it？
G4ParticleGun. You could write your own primary generator action to do it (using, e.g., two calls to
G4ParticleGun to create the two primaries). I’m not sure if GPS supports defining multiple sources that all act in every event.
See examples/extended/eventgenerator/particleGun : PrimaryGeneratorAction1
You can change the particle type for each primary