How to Make polygone volume like gamma source

I have a polygon with a deep hole in it .
How to make it like gamma source ???
I really can’t do it with GPS ! ( GSP didn’t provide polygon with compicated shape)
Please , how to make it by using ParticuleGun ? Is there any similar exemples provided by Geant4 ?

Thank you for helping me
Best regards


May I ask for further details of the experimental setup that has to be simulated?


Yes of course
Simple gamma detection induced from polygon

I only need to know How to introduce it the geometry in PrimaryGenarator action ?

Are you envisioning gammas from the surface of the structure, or from anywhere in the bulk (which means some attenuation or scattering on the way out to the surface)?

The simplest way to do this is to write your own PrimaryGeneratorAction. Instantiate a G4Navigator (do not use the one for tracking!) so you can retrieve a G4Touchable to the volume. That gets you both the PV itself (which gets you the LV and the G4VSolid), and the transform needed to get from local to global coordinates.

Once you’ve got the G4VSolid, you can generate random positions either in the bulk or on the surface (I leave the algorithm as an exercise to the reader, or a Google search). Those points will be in local coordinates, so you use the transform from the touchable to put them into global coordinates.

Now you can set the position of G4ParticleGun, along with the gamma energy, random direction, whatever you need.

1 Like