Message: Re: distribution uniform Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: distribution uniform 

Forum: Event and Track Management
Re: None distribution uniform (Chaw)
Date: 11 Jul, 2011
From: Zach Hartwig <Zach Hartwig>

Hi Chaw,

To ensure a correct 4pi uniform distribution, your best bet is to use the G4GeneralParticleSource (G4GPS) class instead of the G4ParticleGun class. The G4GPS class can produce a wide variety of particle source distributions in energy and angle from a diversity of shapes, surfaces, etc. There are also options to restrict the solid angle of the source (in theta and phi) to produce a 2pi source, for example. It is primarily controlled by runtime macro commands. To produce a 4pi uniform source of 1 MeV gamma at the origin (for example), you can run the following commands:

 /gps/particle gamma
 /gps/pos/type Point
 /gps/pos/centre 0. 0. 0. cm
 /gps/ang/type iso
 /gps/ene/mono 1 MeV

The G4GPS manual can be found here: http://reat.space.qinetiq.com/gps/new_gps_sum_files/gps_sum.htm

If you need to produce a 4pi uniform distribution using the G4ParticleGun, you can simply copy (and modify to suit your needs) code from the G4SPSAngDistribution class and place in your user primary generator action class to calculate an isotropic flux: http://www-geant4.kek.jp/lxr/source/event/src/G4SPSAngDistribution.cc#L256

 Add Message Add Message
to: "Re: distribution uniform"

 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 ]