The random seeds are clear during the initialization of HepRndmEngines
Dear Gaudi Developers,
I am Tao Lin from IHEP, Beijing.
I want to set the random seeds in Python script directly. Following is my code:
seed = [42]
rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_("RndmGenSvc.Engine", Seeds=seed, OutputLevel=DEBUG)
rndmengine.Seeds = seed
rndmengine.Luxury = 6
rndmengine.SetSingleton = True
But the problem is that seed in the output is always 1234567.
Then I find the seeds are always clear (https://gitlab.cern.ch/gaudi/Gaudi/-/blob/master/GaudiSvc/src/RndmGenSvc/HepRndmEngines.cpp#L69):
// Initialize engine
template <class TYPE>
StatusCode Engine<TYPE>::initialize() {
auto& seeds = m_seeds.value();
seeds.clear();
StatusCode status = RndmEngine::initialize();
if ( m_seeds.size() == 0 ) {
// Default seeds
long theSeed = 1234567;
seeds.push_back( theSeed );
seeds.push_back( 0 );
}
So my question is that is this a bug? If this is not a bug, what's the right way to set the random seeds?
Thank you very much!
Tao Lin