Logo ROOT  
Reference Guide
RooQuasiRandomGenerator Class Reference

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.

Definition at line 21 of file RooQuasiRandomGenerator.h.

Public Types

enum  { MaxDimension = 12 , NBits = 31 , MaxDegree = 50 , MaxPrimitiveDegree = 5 }
 

Public Member Functions

 RooQuasiRandomGenerator ()
 Perform one-time initialization of our static coefficient array if necessary and initialize our workspace. More...
 
virtual ~RooQuasiRandomGenerator ()
 Destructor. More...
 
bool generate (UInt_t dimension, double vector[])
 Generate the next number in the sequence for the specified dimension. More...
 
virtual TClassIsA () const
 
void reset ()
 Reset the workspace to its initial state. More...
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Member Functions

Int_t add (Int_t x, Int_t y) const
 
void calculateCoefs (UInt_t dimension)
 Calculate the coefficients for the given number of dimensions. More...
 
void calculateV (const int px[], int px_degree, int pb[], int *pb_degree, int v[], int maxv)
 Internal function. More...
 
Int_t mul (Int_t x, Int_t y) const
 
void polyMultiply (const int pa[], int pa_degree, const int pb[], int pb_degree, int pc[], int *pc_degree)
 Internal function. More...
 
Int_t sub (Int_t x, Int_t y) const
 

Private Attributes

Int_t_nextq
 
Int_t _sequenceCount
 

Static Private Attributes

static Int_t _cj [NBits][MaxDimension]
 
static bool _coefsCalculated = false
 
static const Int_t _polyDegree [MaxDimension+1]
 
static const Int_t _primitivePoly [MaxDimension+1][MaxPrimitiveDegree+1]
 

#include <RooQuasiRandomGenerator.h>

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxDimension 
NBits 
MaxDegree 
MaxPrimitiveDegree 

Definition at line 27 of file RooQuasiRandomGenerator.h.

Constructor & Destructor Documentation

◆ RooQuasiRandomGenerator()

RooQuasiRandomGenerator::RooQuasiRandomGenerator ( )

Perform one-time initialization of our static coefficient array if necessary and initialize our workspace.

Definition at line 46 of file RooQuasiRandomGenerator.cxx.

◆ ~RooQuasiRandomGenerator()

RooQuasiRandomGenerator::~RooQuasiRandomGenerator ( )
virtual

Destructor.

Definition at line 61 of file RooQuasiRandomGenerator.cxx.

Member Function Documentation

◆ add()

Int_t RooQuasiRandomGenerator::add ( Int_t  x,
Int_t  y 
) const
inlineprotected

Definition at line 35 of file RooQuasiRandomGenerator.h.

◆ calculateCoefs()

void RooQuasiRandomGenerator::calculateCoefs ( UInt_t  dimension)
protected

Calculate the coefficients for the given number of dimensions.

Definition at line 121 of file RooQuasiRandomGenerator.cxx.

◆ calculateV()

void RooQuasiRandomGenerator::calculateV ( const int  px[],
int  px_degree,
int  pb[],
int pb_degree,
int  v[],
int  maxv 
)
protected

Internal function.

Definition at line 199 of file RooQuasiRandomGenerator.cxx.

◆ Class()

static TClass * RooQuasiRandomGenerator::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * RooQuasiRandomGenerator::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static Version_t RooQuasiRandomGenerator::Class_Version ( )
inlinestatic
Returns
Version of this class

Definition at line 47 of file RooQuasiRandomGenerator.h.

◆ DeclFileName()

static const char * RooQuasiRandomGenerator::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 47 of file RooQuasiRandomGenerator.h.

◆ generate()

bool RooQuasiRandomGenerator::generate ( UInt_t  dimension,
double  vector[] 
)

Generate the next number in the sequence for the specified dimension.

The maximum dimension supported is 12.

Definition at line 81 of file RooQuasiRandomGenerator.cxx.

◆ IsA()

virtual TClass * RooQuasiRandomGenerator::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Definition at line 47 of file RooQuasiRandomGenerator.h.

◆ mul()

Int_t RooQuasiRandomGenerator::mul ( Int_t  x,
Int_t  y 
) const
inlineprotected

Definition at line 36 of file RooQuasiRandomGenerator.h.

◆ polyMultiply()

void RooQuasiRandomGenerator::polyMultiply ( const int  pa[],
int  pa_degree,
const int  pb[],
int  pb_degree,
int  pc[],
int pc_degree 
)
protected

Internal function.

Definition at line 291 of file RooQuasiRandomGenerator.cxx.

◆ reset()

void RooQuasiRandomGenerator::reset ( )

Reset the workspace to its initial state.

Definition at line 70 of file RooQuasiRandomGenerator.cxx.

◆ Streamer()

virtual void RooQuasiRandomGenerator::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void RooQuasiRandomGenerator::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 47 of file RooQuasiRandomGenerator.h.

◆ sub()

Int_t RooQuasiRandomGenerator::sub ( Int_t  x,
Int_t  y 
) const
inlineprotected

Definition at line 37 of file RooQuasiRandomGenerator.h.

Member Data Documentation

◆ _cj

Int_t RooQuasiRandomGenerator::_cj
staticprivate

Definition at line 43 of file RooQuasiRandomGenerator.h.

◆ _coefsCalculated

bool RooQuasiRandomGenerator::_coefsCalculated = false
staticprivate

Definition at line 42 of file RooQuasiRandomGenerator.h.

◆ _nextq

Int_t* RooQuasiRandomGenerator::_nextq
private

Definition at line 39 of file RooQuasiRandomGenerator.h.

◆ _polyDegree

const Int_t RooQuasiRandomGenerator::_polyDegree
staticprivate
Initial value:
=
{
0, 1, 1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5
}

Definition at line 45 of file RooQuasiRandomGenerator.h.

◆ _primitivePoly

const Int_t RooQuasiRandomGenerator::_primitivePoly
staticprivate
Initial value:
=
{
{ 1, 0, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0 },
{ 1, 1, 0, 0, 0, 0 },
{ 1, 1, 1, 0, 0, 0 },
{ 1, 1, 0, 1, 0, 0 },
{ 1, 0, 1, 1, 0, 0 },
{ 1, 1, 0, 0, 1, 0 },
{ 1, 0, 0, 1, 1, 0 },
{ 1, 1, 1, 1, 1, 0 },
{ 1, 0, 1, 0, 0, 1 },
{ 1, 0, 0, 1, 0, 1 },
{ 1, 1, 1, 1, 0, 1 },
{ 1, 1, 1, 0, 1, 1 }
}

Definition at line 44 of file RooQuasiRandomGenerator.h.

◆ _sequenceCount

Int_t RooQuasiRandomGenerator::_sequenceCount
private

Definition at line 40 of file RooQuasiRandomGenerator.h.

Libraries for RooQuasiRandomGenerator:
[legend]

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