Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/mathcore:$Id$
0002 // Author: Rene Brun   04/03/99
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TRandom1
0013 #define ROOT_TRandom1
0014 
0015 
0016 
0017 //////////////////////////////////////////////////////////////////////////
0018 //                                                                      //
0019 // TRandom1                                                             //
0020 //                                                                      //
0021 // Ranlux random number generator class (periodicity > 10**14)          //
0022 //                                                                      //
0023 //////////////////////////////////////////////////////////////////////////
0024 
0025 #include "TRandom.h"
0026 
0027 class TRandom1 : public TRandom {
0028 
0029 protected:
0030   Int_t           fNskip;
0031   Int_t           fLuxury;
0032   Int_t           fIlag;
0033   Int_t           fJlag;
0034   Int_t           fCount24;
0035   Float_t         fFloatSeedTable[24];
0036   Float_t         fCarry;
0037   const Int_t     fIntModulus;
0038   static Int_t    fgNumEngines;
0039   static Int_t    fgMaxIndex;
0040   const UInt_t   *fTheSeeds;           //! Temporary array of seed values (transient)
0041   const Double_t  fMantissaBit24;
0042   const Double_t  fMantissaBit12;
0043 
0044 public:
0045    TRandom1();
0046    TRandom1(UInt_t seed, Int_t lux = 3);
0047    TRandom1(Int_t rowIndex, Int_t colIndex, Int_t lux);
0048    ~TRandom1() override;
0049    /////////////////////////////////////////////////////////////////////////////
0050    /// Returns current luxury value.
0051    virtual Int_t GetLuxury() const {return fLuxury;}
0052    /////////////////////////////////////////////////////////////////////////////
0053    /// Returns the current seed (first element of the seed table)
0054    /// \warning This is not the initial seed!
0055    UInt_t GetSeed() const override { return  UInt_t ( fFloatSeedTable[0] /  fMantissaBit24 ) ; }
0056    /////////////////////////////////////////////////////////////////////////////
0057    /// Returns the pointer to the current seeds array.
0058    const UInt_t *GetTheSeeds() const {return fTheSeeds;}
0059    /////////////////////////////////////////////////////////////////////////////
0060    /// Returns an array of seed values stored in the table, given the index.
0061    static void GetTableSeeds(UInt_t *seeds, Int_t index);
0062    using TRandom::Rndm;
0063    Double_t Rndm() override;
0064    void RndmArray(Int_t size, Float_t *vect) override;
0065    void RndmArray(Int_t size, Double_t *vect) override;
0066    virtual void SetSeed2(UInt_t seed, Int_t lux = 3);
0067    // Sets the state of the algorithm according to seed.
0068    virtual void SetSeeds(const UInt_t *seeds, Int_t lux = 3);
0069    // Sets the state of the algorithm according to the zero terminated
0070    // array of seeds. Only the first seed is used.
0071    void SetSeed(ULong_t seed) override;
0072 
0073    ClassDefOverride(TRandom1,2)  //Ranlux Random number generators with periodicity > 10**14
0074 };
0075 
0076 R__EXTERN TRandom *gRandom;
0077 
0078 #endif