Can You Get An Isotropic Source with G4ParticleGun?

Hi there,

I am following the fanoCavity2 example and I would like to change the source to be isotropic. I have tried to implement a GPS, however it does not seem to be working with the source position, which generates a uniform number of source points along the z axis with respect to the density of the region. When implementing the GPS and random source point allocation, the code simply generates a single source at the centre of the geometry.

Is there a way to get the G4ParticleSource definition to be isotropic?

Thanks!

the default for:
/gps/ang/type

is iso distribution.

General Particle Source handles all this stuff for you.

I understand that you wish to have an isotropic angular distribution in addition to the existing z-position distribution.
This is very simple to do with ParticleGun. See examples TestEm4 or Hadr06

Ah great! Thanks a lot, this is exactly what I was trying to implement but couldn’t figure it out.