Sources with random shapes

Hello,
Is there a good example of how I could create a source originating from an arbitrary surface and volume? I can start with uniform distribution…
Thank you,
Sveta

Arbitrary? Please consult what is possible with the General Particle Source (http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/ForApplicationDeveloper/html/GettingStarted/generalParticleSource.html). If what you want is not available there, then you must write your own PrimaryGeneratorAction.

Hi Allison,
Ideally created from a tessellated solid or a voxellated phantom. I am familiar with GPS.
Thanks,
Sveta

To have tessellated solids as a uniform volume source, I defined the GPS source as a parallelepiped volume that is just big enough to surround the solid, then use the gps confine command to confine the source to the tessellated solid. Another gps shape other than a parallelepiped might make more sense for you depending on the shape of your tessellated solids (ideally you want to have as little space as possible that is inside the GPS volume source but outside the tessellated solid), I went with the parallelepiped because it was easy to generalize making the bounding box for arbitrary tessellated shapes, but it gave a tighter fit than simply using, say, a sphere.

@dnevill: In continuation of this post, I am trying to define source of two subtracted volumes, wondering if you have any advice on that please? Here is my post