Hi guys.
I am trying to generate random numbers using a specific seed. Was toying around with the code a bit to see if I can get the same numbers if I use the same seed for RooRandom::randomGenerator->Gaus(mean, sigma) and gRandom->Gaus(mean, sigma). Just wanted to find out what the difference between the two is because I dont get the same numbers even if I do
RooRandom::randomGenerator->SetSeed(seed)
and
gRandom->SetSeed(seed)
Here is a sample of the code that I am using:
while(1) {
xgen = gRandom->Gaus(gaus->x,gaus->sigma);
// xgen = gaus->x + gaus->sigma *result;
if (xgen<gaus->mean.max() && xgen>gaus->mean.min()) {
gaus->mean = xgen ;
cout << "Gaussian -> "<< xgen << endl;
break;
}
}
or
while(1) {
cout << "this is the seed "<< gRandom->fSeed << endl;
xgen = RooRandom::randomGenerator()->Gaus(gaus->x,gaus->sigma);
// xgen = gaus->x + gaus->sigma *result;
if (xgen<gaus->mean.max() && xgen>gaus->mean.min()) {
gaus->mean = xgen ;
cout << "Gaussian -> "<< xgen << endl;
break;
}
}
Thanks in advance