18 #define NUMBER_OF_SEEDS 1
21 #define HEPRNDM_HEPRNDMENGINES_CPP
37 #include "CLHEP/Random/DualRand.h"
38 #include "CLHEP/Random/TripleRand.h"
39 #include "CLHEP/Random/DRand48Engine.h"
40 #include "CLHEP/Random/Hurd160Engine.h"
41 #include "CLHEP/Random/Hurd288Engine.h"
42 #include "CLHEP/Random/JamesRandom.h"
43 #include "CLHEP/Random/MTwistEngine.h"
44 #include "CLHEP/Random/RanecuEngine.h"
45 #include "CLHEP/Random/Ranlux64Engine.h"
46 #include "CLHEP/Random/RanluxEngine.h"
47 #include "CLHEP/Random/RanshiEngine.h"
51 using namespace CLHEP;
68 m_seeds.erase(m_seeds.begin(), m_seeds.end());
70 if ( m_seeds.size() == 0 ) {
72 long theSeed = 1234567;
73 m_seeds.push_back(theSeed);
78 info() <<
"Generator engine type:"
82 if ( m_row > 214 || m_col > 1 ) {
83 error() <<
"Generator engine seed table has dimension [215][2], you gave:"
84 <<
" Row=" << m_row <<
" Column:" << m_col <<
endmsg;
88 info() <<
"Generator engine seeds from table."
89 <<
" Row=" << m_row <<
" Column:" << m_col <<
endmsg;
92 info() <<
"Current Seed:" << hepEngine()->getSeed();
93 info() <<
" Luxury:" << m_lux;
96 if ( m_setSingleton ) {
97 HepRandom::setTheEngine(hepEngine());
98 info() <<
"This is the GEANT4 engine!" <<
endmsg;
102 error() <<
"Cannot initialze random engine of type:"
118 if ( !m_seeds.empty() ) {
119 if ( m_seeds.back() != 0 ) {
120 m_seeds.push_back(0);
122 hepEngine()->setSeeds(&m_seeds[0], m_lux);
147 :
new DualRand(m_seeds[0]) );
152 :
new TripleRand(m_seeds[0]));
157 :
new DRand48Engine(m_seeds[0]));
162 :
new Hurd160Engine(m_seeds[0]));
167 :
new Hurd288Engine(m_seeds[0]));
172 :
new RanecuEngine(m_seeds[0]));
177 :
new RanshiEngine(m_seeds[0]));
182 :
new RanluxEngine(m_seeds[0], m_lux));
187 :
new Ranlux64Engine(m_seeds[0], m_lux));
192 :
new MTwistEngine(m_seeds[0]));
197 :
new HepJamesRandom(m_seeds[0]) );
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode finalize() override
Service override: finalization.
StatusCode seeds(std::vector< long > &seed) const override
Retrieve seeds.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
bool isSuccess() const
Test for a status code of SUCCESS.
std::vector< long > m_seeds
HepRndm::Engine< DualRand > e1
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
Finalize the Engine.
This class is used for returning status codes from appropriate routines.
std::unique_ptr< CLHEP::HepRandomEngine > createEngine() override
Create new HepEngine....
T back_inserter(T...args)
StatusCode setSeeds(const std::vector< long > &seed) override
Set seeds.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
virtual StatusCode initialize()
Service override: initialization.
StatusCode initialize() override
Initialize the Engine.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.