Message: G4GeneralParticleSource, uniform distribution throughout volume Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question G4GeneralParticleSource, uniform distribution throughout volume 

Keywords: G4GeneralParticleSource
Forum: Particles
Date: 05 Feb, 2004
From: John Roberts <jroberts@surf.sno.laurentian.ca>

Hi all,

I am interested in using the G4GeneralParticleSource to generate a
number of neutrons distributed uniformly throughout a volume.  I am
controlling the G4GeneralParticleSource object completely from within
my PrimaryGeneratorAction class, not via the /gps/ commands.

I have set the distribution type to Volume, set the shape to Para, and
configured HalfX, HalfY and HalfZ to completely enclose my world.
I then ConfineSourceToVolume to the particular volumes I want (the
volumes are G4PVParameterised, so I only need to confine the GPS to
the one volume name).

This appears to partially work.  For each event, the particles are
generated at a random point within the volumes I want, and the random
point is different every time, but all of the particles are generated
at the same point for each event.

How do I configure the GPS to actually distribute the particles
uniformly throughout my volume?  Do I need to set the GPS's number of
particles to 1, and then call GPS->GeneratePrimaryVertex as many times
as I want particles?

Thanks;

Cheers, John Roberts
Sudbury Neutrino Observatory

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: G4GeneralParticleSource, uniform distribution throughout volume   (Fan Lei - 12 Feb, 2004)
 Add Message Add Message
to: "G4GeneralParticleSource, uniform distribution throughout volume"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]