Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooQuasiRandomGenerator.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooQuasiRandomGenerator.h,v 1.7 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_QUASI_RANDOM_GENERATOR
0017 #define ROO_QUASI_RANDOM_GENERATOR
0018 
0019 #include "Rtypes.h"
0020 
0021 class RooQuasiRandomGenerator {
0022 public:
0023   RooQuasiRandomGenerator();
0024   virtual ~RooQuasiRandomGenerator();
0025   void reset();
0026   bool generate(UInt_t dimension, double vector[]);
0027   enum { MaxDimension = 12 , NBits = 31 , MaxDegree = 50 , MaxPrimitiveDegree = 5 };
0028 protected:
0029   void calculateCoefs(UInt_t dimension);
0030   void calculateV(const int px[], int px_degree,
0031         int pb[], int * pb_degree, int v[], int maxv);
0032   void polyMultiply(const int pa[], int pa_degree, const int pb[],
0033           int pb_degree, int pc[], int  * pc_degree);
0034   // Z_2 field operations
0035   inline Int_t add(Int_t x, Int_t y) const { return (x+y)%2; }
0036   inline Int_t mul(Int_t x, Int_t y) const { return (x*y)%2; }
0037   inline Int_t sub(Int_t x, Int_t y) const { return add(x,y); }
0038 private:
0039   Int_t *_nextq;
0040   Int_t _sequenceCount;
0041 
0042   static bool _coefsCalculated;
0043   static Int_t _cj[NBits][MaxDimension];
0044   static const Int_t _primitivePoly[MaxDimension+1][MaxPrimitiveDegree+1];
0045   static const Int_t _polyDegree[MaxDimension+1];
0046 
0047   ClassDef(RooQuasiRandomGenerator,0) // Quasi-random number generator
0048 };
0049 
0050 #endif
0051 
0052