Dear ROOTers,
May be it will be good to add new constructor/function in TRandom class for
'random' initialization of seed number.
The code is below. It assumed that sizeof(time_t)<=sizeof(fSeed).
class TRandom : public TNamed
{
TRandom(UInt_t seed=65539);
....
};
#include <time.h>
TRandom::TRandom(UInt_t seed): TNamed("Random","Default Random number
generator") {
//*-*-*-*-*-*-*-*-*-*-*default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-* ===================
if( seed==0 ) // Set 'random' seed number if seed=0
time(&fSeed); // Get current time in fSeed.
else
fSeed = seed;
}
With best wishes,
Alexander