ThePEG  1.8.0
StandardRandom.h
1 // -*- C++ -*-
2 //
3 // StandardRandom.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_StandardRandom_H
10 #define ThePEG_StandardRandom_H
11 // This is the declaration of the StandardRandom class.
12 
13 #include "RandomGenerator.h"
14 #include "ThePEG/Persistency/PersistentOStream.h"
15 #include "ThePEG/Persistency/PersistentIStream.h"
16 
17 namespace ThePEG {
18 
27 
28 public:
29 
35  StandardRandom() : u(97) { if ( theSeed != 0 ) setSeed(theSeed); }
37 
38 public:
39 
44  virtual void setSeed(long seed);
45 
46 protected:
47 
51  virtual void fill();
52 
53 public:
54 
55 
62  void persistentOutput(PersistentOStream & os) const;
63 
69  void persistentInput(PersistentIStream & is, int version);
71 
75  static void Init();
76 
77 protected:
78 
85  virtual IBPtr clone() const;
86 
91  virtual IBPtr fullclone() const;
93 
94 private:
95 
99  vector<double> u;
100 
104  double c;
105 
109  double cd;
110 
114  double cm;
115 
119  int i97;
120 
124  int j97;
125 
126 private:
127 
132 
137 
138 };
139 
144 template <>
147  typedef RandomGenerator NthBase;
148 };
149 
152 template <>
153 struct ClassTraits<StandardRandom>: public ClassTraitsBase<StandardRandom> {
155  static string className() { return "ThePEG::StandardRandom"; }
156 };
157 
160 }
161 
162 #endif /* ThePEG_StandardRandom_H */