ROOT logo
ROOT » ROOFIT » ROOFITCORE » RooQuasiRandomGenerator

class RooQuasiRandomGenerator



This class generates the quasi-random (aka "low discrepancy") sequence for dimensions up to 12 using the Niederreiter base 2 algorithm described in Bratley, Fox, Niederreiter, ACM Trans. Model. Comp. Sim. 2, 195 (1992). This implementation was adapted from the 0.9 beta release of the GNU scientific library. Quasi-random number sequences are useful for improving the convergence of a Monte Carlo integration.

Function Members (Methods)

protected:
Int_tadd(Int_t x, Int_t y) const
voidcalculateCoefs(UInt_t dimension)
voidcalculateV(const int* px, int px_degree, int* pb, int* pb_degree, int* v, int maxv)
Int_tmul(Int_t x, Int_t y) const
voidpolyMultiply(const int* pa, int pa_degree, const int* pb, int pb_degree, int* pc, int* pc_degree)
Int_tsub(Int_t x, Int_t y) const

Data Members

public:
enum { MaxDimension
NBits
MaxDegree
MaxPrimitiveDegree
};
private:
static Int_t_cj[31][12]
static Bool_t_coefsCalculated
Int_t*_nextq
static const Int_t_polyDegree[13]
static const Int_t_primitivePoly[13][6]
Int_t_sequenceCount

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

RooQuasiRandomGenerator()
 Perform one-time initialization of our static coefficient array if necessary
 and initialize our workspace.
~RooQuasiRandomGenerator()
 Destructor
void reset()
 Reset the workspace to its initial state.
Bool_t generate(UInt_t dimension, Double_t* vector)
 Generate the next number in the sequence for the specified dimension.
 The maximum dimension supported is 12.
void calculateCoefs(UInt_t dimension)
 Calculate the coefficients for the given number of dimensions
void calculateV(const int* px, int px_degree, int* pb, int* pb_degree, int* v, int maxv)
 Internal function
void polyMultiply(const int* pa, int pa_degree, const int* pb, int pb_degree, int* pc, int* pc_degree)
 Internal function
RooQuasiRandomGenerator()
Int_t add(Int_t x, Int_t y) const
 Z_2 field operations
{ return (x+y)%2; }
Int_t mul(Int_t x, Int_t y) const
{ return (x*y)%2; }
Int_t sub(Int_t x, Int_t y) const
{ return add(x,y); }