Logo ROOT  
Reference Guide
RooQuasiRandomGenerator.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooQuasiRandomGenerator.h,v 1.7 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_QUASI_RANDOM_GENERATOR
17 #define ROO_QUASI_RANDOM_GENERATOR
18 
19 #include "Rtypes.h"
20 
22 public:
24  virtual ~RooQuasiRandomGenerator();
25  void reset();
26  Bool_t generate(UInt_t dimension, Double_t vector[]);
27  enum { MaxDimension = 12 , NBits = 31 , MaxDegree = 50 , MaxPrimitiveDegree = 5 };
28 protected:
29  void calculateCoefs(UInt_t dimension);
30  void calculateV(const int px[], int px_degree,
31  int pb[], int * pb_degree, int v[], int maxv);
32  void polyMultiply(const int pa[], int pa_degree, const int pb[],
33  int pb_degree, int pc[], int * pc_degree);
34  // Z_2 field operations
35  inline Int_t add(Int_t x, Int_t y) const { return (x+y)%2; }
36  inline Int_t mul(Int_t x, Int_t y) const { return (x*y)%2; }
37  inline Int_t sub(Int_t x, Int_t y) const { return add(x,y); }
38 private:
41 
45  static const Int_t _polyDegree[MaxDimension+1];
46 
47  ClassDef(RooQuasiRandomGenerator,0) // Quasi-random number generator
48 };
49 
50 #endif
51 
52 
RooQuasiRandomGenerator::_sequenceCount
Int_t _sequenceCount
Definition: RooQuasiRandomGenerator.h:40
RooQuasiRandomGenerator::MaxDegree
@ MaxDegree
Definition: RooQuasiRandomGenerator.h:27
RooQuasiRandomGenerator::_polyDegree
static const Int_t _polyDegree[MaxDimension+1]
Definition: RooQuasiRandomGenerator.h:45
TGeant4Unit::pc
static constexpr double pc
Definition: TGeant4SystemOfUnits.h:130
x
Double_t x[n]
Definition: legend1.C:17
RooQuasiRandomGenerator::_primitivePoly
static const Int_t _primitivePoly[MaxDimension+1][MaxPrimitiveDegree+1]
Definition: RooQuasiRandomGenerator.h:44
RooQuasiRandomGenerator::RooQuasiRandomGenerator
RooQuasiRandomGenerator()
Perform one-time initialization of our static coefficient array if necessary and initialize our works...
Definition: RooQuasiRandomGenerator.cxx:48
RooQuasiRandomGenerator::~RooQuasiRandomGenerator
virtual ~RooQuasiRandomGenerator()
Destructor.
Definition: RooQuasiRandomGenerator.cxx:63
v
@ v
Definition: rootcling_impl.cxx:3635
RooQuasiRandomGenerator::generate
Bool_t generate(UInt_t dimension, Double_t vector[])
Generate the next number in the sequence for the specified dimension.
Definition: RooQuasiRandomGenerator.cxx:83
bool
RooQuasiRandomGenerator
This class generates the quasi-random (aka "low discrepancy") sequence for dimensions up to 12 using ...
Definition: RooQuasiRandomGenerator.h:21
RooQuasiRandomGenerator::add
Int_t add(Int_t x, Int_t y) const
Definition: RooQuasiRandomGenerator.h:35
RooQuasiRandomGenerator::mul
Int_t mul(Int_t x, Int_t y) const
Definition: RooQuasiRandomGenerator.h:36
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
y
Double_t y[n]
Definition: legend1.C:17
RooQuasiRandomGenerator::_coefsCalculated
static Bool_t _coefsCalculated
Definition: RooQuasiRandomGenerator.h:42
unsigned int
RooQuasiRandomGenerator::reset
void reset()
Reset the workspace to its initial state.
Definition: RooQuasiRandomGenerator.cxx:72
RooQuasiRandomGenerator::NBits
@ NBits
Definition: RooQuasiRandomGenerator.h:27
Double_t
double Double_t
Definition: RtypesCore.h:59
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooQuasiRandomGenerator::polyMultiply
void polyMultiply(const int pa[], int pa_degree, const int pb[], int pb_degree, int pc[], int *pc_degree)
Internal function.
Definition: RooQuasiRandomGenerator.cxx:293
RooQuasiRandomGenerator::_nextq
Int_t * _nextq
Definition: RooQuasiRandomGenerator.h:39
RooQuasiRandomGenerator::sub
Int_t sub(Int_t x, Int_t y) const
Definition: RooQuasiRandomGenerator.h:37
RooQuasiRandomGenerator::calculateV
void calculateV(const int px[], int px_degree, int pb[], int *pb_degree, int v[], int maxv)
Internal function.
Definition: RooQuasiRandomGenerator.cxx:201
RooQuasiRandomGenerator::_cj
static Int_t _cj[NBits][MaxDimension]
Definition: RooQuasiRandomGenerator.h:43
RooQuasiRandomGenerator::calculateCoefs
void calculateCoefs(UInt_t dimension)
Calculate the coefficients for the given number of dimensions.
Definition: RooQuasiRandomGenerator.cxx:123
Rtypes.h
RooQuasiRandomGenerator::MaxPrimitiveDegree
@ MaxPrimitiveDegree
Definition: RooQuasiRandomGenerator.h:27
RooQuasiRandomGenerator::MaxDimension
@ MaxDimension
Definition: RooQuasiRandomGenerator.h:27
int