CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RandomEngineGlue.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_ThePEGInterface_RandomEngineGlue_h
2 #define GeneratorInterface_ThePEGInterface_RandomEngineGlue_h
3 
4 #include <string>
5 
6 #include <boost/shared_ptr.hpp>
7 
8 #include <ThePEG/Interface/ClassDocumentation.h>
9 #include <ThePEG/Interface/InterfacedBase.h>
10 #include <ThePEG/Interface/Parameter.h>
11 #include <ThePEG/Utilities/ClassTraits.h>
12 
13 #include <ThePEG/Repository/StandardRandom.h>
14 
16 
17 namespace CLHEP {
18  class HepRandomEngine; // forward declaration
19 }
20 
21 namespace ThePEG {
22 
23 class RandomEngineGlue : public RandomGenerator {
24  public:
26  virtual ~RandomEngineGlue();
27 
28  void flush();
29 
30  static void Init();
31 
32  class Proxy : public ThePEG::Proxy<Proxy> {
33  public:
34  RandomEngineGlue *getInstance() const { return instance; }
35 
36  private:
37  friend class RandomEngineGlue;
38  friend class ThePEG::Proxy<Proxy>;
39 
40  inline Proxy(ProxyID id) : Base(id), instance(0) {}
41 
43  };
44 
45  protected:
46  virtual void fill();
47  virtual void setSeed(long seed);
48 
49  virtual IBPtr clone() const { return new_ptr(*this); }
50  virtual IBPtr fullclone() const { return new_ptr(*this); }
51 
52  virtual void doinit() throw(InitException);
53 
54  private:
56  CLHEP::HepRandomEngine *randomEngine;
57 
58  static ClassDescription<RandomEngineGlue> initRandomEngineGlue;
59 };
60 
61 template<>
62 struct BaseClassTrait<RandomEngineGlue, 1> : public ClassTraitsType {
64  typedef RandomGenerator NthBase;
65 };
66 
69 template<>
70 struct ClassTraits<RandomEngineGlue> :
71  public ClassTraitsBase<RandomEngineGlue> {
73  static string className() { return "ThePEG::RandomEngineGlue"; }
74  static string library() { return "libGeneratorInterfaceThePEGInterface.so"; }
75 };
76 
77 } // namespace ThePEG
78 
79 #endif // GeneratorInterface_ThePEGInterface_RandomEngineGlue_h
RandomEngineGlue * getInstance() const
virtual IBPtr clone() const
virtual IBPtr fullclone() const
virtual void setSeed(long seed)
#define private
Definition: FWFileEntry.h:18
unsigned long ProxyID
Definition: Proxy.h:16
def template
Definition: svgfig.py:520
CLHEP::HepRandomEngine * randomEngine
static ClassDescription< RandomEngineGlue > initRandomEngineGlue