Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooRandom.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: RooRandom.h,v 1.9 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_RANDOM
0017 #define ROO_RANDOM
0018 
0019 #include "Rtypes.h"
0020 #include "TRandom.h"
0021 
0022 class RooQuasiRandomGenerator;
0023 
0024 class RooRandom {
0025 public:
0026 
0027   virtual ~RooRandom() {} ;
0028 
0029   static TRandom *randomGenerator();
0030   static void setRandomGenerator(TRandom* gen);
0031   static double uniform(TRandom *generator= randomGenerator());
0032   static void uniform(UInt_t dimension, double vector[], TRandom *generator= randomGenerator());
0033   static UInt_t integer(UInt_t max, TRandom *generator= randomGenerator());
0034   static double gaussian(TRandom *generator= randomGenerator());
0035 
0036   static RooQuasiRandomGenerator *quasiGenerator();
0037   static bool quasi(UInt_t dimension, double vector[],
0038             RooQuasiRandomGenerator *generator= quasiGenerator());
0039 
0040 private:
0041   RooRandom();
0042 
0043   static TRandom* _theGenerator; ///< random number generator
0044   static RooQuasiRandomGenerator* _theQuasiGenerator; ///< quasi random number sequence generator
0045 
0046   // free resources when library is unloaded
0047   struct Guard { ~Guard(); };
0048   static struct Guard guard;
0049   friend struct RooRandom::Guard;
0050 
0051   ClassDef(RooRandom,0) // Random number generator interface
0052 };
0053 
0054 #endif