CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RandomEngineGlue.cc
Go to the documentation of this file.
1 #include <string>
2 
3 #include <CLHEP/Random/RandomEngine.h>
4 
5 #include <ThePEG/Interface/ClassDocumentation.h>
6 #include <ThePEG/Interface/InterfacedBase.h>
7 #include <ThePEG/Interface/Parameter.h>
8 #include <ThePEG/Utilities/ClassTraits.h>
9 
10 #include <ThePEG/Repository/StandardRandom.h>
11 
13 
15 
16 using namespace ThePEG;
17 
20 {
21 }
22 
24 {
25 }
26 
28 {
29  RandomGenerator::flush();
30  gaussSaved = false;
31 }
32 
34 {
35  nextNumber = theNumbers.begin();
36  for(RndVector::iterator it = nextNumber; it != theNumbers.end(); ++it)
37  *it = randomEngine->flat();
38 }
39 
41 {
42  // we ignore this, CMSSW overrides the seed from ThePEG
43 }
44 
45 void RandomEngineGlue::doinit() throw(InitException)
46 {
47  RandomGenerator::doinit();
48 
49  boost::shared_ptr<Proxy> proxy = Proxy::find(proxyID);
50  if (!proxy)
51  throw InitException();
52 
53  proxy->instance = this;
54  flush();
55 }
56 
57 ClassDescription<RandomEngineGlue> RandomEngineGlue::initRandomEngineGlue;
58 
60  typedef Proxy::ProxyID ProxyID;
61 
62  static ClassDocumentation<RandomEngineGlue> documentation
63  ("Interface to the CMSSW RandomNumberEngine.");
64  static Parameter<RandomEngineGlue, ProxyID> interfaceProxyID
65  ("ProxyID", "The ProxyID.",
66  &RandomEngineGlue::proxyID, ProxyID(),
67  ProxyID(), ProxyID(), false, false, false);
68 
69  interfaceProxyID.rank(11);
70 }
CLHEP::HepRandomEngine & getEngineReference()
CLHEP::HepRandomEngine * randomEngine
Definition: RandomP8.cc:5
static boost::shared_ptr< Proxy > find(ProxyID id)
Definition: Proxy.h:46
virtual void setSeed(long seed)
unsigned long ProxyID
Definition: Proxy.h:16
CLHEP::HepRandomEngine * randomEngine
static ClassDescription< RandomEngineGlue > initRandomEngineGlue