Professional Documents
Culture Documents
1/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Gean4 Geneal Paicle Soce Ue Manal
1. Inodcion
The G4GeneralParticleSource (GPS) is part of the Geant4 toolkit for Monte-Carlo, high-energy particle transport.
Specifically, it allows the specifications of the spectral, spatial and angular distribution of the primary source particles.
In section 2 of this manual an overview of the GPS class is presented. Section 3 covers the instanciation GPS in an
user application, and section 4 describes the commands of GPS. Section 5 gives a number of example input file to
guide the first time user and section 6 lists the limitations and known bugs.
2. Oeie
In all Monte Carlo simulations, it is necessary to have some simple way of specifying the properties of the incident
source. The GPS software allows the user to specify the energy spectrum, position distribution and direction of the
source particles. This can be done via command line, or macro based, input. The experienced user can of course
simply hard-code distributions using the methods and classes of the GPS that are described in more detail in the
technical note [1]. In class diagram of GPS is shown in Figure 1. The G4GeneralParticleSource class can have
multiple instanciations of the G4SingleParticlesource class, each with independent positional, angular and energy
distributions as well as incident particle types.
Figure 1. The class diagram of GPS.
24/03/2012 Geant4 GPS Users Manual
2/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
i. Position distribution
The position distribution can be defined by using several basic shapes to contain the starting positions of the
particles. The easiest source distribution to define is a point source. One could also define planar sources,
where the particles emanate from circles, annuli, ellipses, squares or rectangles. There are also methods for
defining 1D or 2D accelerator beam spots. More complicated still, one can define surface or volume sources
where the input particles can be confined to either the surface of a three dimensional shape or to within its
entire volume. The four 3D shapes used within G4GeneralParticleSource are sphere, ellipsoid, cylinder and
parallelepiped.
To allow easy definition of the sources, the planes and shapes are assumed to be orientated in a particular
direction to the axes (Fig 2). To allow the user more freedom he/she can supply two vectors (x and a vector
in the plane xy) to rotate the co-ordinate axes of the shape with respect to the overall co-ordinate system.
The rotation matrix is automatically calculated within G4GeneralParticleSource. The starting points of
particles are always distributed homogeneously over the 2D or 3D surfaces, although biasing can change
this.
Figure 2. An illustration of the use of rotation matrices. A cvlinder is defined with its axis parallel to
the :-axis (black lines), but the definition of 2 vectors can rotate it into the frame given bv x, v, :
(red lines).
As mentioned above there are five planes (circle, annulus, ellipse, square and rectangle) and four
shapes (sphere, ellipsoid, cylinder and parallelepiped) used to confine the starting positions of the input
particles.
The five planes are oriented in the x-y plane. To define a circle one gives the radius, for an annulus one gives
the inner and outer radii, and for an ellipse, a square or a rectangle one gives the half-lengths in x and y. To
rotate the plane the user can supply two rotation vectors, defining x and a vector in the x-y plane, from
which the axes (x, y, z) will be calculated.
A sphere can be defined simply by specifying the radius. Ellipsoids are defined by giving their half-lengths in
x, y and z. Cylinders are defined such that the axis is parallel to the z-axis, the user is therefore required to
give the radius and the z half-length. Parallelepipeds are defined by giving x, y and z half-lengths, plus the
24/03/2012 Geant4 GPS Users Manual
3/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
angles a, q, and f (Fig 3). Supplying two vectors, as with the planes, can rotate all of these shapes.
Figure 3. The angles used in the definition of a Parallelepiped.
2. Angular distribution
The angular distribution is used to control the directions in which the particles emanate from/incident upon the
source point. In general there are three main choices, isotropic, cosine-law or user-defined. In addition there
are options for specifying parallel beam as well as diversed accelerator beams. The isotropic distribution
represents what would be seen from a uniform 4p flux. The cosine-law represents the distribution seen at a
plane from a uniform 2p flux. The user defined distribution requires the user to enter a histogram in either q
or f or both. The user can also set lower and upper limits to q and f. The user has to be careful to rotate the
co-ordinate axes of the angular distribution if they have rotated the position distribution. The user can specify
user-defined distributions with respect to the surface normal of bodies instead of the co-ordinate axes. It is
also possible to bias both q and f distributions.
The direction cosines are calculated as
Px = - sin(q) cos(f)
Py = - sin(q) sin(f)
Pz = - cos(q)
So incident with zenith angle q=0 means the particle is travelling along the -z axis. It is important to
bearing this in mind when defining user-defined co-ordinates for angular distribution.
iii. Energ distribution
Using G4GeneralParticleSource the energy of the input particles can be set to follow several built in functions
or a user-defined one. The functions available are mono-energetic, linear, exponential, power-law, gaussian,
bremsstrahlung, black body and cosmic diffuse gamma ray. There is also the option for the user to define a
histogram (in energy or energy per nucleon) or to give an arbitrary point-wise spectrum that can be fit with
various simple functions. The user can bias the energy distribution in order to speedup the simulation.
24/03/2012 Geant4 GPS Users Manual
4/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
iv. Biasing
The user can bias distributions by entering a histogram. It is the random numbers from which the
quantities are picked that are biased and so one only needs a histogram from 0 to 1. Great care
must be taken when using this option, as the way a quantity is calculated will affect how the
biasing works. This will be explained further in sections 5,6. Bias histograms are entered in the
same way as other user-defined histograms.
v. User-defined histograms
The user can define histograms for several reasons: angular distributions in either q or f, energy
distributions, energy per nucleon distributions or biasing of x, y, z, q, f, or energy. Even though the
reasons may be different the approach is the same. To choose a histogram the command hist/tvpe is
used and this is explained in section 5. If one wanted to enter an angular distribution one would type
theta or phi as the argument. The histogram is loaded, one bin at a time, by using the hist/point
command, followed by its two arguments the upper boundary of the bin and the weight (or area) of
the bin. Histograms are therefore differential functions.
The user has to be aware of the limitations of histograms. For example, in general q is defined between
0 and p and f is defined between 0 and 2p, so histograms defined outside of these limits may not give
the user what they want (this idiosyncrasy of G4GeneralParticleSource is expanded on in section 6)
vi. G4ParticleGun replacement functions
Certain methods are present within G4GeneralParticleSource to allow it to act as a replacement for
G4ParticleGun.
Ho o e i
The GPS is distributed as part of the Geant4 kernel in the "event" catagory, along side the G4ParticleGun class.
G4GeneralParticleSource is used exactly the same way as G4ParticleGun in a Geant4 application. In existing application one
can simply change vourPrimarvGeneratorAction by globally replacing "G4ParticleGun" with "G4GeneralParticleSource".
The command
The G4GeneralParticleSource can be utilised by typing commands from the /gps command directory, or include the /gps
commands in a g4macro file.
i. Top command director /gps
Function: Contains all the replicae G4ParticleGun commands.
/gps/particle
Format: /gps/particle <aiceNae>
Arguments: G4String particleName.
Function: Defines the particle type.
Default: geantino
24/03/2012 Geant4 GPS Users Manual
5/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
/gps/ion
Format: /gps/ion <Z A Q E>
Arguments: Integers Z (the Atomic number), A (the Atomic mass) and Q (ionic charge
in units of e). Double E the excitation energy of the ion in keV.
Function: Sets the properties of the ion. Should be used after /gps/particle ion.
/gps/List
Format: /gps/List
Arguments: None
Function: List available incident particles
Default: N/A
/gps/energv
Format: /gps/energy <energy i>
Arguments: Double energv and a G4String unit.
Function: Sets the energy for mono-energetic sources.
Default: The default source is mono-energetic and so by default monoenergy
is set to 1 MeV.
/gps/position
Format: /gps/position <X Y Z i>
Arguments: Three doubles x, v and : plus a string giving the unit.
Function: Sets the centre co-ordinates of the source.
Default: The origin (0., 0., 0.) and the default unit is cm.
Errors: An error is flagged if the units do not belong to cm, mm, micron, etc.
/gps/direction
Format: /gps/direction <d d d>
Arguments: dx, dy, dz are direction cosines
Function: set the momentum direction.
Default: The unit vector x (1., 0., 0.).
/gps/time
Format: /gps/time <0 i>
24/03/2012 Geant4 GPS Users Manual
6/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Arguments: Double t0 and a G4String for the unit.
Function: Sets the particle time.
Default: 0 ns.
Errors: An error is flagged if the units are not ns.
/gps/polari:ation
Format: /gps/polarization <P
>
Arguments: Three doubles P
x
, P
v
, P
:
.
Function: Sets the polarization of the source.
/gps/number
Format: /gps/number <N>
Arguments: Integer N.
Function: Sets the number of particles to simulate.
Default: 1
/gps/verbose
Format: /gps/verbose <ebiLee>
Arguments: An integer verbositvLevel.
Function: This allows the user to control the amount of information printed out
by the GPS code. The possible values are 0, 1 and 2. 0 is for silent running and very
little information will be printed from the GPS. 1 is a medium level where some
limited information is printed, and 2 is the most verbose with a lot of information
printed out including the debug arrrays.
ii. Sub command director /gps/source
Function: Contains all the commands for specification of multiple particle sources.
/gps/source/list
Format: /gps/source/list
Arguments: none
Function: list the particle sources defined.
Default: N/A
Errors: none
/gps/source/add
24/03/2012 Geant4 GPS Users Manual
7/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Format: /gps/source/add <iei>
Arguments: G4double intensitv
Function: add a new particle source with the specified intensity
Default: none
Errors: An error is flagged if intensitv is ommited or negative.
/gps/source/delete
Format: /gps/source/delete <ce_ide>
Arguments: G4int index
Function: remove the specified particle source.
Default: none
Errors: An error is flagged if index is out of range.
/gps/source/clear
Format: /gps/source/clear
Arguments: none
Function: remove all defined particle sources.
Default: none
Errors: none.
/gps/source/show
Format: /gps/source/show
Arguments: none
Function: display the current particle source
Default: none
Errors: none
/gps/source/set
Format: /gps/source/set <ce_ide>
Arguments: G4int index
Function: set the specified particle source as the current one.
Default: none
24/03/2012 Geant4 GPS Users Manual
8/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Errors: An error is flagged if index is out of range.
/gps/source/intensitv
Format: /gps/source/intensity iei
Arguments: G4double intensitv
Function:set the inetnsity of the current particle source.
Default: none
Errors: An error is flagged if intensitv is omitted or negative.
/gps/source/multiplevertex
Format: /gps/source/multiplevertex <B>
Arguments: G4bool Bool
Function: If true, a vertex is generated for each of the source defined. Default: false,
i.e. only one vertex is generated choosing from the sources defined.
Default: false
Errors: none.
iii. Sub command director /gps/pos
Function: Contains all the commands for specification of position
/gps/pos/tvpe
Format: /gps/pos/type <DiTe>
Arguments: G4String DisTvpe
Function: Sets the source distribution type to Point, Beam, Plane, Surface or Volume. At the
moment the capitalisation is very important, only an exact match will be recognised.
Default: Point.
Errors: An error is flagged if DisType is anything other than Point, Beam, Plane, Surface or
Jolume.
/gps/pos/shape
Format: /gps/pos/shape <Shae>
Arguments: G4String Shape
Function: Sets the source shape type. For a Plane source this can be Circle, Annulus,
Ellipsoid, Square or Rectangle. For both Surface and Volume sources this can be Sphere,
24/03/2012 Geant4 GPS Users Manual
9/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Ellipsoid, Cylinder or Para (parallelepiped). Again, capitalisation is very important, only an exact
match will be recognised.
Default: NULL. The default source is a Point source and so Shape is not set to any of the
above types.
Errors: The entered string must be Circle, Annulus, Ellipse, Square, Rectangle, Sphere,
Ellipsoid, Cvlinder or Para. The G4GeneralParticleSource also checks that the choice is
appropriate for the distribution type i.e. a cylinder will give an error is the distribution type is
Plane.
/gps/pos/centre
Format: /gps/pos/centre <X Y Z i>
Arguments: Three doubles x, v and : plus a string giving the unit.
Function: Sets the centre co-ordinates of the source.
Default: The origin (0., 0., 0.) and the default unit is cm.
Errors: An error is flagged if the units do not belong to cm, mm, micron, etc.
/gps/pos/rot1
Format: /gps/pos/rot1 <R1
, R1
, R1
>
Arguments: Three doubles R1
x
, R1
v
, R1
:
.
Function: Defines the vector x, which does not need to be a unit vector, and is used to
create the rotation matrix of the shape defined with /gps/shape. (See Fig 1 for a summary of
rotation.)
Default: The unit vector in x (1., 0., 0.).
/gps/pos/rot2
Format: /gps/pos/rot2 <R2
, R2
, R2
>
Arguments: Three doubles R2
x
, R2
v
, R2
:
.
Function: Defines a vector in the plane x-y, which does not need to be a unit vector, and is
used to create the rotation matrix of the shape defined with /gps/shape. (See Fig 1 for a summary
of rotation.)
Default: The unit vector in y (0., 1., 0.).
/gps/pos/halfx
Format: /gps/pos/halfx <Haf i>
Arguments: Double Halfx and a G4String giving the unit.
Function: Sets the x half-length of the source.
24/03/2012 Geant4 GPS Users Manual
10/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Default: Since the default source is a point, halfx is by default set to 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km.
/gps/pos/halfv
Format: /gps/pos/halfy <Haf i>
Arguments: Double Halfv and a G4String giving the unit.
Function: Sets the y half-length of the source.
Default: Since the default source is a point, halfy is by default set to 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km.
/gps/pos/half:
Format: /gps/pos/halfz <Haf i>
Arguments: Double Half: and a G4String giving the unit.
Function: Sets the z half-length of the source.
Default: Since the default source is a point, halfz is by default set to 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km.
/gps/pos/radius
Format: /gps/pos/radius <Radi i>
Arguments: Double Radius and a G4String for the unit.
Function: Sets the radius of the source or outer radius for annuli.
Default: Since the default source is a point, Radius is by default set to 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km
/gps/pos/innerradius
Format: /gps/pos/inner_radius<Radi i>
Arguments: Double Radius and a G4String for the unit.
Function: Sets the inner radius of annular sources.
Default: 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km
/gps/pos/sigmar
Format: /gps/pos/sigmar <iga i>
24/03/2012 Geant4 GPS Users Manual
11/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation of beam position profile in radial.
Default: 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km.
To be used in confunction with.
/gps/pos/tvpe Beam
/gps/pos/shape Circle
/gps/pos/sigmax
Format: /gps/pos/sigmax <iga i>
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation of beam position profile in the x-direction (2d case)
Default: 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km.
/gps/pos/sigmav
Format: /gps/pos/sigmay<iga i>
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation of beam position profile in the y-direction (2d case)
Default: 0 cm.
Errors: An error is flagged if the units are not micron, mm, cm, m or km.
sigmax and sigmav are to be used in confunction with.
/gps/pos/tvpe Beam
/gps/pos/tvpe Square (or Rectangle)
/gps/pos/paralp
Format: /gps/pos/paralp <aha i>
Arguments: Double alpha and a unit.
Function: Angle formed by the y-axis and by the plane joining the centre of the faces parallel
to the z-x plane at y and +y. (See Fig 2).
Default: Zero radians.
24/03/2012 Geant4 GPS Users Manual
12/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Errors: An error is flagged if the unit is anything other than rad or deg.
/gps/pos/parthe
Format: /gps/pos/parthe <hea i>
Arguments: Double theta and a unit.
Function: Polar angle of the line connecting the centre of the face at z to the centre of the
face at +z. (See Fig 2).
Default: Zero radians.
Errors: An error is flagged if the unit is anything other than rad or deg.
/gps/pos/parphi
Format: /gps/pos/parphi <hi i>
Arguments: Double phi and a unit.
Function: Azimuth angle of the line connecting the centre of the face at z with the centre of
the face at +z. (See Fig 2).
Default: Zero radians.
Errors: An error is flagged if the unit is anything other than rad or deg.
/gps/pos/confine
Format: /gps/pos/confine <VNae>
Arguments: G4String JolName
Function: Confines source to volume given by JolName.
Default: By default this is set to NULL.
Errors: An error is flagged if an invalid physical volume name is given.
iv. Sub command director /gps/ang
Function: Contains all the commands for specification of direction.
/gps/ang/tvpe
Format: /gps/ang/type <AgDi>
Arguments: G4String AngDis.
Function: Sets the angular distribution type to either isotropic (iso), cosine-law (cos), planar wave
(planar), 1-d accelerator beam (beam1d), 2-d accelerator beam (beam2d), focusing to a point
(focused) or user-defined (user).
Default: Isotropic (iso).
24/03/2012 Geant4 GPS Users Manual
13/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Errors: The only arguments are the ones defined.
/gps/ang/rot1
Format: /gps/ang/rot1 <AR1
, AR1
, AR1
>
Arguments: Three doubles AR1
x
, AR1
v
, AR1
:
.
Function: Sets the x vector for the angular distribution. This does not necessarily have to be a unit
vector.
Default: The unit vector x (1., 0., 0.).
/gps/ang/rot2
Format: /gps/ang/rot2 <AR2
, AR2
, AR2
>
Arguments: Three doubles AR2
x
, AR2
v
, AR2
:
.
Function: Defines a vector in the x-y plane for the angular distribution. This does not necessarily
have to be a unit vector.
Default: The unit vector y (0., 1., 0.).
/gps/ang/mintheta
Format: /gps/ang/mintheta <MiThea i>
Arguments: Double MinTheta and G4String unit.
Function: Sets a minimum value for the theta distribution.
Default: Zero radians.
Errors: An error is flagged if the units are not rad or deg.
/gps/maxtheta
Format: /gps/ang/maxtheta <MaThea i>
Arguments: Double MaxTheta and G4String unit.
Function: Sets a maximum value for the theta distribution.
Default: p radians.
Errors: An error is flagged if the units are not rad or deg.
/gps/ang/minphi
Format: /gps/ang/minphi <MiPhi i>
Arguments: Double MinPhi and a G4String unit.
24/03/2012 Geant4 GPS Users Manual
14/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Function: Sets the minimum value for the phi distribution.
Default: Zero radians.
Errors: An error is flagged if the units are not rad or deg.
/gps/ang/maxphi
Format: /gps/ang/maxphi <MaPhi i>
Arguments: Double MaxPhi and a G4String unit.
Function: Sets the maximum value for the phi distribution.
Default: 2p radians.
Errors: An error is flagged if the units are not rad or deg.
/gps/ang/sigmar
Format: /gps/ang/sigmar <iga i>
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation of beam angular profile in radial.
Default: 0 rad
Errors: An error is flagged if the units are not rad or deg.
To be used in confunction with.
/gps/ang/tvpe beam1d
/gps/ang/sigmax
Format: /gps/ang/sigmax <iga i>
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation of beam angular profile in the x-direction (2d case)
Default: 0 rad.
Errors: An error is flagged if the units are not rad or deg.
/gps/ang/sigmav
Format: /gps/ang/sigmay<iga i>
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation of beam angular profile in the y-direction (2d case)
Default: 0 rad
24/03/2012 Geant4 GPS Users Manual
15/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Errors: An error is flagged if the units are not rad or deg.
ang/sigmax and ang/sigmav are to be used in confunction with.
/gps/ang/tvpe beam2d
/gps/ang/focuspoint
Format: /gps/ang/focuspoint <X Y Z i>
Arguments: Three doubles x, v and : plus a string giving the unit.
Function: Sets the focusing point.
Default: The origin (0., 0., 0.) and the default unit is cm.
Errors: An error is flagged if the units do not belong to cm, mm, micron, etc.
/gps/ang/surfnorm
Format: /gps/ang/surfnorm <B>
Arguments: Boolean Bool.
Function: If Bool is true then the user defined angular distribution is calculated with respect to the
surface normals, otherwise it is with respect to the co-ordinate system.
Default: False.
/gps/ang/usercoor
Format: /gps/ang/user_coor <Bool>
Arguments: .Boolean Bool.
Function: If Bool is true then the angular distribution is calculated with respect to the user definded
co-ordinate system, otherwise it is with respect to the global co-ordinate system
Default: False.
v. Sub command director /gps/ene
Function: Contains all the commands for specification of energy.
/gps/ene/tvpe
Format: /gps/ene/type <EegDi>
Arguments: G4String EnergvDis.
Function: Sets the energy distribution type. Candidates are mono-energetic (Mono), linear
(Lin), power-law (Pow), exponential (Exp), Gaussian (Gauss), bremsstrahlung (Brem), black-
body (Bbody), cosmic diffuse gamma ray (Cdg), user-defined histogram (User), arbitrary point-
wise spectrum (Arb) and user-defined energy per nucleon histogram (Epn). Again, capitalisation is
important, only strings given exactly as above will be recognised.
24/03/2012 Geant4 GPS Users Manual
16/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Default: Mono.
Errors: Only Mono, Lin, Pow, Exp, Gauss, Brem, Bbodv, Cdg, User, Arb and Epn are
acceptable arguments.
/gps/ene/min
Format: /gps/ene/min <ei i>
Arguments: Double emin and a G4String unit.
Function: Sets the minimum for the energy distribution.
Default: The default source is mono-energetic and so by default emin is 0 keV.
Errors: An error is flagged if the units are not eV, keV, MeV, GeV, TeV or PeV.
/gps/ene/max
Format: /gps/ene/max <ea i>
Arguments: Double emax and a G4String unit.
Function: Sets the maximum for the energy distribution.
Default: The default source is mono-energetic and so by default emax is 0 keV.
Errors: An error is flagged if the units are not eV, keV, MeV, GeV, TeV or PeV.
/gps/ene/mono
Format: /gps/ene/mono<eeg i>
Arguments: Double monoenergv and a G4String unit.
Function: Sets the energy for mono-energetic sources.
Default: The default source is mono-energetic and so by default monoenergy is set to 1
MeV.
Errors: An error is flagged if the units are not eV, keV, MeV, GeV, TeV or PeV.
/gps/ene/sigma
Format: /gps/ene/sigma <iga i>
Arguments: Double sigma and a G4String giving the unit.
Function: Sets the standard deviation in energy for Gaussian energy distribution.
Default: 0 keV
Errors: An error is flagged if the units are not eV, keV, MeV, GeV, TeV or PeV.
To be used in confunction with.
24/03/2012 Geant4 GPS Users Manual
17/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
/gps/ene/tvpe Gauss
/gps/ene/mono
/gps/ene/alpha
Format: /gps/ene/alpha <aha>
Arguments: Double alpha.
Function: Sets alpha for power-law distributions of the form y = AE
a
, where A is a constant.
Default: Zero.
/gps/ene/temp
Format: /gps/ene/temp <e>
Arguments: Double temp.
Function: Sets temperature (in Kelvin) for Bbody and Brem distributions. The black body
equation is
And the equation of the bremsstrahlung is
Default: Zero.
/gps/ene/e:ero
Format: /gps/ene/ezero <ee>
Arguments: Double e:ero.
Function: Sets E
0
for exponential distributions of the form
Default: Zero.
/gps/ene/gradient
Format: /gps/ene/gradient <gadie>
Arguments: Double gradient.
Function: Sets the gradient for linear distributions.
Default: Zero.
24/03/2012 Geant4 GPS Users Manual
18/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
/gps/ene/intercept
Format: /gps/ene/intercept <iece>
Arguments: Double intercept.
Function: Sets the intercept for the linear distribution.
Default: Zero.
/gps/ene/calculate
Format: /gps/ene/calculate
Arguments: None
Function: Calculates the integral probability distribution functions for the Cdg and Bbody
distributions. In the case of the Bbody distribution, it proved very difficult to obtain an indefinite
integral of the black-body equation from which random energies could be generated. It was
decided therefore to use the black-body equation to calculate a 10,000 bin histogram, which
could then be used to obtain the integral PDF necessary to generate random energies. In the case
of the Cdg distribution, the use of a broken power-law meant that generating an integral PDF was
problematic. With this command the cosmic diffuse gamma ray equation is generated, depending
on the minimum and maximum energies given by the user, and then an integral PDF is obtained
from which the random energies are generated.
/gps/ene/emspec
Format: /gps/emspec <eec>
Arguments: Boolean emspec.
Function: Toggles between energy (True) and momentum (False) spectra. This option can be
used with user-defined energy histograms or arbitrary point-wise spectra. By default it is assumed
that these are entered as distributions in terms of energy, however by specifying energvspec as
false the user can tell the GPS that they are in terms of momentum. Internally GPS will then
convert from momentum to energy distributions before generating random energies.
Default: True.
/gps/ene/diffspec
Format: /gps/ene/diffspec <diffec>
Arguments: Boolean diffspec.
Function: Toggles between differential (True) and integral (False) spectra. This option can
only be used with user-defined arbitrary point-wise spectra. These are by default given as
differential functions, however by specifying diffspec as false the user can tell GPS that the
function they have defined is integral.
Default: True.
vi. Sub command director /gps/hist
24/03/2012 Geant4 GPS Users Manual
19/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
Function: Contains all the commands for specification of histograms.
/gps/hist/tvpe
Format: /gps/hist/type <HiTe>
Arguments: G4String HistTvpe.
Function: Sets the histogram type. Choices are bias x, y, z, angle_q (t), angle_ f (p),
position_q (pt), position_ f (pp),energy (e) (biasx, biasy, biasz, biast, biasp, biaspt,
biaspp, biase) or for user-defined histograms: theta, phi, energy, arb, epn.
Default: biasx.
Errors: Only biasx, biasv, bias:, biast, biasp, biaspt, biaspp, biase, theta, phi, energv,
arb and epn are acceptable arguments.
/gps/hist/point
Format: /gps/histpoint <Ehi Weigh>
Arguments: Two doubles Ehi, Weight.
Function: Allows the user to define a histogram bin, or a data pair. Note: Ehi should
be in Geant4 default units, i.e. MeV for energy and Rad for angle. Also please note the
restrictions specified in section 6(i) below
/gps/hist/inter
Format: /gps/hist/inter <i>
Arguments: G4String int.
Function: Sets arbitrary interpolation type. This can be either linear (Lin), logarithmic
(Log), exponential (Exp) or cubic spline (Spline).
Default: NULL
Errors: Only Lin, Log, Exp and Spline are acceptable arguments.
/gps/hist/reset
Format: /gps/hist/reset<HiTe>
Arguments: G4String HistTvpe.
Function: Re-sets the histogram defined. Choices are bias x, y, z, angle_q (t), angle_
f (p), position_q (pt), position_ f (pp),energy (e) (biasx, biasy, biasz, biast, biasp, biaspt,
biaspp, biase) or for user-defined histograms: theta, phi, energy, arb, epn.
Default: biasx.
Errors: Only biasx, biasv, bias:, biast, biasp, biaspt, biaspp, biase, theta, phi, energv,
24/03/2012 Geant4 GPS Users Manual
20/26 reat.space.qinetiq.com/gps/ne_gps_sum_files/gps_sum.htm
arb and epn are acceptable arguments.
vii. Command Summar
Command Arguments and argument
restrictions
Command function and
restrictions
/gps/parti cl e <parti cl eName> G4Stri ng parti cl eName. Defi nes the parti cl e type.
/gps/ion <Z A Q E> Integers Z (the Atomic number), A (the Atomic mass)
and Q (ionic charge in units of e). Double E the
excitation energy of the ion in keV.
Sets the properties of the ion. Should be used after
/gps/particle ion.
/gps/List None List available incident particles
/gps/energy <energy unit> Double energy and a G4String unit. Sets the energy for mono-energetic sources.
/gps/position <X Y Z unit> Three doubles x, y and z plus a string giving the unit. Sets the centre co-ordinates of the source.
/gps/direction <dx dy dz> dx, dy, dz are direction cosines set the momentum direction.
/gps/time <t0 unit> Double t0 and a G4String for the unit. Sets the particle time.
/gps/polarization <Px Py Pz> Three doubles Px, Py, Pz. Sets the polarization of the source.
/gps/number <N> Integer N. Sets the number of particles to simulate.
/gps/verbose <verbosityLevel> An integer verbosityLevel. This allows the user to control the amount of information
printed out by the GPS code.
/gps/source/list none list the particle sources defined.
/gps/source/add <intensity> G4double intensity add a new particle source with the specified intensity
gps/source/delete <source_index> G4int index remove the specified particle source.
/gps/source/clear none remove all defined particle sources.
/gps/source/show none display the current particle source
/gps/source/set <source_index> G4int index set the specified particle source as the current one.
/gps/source/multiplevertex G4bool true for simulaneous generation mutiple vertices
/gps/source/intensity <intensity> G4double intensity reset the current source to the specified intensity
/gps/pos/type <Di Te> G4Stri ng Di Te. Can onl y be "Pi ", "P ae",
"Beam", "Sface" or "V e".
Sets the source posi ti onal di stri buti on type.
/gps/pos/shape <Shape> G4Stri ng Shae. Li mi ted to "Ci c e", "A ",
"E i e", "Sae", "Recag e", "Shee",
"E i i d", "C i de" or "Paa".
Sets the source shape type. For a Pl ane thi s can
be Ci rcl e, El l i pse, Square or Rectangl e. For both
Surface or Vol ume sources thi s can be Sphere,
El l i psoi d, Cyl i nder or Para.
/gps/pos/centre <X Y Z i > G4doubl es X, Y, Z and G4stri ng i . The uni ts
can onl y be mi cron, mm, cm ,m or km.
Sets the centre co-ordi nates of the source.
/gps/pos/rot1 <R1
, R1
, R1
> G4doubl es R1
, R1
, R1
, R2
, R2
> G4doubl es R2
, R2
, R2
, AR1
, AR1
, AR1
, AR1
, AR2
, AR2
, AR2
, AR2