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" 51 using namespace CLHEP;
58 auto& seeds = m_seeds.value();
61 if ( m_seeds.size() == 0 ) {
63 long theSeed = 1234567;
64 seeds.push_back( theSeed );
71 if ( m_row > 214 || m_col > 1 ) {
72 error() <<
"Generator engine seed table has dimension [215][2], you gave:" 73 <<
" Row=" << m_row <<
" Column:" << m_col <<
endmsg;
76 info() <<
"Generator engine seeds from table." 77 <<
" Row=" << m_row <<
" Column:" << m_col <<
endmsg;
80 info() <<
"Current Seed:" << hepEngine()->getSeed();
81 info() <<
" Luxury:" << m_lux.value();
84 if ( m_setSingleton ) {
85 HepRandom::setTheEngine( hepEngine() );
86 info() <<
"This is the GEANT4 engine!" <<
endmsg;
97 m_seeds.value().clear();
98 return BaseEngine::finalize();
102 template <
class TYPE>
104 auto& seeds = m_seeds.value();
107 if ( !seeds.empty() ) {
108 if ( seeds.back() != 0 ) { seeds.push_back( 0 ); }
109 hepEngine()->setSeeds( &seeds[0], m_lux );
116 template <
class TYPE>
128 seed.
push_back( hepEngine()->getSeed() );
135 return m_useTable ? std::make_unique<DualRand>( m_row, m_col ) : std::make_unique<DualRand>( m_seeds[0] );
140 return m_useTable ? std::make_unique<TripleRand>( m_row, m_col ) : std::make_unique<TripleRand>( m_seeds[0] );
145 return m_useTable ? std::make_unique<DRand48Engine>( m_row, m_col ) : std::make_unique<DRand48Engine>( m_seeds[0] );
150 return m_useTable ? std::make_unique<Hurd160Engine>( m_row, m_col ) : std::make_unique<Hurd160Engine>( m_seeds[0] );
155 return m_useTable ? std::make_unique<Hurd288Engine>( m_row, m_col ) : std::make_unique<Hurd288Engine>( m_seeds[0] );
160 return m_useTable ? std::make_unique<RanecuEngine>( m_row ) : std::make_unique<RanecuEngine>( m_seeds[0] );
165 return m_useTable ? std::make_unique<RanshiEngine>( m_row, m_col ) : std::make_unique<RanshiEngine>( m_seeds[0] );
170 return m_useTable ? std::make_unique<RanluxEngine>( m_row, m_col, m_lux )
171 : std::make_unique<RanluxEngine>( m_seeds[0], m_lux );
176 return m_useTable ? std::make_unique<Ranlux64Engine>( m_row, m_col, m_lux )
177 : std::make_unique<Ranlux64Engine>( m_seeds[0], m_lux );
182 return m_useTable ? std::make_unique<MTwistEngine>( m_row, m_col ) : std::make_unique<MTwistEngine>( m_seeds[0] );
187 return m_useTable ? std::make_unique<HepJamesRandom>( m_row, m_col )
188 : std::make_unique<HepJamesRandom>( m_seeds[0] );
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
constexpr static const auto SUCCESS
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.
T back_inserter(T...args)
constexpr static const auto FAILURE
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.