PYTHIA  8.303
Public Member Functions | List of all members
Rndm Class Reference

#include <Basics.h>

Public Member Functions

 Rndm ()
 Constructors.
 
 Rndm (int seedIn)
 
bool rndmEnginePtr (RndmEngine *rndmEngPtrIn)
 Possibility to pass in pointer for external random number generation. More...
 
void init (int seedIn=0)
 Initialize, normally at construction or in first call. More...
 
double flat ()
 Generate next random number uniformly between 0 and 1. More...
 
double exp ()
 Generate random numbers according to exp(-x).
 
double xexp ()
 Generate random numbers according to x * exp(-x).
 
double gauss ()
 Generate random numbers according to exp(-x^2/2).
 
pair< double, double > gauss2 ()
 Generate two random numbers according to exp(-x^2/2-y^2/2).
 
pair< Vec4, Vec4phaseSpace2 (double eCM, double m1, double m2)
 Generate two random vectors according to the phase space distribution. More...
 
int pick (const vector< double > &prob)
 Pick one option among vector of (positive) probabilities.
 
bool dumpState (string fileName)
 Save or read current state to or from a binary file. More...
 
bool readState (string fileName)
 Read in the state of the random number generator from a binary file. More...
 

Detailed Description

Rndm class. This class handles random number generation according to the Marsaglia-Zaman-Tsang algorithm.

Member Function Documentation

bool dumpState ( string  fileName)

Save or read current state to or from a binary file.

Save current state of the random number generator to a binary file.

Open file as output stream.

Write the state of the generator on the file.

Write confirmation on cout.

double flat ( )

Generate next random number uniformly between 0 and 1.

Use external random number generator if such has been linked.

Ensure that already initialized.

Find next random number and update saved state.

void init ( int  seedIn = 0)

Initialize, normally at construction or in first call.

Pick seed in convenient way. Assure it to be non-negative.

Unpack seed.

Initialize random number array.

Initialize other variables.

Finished.

pair< Vec4, Vec4 > phaseSpace2 ( double  eCM,
double  m1,
double  m2 
)

Generate two random vectors according to the phase space distribution.

Calculate phase space configuration.

Isotropic angles give three-momentum.

bool readState ( string  fileName)

Read in the state of the random number generator from a binary file.

Open file as input stream.

Read the state of the generator from the file.

Write confirmation on cout.

bool rndmEnginePtr ( RndmEngine rndmEngPtrIn)

Possibility to pass in pointer for external random number generation.

Method to pass in pointer for external random number generation.

Save pointer.

Done.


The documentation for this class was generated from the following files: