Dear Root-Experts,
(Root 5.22/00)
I would like to report a behavior of TRandom3::SetSeed(UInt_t seed = 0) in interpreted mode, which I didn’t expect. I am not sure if this is a bug or a feature.
The following macro demonstrates the problem:
#include <TRandom3.h>
#include <iostream>
void RandomTest(){
//
TRandom3 * randomGen = new TRandom3(0);
//
randomGen->SetSeed(0);
cout<<" seed1: "<< randomGen->GetSeed()<<endl;
//
randomGen->SetSeed();
cout<<" seed2: "<< randomGen->GetSeed()<<endl;
//
}
The expected output looks like this:
root RandomTest.C++
root [0]
Processing RandomTest.C++...
Info in <TUnixSystem::ACLiC>: creating shared library /misc/home/he/aadametz/./RandomTest_C.so
seed1: 1249051090
seed2: 1249051090
But when the macro is run in interpreted mode
~> root RandomTest.C
root [0]
Processing RandomTest.C...
seed1: 1249051092
seed2: 65539
seed2 is 65539, which is the default value in TRandom::SetSeed(UInt_t seed = 65539).
So somehow the SetSeed method of TRandom is picked up, instead of the TRandom3-version, when SetSeed() is used without explicitly specified argument.
Best regards,
Aleks