18 #define NUMBER_OF_SEEDS 1 21 #define HEPRNDM_HEPRNDMENGINES_CPP 37 #include "CLHEP/Random/DRand48Engine.h" 38 #include "CLHEP/Random/DualRand.h" 39 #include "CLHEP/Random/Hurd160Engine.h" 40 #include "CLHEP/Random/Hurd288Engine.h" 41 #include "CLHEP/Random/JamesRandom.h" 42 #include "CLHEP/Random/MTwistEngine.h" 43 #include "CLHEP/Random/RanecuEngine.h" 44 #include "CLHEP/Random/Ranlux64Engine.h" 45 #include "CLHEP/Random/RanluxEngine.h" 46 #include "CLHEP/Random/RanshiEngine.h" 47 #include "CLHEP/Random/TripleRand.h" 53 using namespace CLHEP;
62 auto& seeds = m_seeds.value();
65 if ( m_seeds.size() == 0 ) {
67 long theSeed = 1234567;
68 seeds.push_back( theSeed );
75 if ( m_row > 214 || m_col > 1 ) {
76 error() <<
"Generator engine seed table has dimension [215][2], you gave:" 77 <<
" Row=" << m_row <<
" Column:" << m_col <<
endmsg;
80 info() <<
"Generator engine seeds from table." 81 <<
" Row=" << m_row <<
" Column:" << m_col <<
endmsg;
84 info() <<
"Current Seed:" << hepEngine()->getSeed();
85 info() <<
" Luxury:" << m_lux.value();
88 if ( m_setSingleton ) {
89 HepRandom::setTheEngine( hepEngine() );
90 info() <<
"This is the GEANT4 engine!" <<
endmsg;
102 m_seeds.value().clear();
103 return BaseEngine::finalize();
107 template <
class TYPE>
110 auto& seeds = m_seeds.value();
113 if ( !seeds.empty() ) {
114 if ( seeds.back() != 0 ) {
115 seeds.push_back( 0 );
117 hepEngine()->setSeeds( &seeds[0], m_lux );
124 template <
class TYPE>
137 seed.
push_back( hepEngine()->getSeed() );
145 return m_useTable ? std::make_unique<DualRand>( m_row, m_col ) : std::make_unique<DualRand>( m_seeds[0] );
151 return m_useTable ? std::make_unique<TripleRand>( m_row, m_col ) : std::make_unique<TripleRand>( m_seeds[0] );
157 return m_useTable ? std::make_unique<DRand48Engine>( m_row, m_col ) : std::make_unique<DRand48Engine>( m_seeds[0] );
163 return m_useTable ? std::make_unique<Hurd160Engine>( m_row, m_col ) : std::make_unique<Hurd160Engine>( m_seeds[0] );
169 return m_useTable ? std::make_unique<Hurd288Engine>( m_row, m_col ) : std::make_unique<Hurd288Engine>( m_seeds[0] );
175 return m_useTable ? std::make_unique<RanecuEngine>( m_row ) : std::make_unique<RanecuEngine>( m_seeds[0] );
181 return m_useTable ? std::make_unique<RanshiEngine>( m_row, m_col ) : std::make_unique<RanshiEngine>( m_seeds[0] );
187 return m_useTable ? std::make_unique<RanluxEngine>( m_row, m_col, m_lux )
188 : std::make_unique<RanluxEngine>( m_seeds[0], m_lux );
194 return m_useTable ? std::make_unique<Ranlux64Engine>( m_row, m_col, m_lux )
195 : std::make_unique<Ranlux64Engine>( m_seeds[0], m_lux );
201 return m_useTable ? std::make_unique<MTwistEngine>( m_row, m_col ) : std::make_unique<MTwistEngine>( m_seeds[0] );
207 return m_useTable ? std::make_unique<HepJamesRandom>( m_row, m_col )
208 : std::make_unique<HepJamesRandom>( m_seeds[0] );
constexpr static const auto FAILURE
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
HepRndm::Engine< DualRand > e1
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
StatusCode initialize() override
Service override: initialization.
constexpr static const auto SUCCESS
T back_inserter(T...args)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.