Generating random series in loop

Dear all,
I have a problem generating series of random numbers in loop. I need to generate random numbers which I am filling to histogram, but they should be different every time the loop is running, so I need to run a kind of pseudo-experiments (the output should be lets say 10 000 slightly different histograms). I tried setting different seed with each cycle but it is generating the same histogram every time. Could you please offer a solution?
Thank you !

Just continue using the same random number generator. If this makes no sense then we need to see code that reproduces the issue.

Here is example how I generate histograms, but the output is 10 000 exactly the same histograms

//some code
TRandom3 rn;
for(int i=0;i<10000;i++)
{
//here I generate 10 000 histograms with 5000 entries
for(int j=0;j<5000;j++)
{
double rand=rn.Uniform(1);
h1->Fill(rand);
}
//some code
}
//

Where do you declare h1?

I finally found it, the issue was causing other part of the code.
Thank you for your help Axel !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.