Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
GeneratorInterface
ThePEGInterface
src
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
12
#include "
GeneratorInterface/Core/interface/RNDMEngineAccess.h
"
13
14
#include "
GeneratorInterface/ThePEGInterface/interface/RandomEngineGlue.h
"
15
16
using namespace
ThePEG;
17
18
RandomEngineGlue::RandomEngineGlue
() :
19
randomEngine
(&
gen
::
getEngineReference
())
20
{
21
}
22
23
RandomEngineGlue::~RandomEngineGlue
()
24
{
25
}
26
27
void
RandomEngineGlue::flush
()
28
{
29
RandomGenerator::flush();
30
gaussSaved =
false
;
31
}
32
33
void
RandomEngineGlue::fill
()
34
{
35
nextNumber = theNumbers.begin();
36
for
(RndVector::iterator it = nextNumber; it != theNumbers.end(); ++it)
37
*it =
randomEngine
->flat();
38
}
39
40
void
RandomEngineGlue::setSeed
(
long
seed)
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
59
void
RandomEngineGlue::Init
() {
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
}
ThePEG::RandomEngineGlue::Init
static void Init()
Definition:
RandomEngineGlue.cc:59
relval_steps.gen
def gen
Definition:
relval_steps.py:239
gen::getEngineReference
CLHEP::HepRandomEngine & getEngineReference()
Definition:
RNDMEngineAccess.cc:9
ThePEG::RandomEngineGlue::RandomEngineGlue
RandomEngineGlue()
Definition:
RandomEngineGlue.cc:18
ThePEG::RandomEngineGlue::fill
virtual void fill()
Definition:
RandomEngineGlue.cc:33
ThePEG::RandomEngineGlue::flush
void flush()
Definition:
RandomEngineGlue.cc:27
RNDMEngineAccess.h
RandomEngineGlue.h
randomEngine
CLHEP::HepRandomEngine * randomEngine
Definition:
RandomP8.cc:5
ThePEG::Proxy< Proxy >::find
static boost::shared_ptr< Proxy > find(ProxyID id)
Definition:
Proxy.h:46
ThePEG::RandomEngineGlue::setSeed
virtual void setSeed(long seed)
Definition:
RandomEngineGlue.cc:40
ThePEG::RandomEngineGlue::~RandomEngineGlue
virtual ~RandomEngineGlue()
Definition:
RandomEngineGlue.cc:23
ThePEG::RandomEngineGlue::proxyID
Proxy::ProxyID proxyID
Definition:
RandomEngineGlue.h:55
ThePEG::ProxyBase::ProxyID
unsigned long ProxyID
Definition:
Proxy.h:16
ThePEG::RandomEngineGlue::doinit
virtual void doinit()
Definition:
RandomEngineGlue.cc:45
ThePEG::RandomEngineGlue::randomEngine
CLHEP::HepRandomEngine * randomEngine
Definition:
RandomEngineGlue.h:56
CommPDSkim_cfg.throw
tuple throw
Definition:
CommPDSkim_cfg.py:101
ThePEG::RandomEngineGlue::initRandomEngineGlue
static ClassDescription< RandomEngineGlue > initRandomEngineGlue
Definition:
RandomEngineGlue.h:58
Generated for CMSSW Reference Manual by
1.8.5