Dear experts,
I am using TRandom to generate a random number and am using pyROOT.
R = TRandom()
rndm = R.Uniform(1)
print rndm
However, the output of the print statement is always 0.154300153255.
Am I making some obvious mistake here?
Thanks in advance,
Tanvi
This is problably because you always use the same seed. Try to do
R = TRandom(time.gmtime(0))
Note that, if you really want it random, you MUST use seed = 0 (e.g. gRandom->SetSeed(0);
).
system
Closed
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.