ROOT logo
#ifndef HSEED_H
#define HSEED_H

#include "TObject.h"
#include "TString.h"
#include "TRandom3.h"


class HSeed : public TObject {

private:
    Int_t     fMethod;        //   0 (default) : /dev/random,
                              //   1 : TRandom3 (local) with systime ,
                              //   2 : TRandom3 (local) with systime + processid + iplast,
                              //   3 : like 1 but gRandom,
                              //   4 : like 2 but gRandom,
                              //   5 : fixed (needs seed to be set)
    Int_t     fFallBack;      //  case /dev/random is not available : default 2
    Bool_t    fNoBlock;       //   default kTRUE switch /dev/radom to /dev/urandom  to avoid blocking (less randomness!)

    Int_t     fFixedSeed  ;   //   default -1  setFixedSeed()
    Int_t     fInitialSeed;   //   default -1, stores the seed input gRandom
    Int_t     fFirstSeed;     //   default -1, stores the first seed generated
    TString   fHostname;      //   hostname of execution
    UInt_t    fAddress;       //   4 * 8bit address fields
    UInt_t    fPid;           //   process id
    TRandom3  fGenerator;     //!
    Int_t     fFileHandle;    //!  filehandle for /dev/random
    TRandom*  frandom;        //!  pointer to use generator
public:
    HSeed(Int_t method=0,Int_t fallback=2,Int_t fixedseed=-1, Bool_t noBlock = kTRUE) ;
    ~HSeed();
    UInt_t  getPid();
    UInt_t  getIP();
    UInt_t  getIPPart(UInt_t field=0);
    Int_t   getSeed();

    Int_t   getMethod()      { return fMethod;     }
    Int_t   getFallBack()    { return fFallBack;   }

    Int_t   getFixedSeed()   { return fInitialSeed;}
    Int_t   getInitialSeed() { return fInitialSeed;}
    Int_t   getFirstSeed()   { return fFirstSeed;  }

    TString getHostName()    { return fHostname;   }
    UInt_t  getAddress()     { return fAddress;    }

    void    print();

    ClassDef(HSeed,1)
};


#endif   /*! HSEED_H */
 hseed.h:1
 hseed.h:2
 hseed.h:3
 hseed.h:4
 hseed.h:5
 hseed.h:6
 hseed.h:7
 hseed.h:8
 hseed.h:9
 hseed.h:10
 hseed.h:11
 hseed.h:12
 hseed.h:13
 hseed.h:14
 hseed.h:15
 hseed.h:16
 hseed.h:17
 hseed.h:18
 hseed.h:19
 hseed.h:20
 hseed.h:21
 hseed.h:22
 hseed.h:23
 hseed.h:24
 hseed.h:25
 hseed.h:26
 hseed.h:27
 hseed.h:28
 hseed.h:29
 hseed.h:30
 hseed.h:31
 hseed.h:32
 hseed.h:33
 hseed.h:34
 hseed.h:35
 hseed.h:36
 hseed.h:37
 hseed.h:38
 hseed.h:39
 hseed.h:40
 hseed.h:41
 hseed.h:42
 hseed.h:43
 hseed.h:44
 hseed.h:45
 hseed.h:46
 hseed.h:47
 hseed.h:48
 hseed.h:49
 hseed.h:50
 hseed.h:51
 hseed.h:52
 hseed.h:53
 hseed.h:54