gibuu is hosted by Hepforge, IPPP Durham
GiBUU

TABLE OF CONTENTS


/random [ Modules ]

[ Top ] [ Modules ]

NAME

module random

PURPOSE

Contains all information and routines, which are necessary for the random number generation.

NOTES

Formerly we used the random number generator RAN3 from Numerical Recipes. We switched to the generator "PYR" provided by Pythia, which is a rewrite of the RANMAR routine from the Cernlib.

Contrary to the old RAN3 behaviour, the new rn() excludes the endpoints 0 and 1 !


random/Seed [ Global module-variables ]

[ Top ] [ random ] [ Global module-variables ]

PURPOSE

Random Seed (used to initialize the random number generator), accessible through the namelist 'initRandom'. If Seed is zero (default), then it is set via "SYSTEM_CLOCK()".

SOURCE

  integer,save ::  Seed = 0

random/resetRandom [ Global module-variables ]

[ Top ] [ random ] [ Global module-variables ]

PURPOSE

Reread random generator, used by setRandom, useful for debugging.

SOURCE

  logical,save :: resetRandom = .false.

random/rnExp [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rnExp (A) real function rnExp (A, x1, x2)

PURPOSE

Evaluates a random number x according to an exp(A*x) distribution. If given, x is restricted to lie between x1 and x2 (it doesn't matter which one of the two is larger).

INPUTS

  • real :: A -- slope parameter (can be negative)
  • real :: x1 -- minimal x-value
  • real :: x2 -- maximal x-value

RESULT

random number


random/InitRan [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

subroutine InitRan

PURPOSE

Reads random seed out of namelist 'initRandom' in jobcard and initializes the random number generator.


random/initRandom [ Namelists ]

[ Top ] [ random ] [ Namelists ]

NAME

NAMELIST /initRandom/

PURPOSE

Includes the input variables:


random/SetRandom [ Subroutines ]

[ Top ] [ random ] [ Subroutines ]

NAME

subroutine SetRandom

PURPOSE

write out/read random number generators

NOTES

This routine provides a shortcut for MC debugging: if an error occurs in run 12345 of 99999 runs/energy after 3 days of CPU time, the idea is to reset the random generators by reading in some files, that already run 1 reproduces this error.

In order to avoid some re-ordering of the random number lists, only in run number 3 the previously written files are read. The code stops in run 4.


random/rn_openInterval [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rn_openInterval()

PURPOSE

Evaluates a random number in (0,1).

USAGE

(real)=rn_openInterval() Notes Finds random number which is in [1E-8,1-1E-8], which is approximately (0,1).


random/rn [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rn()

PURPOSE

Evaluates a random number in (0,1).

USAGE

(real)=rn()

NOTES

Checks whether the random generator should be initialised, otherwise it just calls PYR. Endpoints are excluded.


random/rnFlat [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rnFlat(xMin,xMax)

PURPOSE

Draws a random number from a flat (uniform) distribution on (xMin,xMax).

INPUTS

  • real :: xMin,xMax -- minimum and maximum value


random/rnGauss [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rnGauss(StdDev, Mean)

PURPOSE

evaluates a random number in according a Gauss distribution

INPUTS

  • real :: StdDev -- standard deviation
  • real :: Mean -- mean value of distribution

RESULT

Random number.


random/rnCos [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rnCos()

PURPOSE

Evaluates a random number x according to cos(x) distribution. So cos(x) is assumed to be isotropic in [-1,1]

INPUTS

  • NONE

RESULT

Random number.


random/rnPower [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

real function rnPower (n, xMin, xMax)

PURPOSE

Draws a random number according to a power-law distribution ~ x^n.

INPUTS

  • real :: n -- exponent in power law (arbitrary real number)
  • real :: xMin,xMax -- minimum and maximum value

RESULT

Random number between xMin and xMax.


random/rnOmega [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

function rnOmega()

PURPOSE

Generates a unit vector with random angle (isotropical distribution).

INPUTS

  • NONE

RESULT

real :: rnOmega(3) - random 3-dim. unit-vector


random/rnOmega_anis [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

function rnOmega_anis (B)

PURPOSE

Generates a unit vector with random angle (anisotropical distribution). cos(theta) is chosen according to a probability distribution ~ 1 + B*cos**2(theta).

INPUTS

  • real, intent(in) :: B --- parameter of prob. distr.

RESULT

real :: rnOmega_anis(3) - random 3-dim. unit-vector


random/rnOmega_angles [ Subroutines ]

[ Top ] [ random ] [ Subroutines ]

NAME

subroutine rnOmega(theta,phi)

PURPOSE

Generates random angles theta and phi (istropical distribution) in degree.

INPUTS

  • NONE

OUTPUT

  • real :: theta, phi


random/rn_trueFalse [ Functions ]

[ Top ] [ random ] [ Functions ]

NAME

function rn_trueFalse

PURPOSE

Gives true or false with same probability.

INPUTS

  • NONE

RESULT

Logical.


random/ranCharge [ Subroutines ]

[ Top ] [ random ] [ Subroutines ]

NAME

subroutine ranCharge (izmin, izmax, iztot, izout, flag)

PURPOSE

This subroutine distributes the charges randomly to a given total charge iztot.

INPUTS

  • integer, intent(in) :: izmin(:) ! Vector of minimal charges
  • integer, intent(in) :: izmax(:) ! Vector of maximal charges
  • integer, intent(in) :: iztot ! total charge

OUTPUT

  • real, dimension(:) :: izout ! Random charge configuration
  • logical, intent(out) :: flag ! =.false. if procedure failed