Hi, I am new to ROOT, and I was learning how to use TRandom3. All I want to do is see how it works, and if I can generate some random numbers. I tried the following two codes:
TRandom3 rand(0);
for (Int_t i = 0; i<10; i++){
Double_t ran = rand.Rndm();
Double_t ran1 = rand.Rndm();
cout<<ran<<endl;
cout<<ran1<<endl;
}
}
When I run it, it works fine.
Then, I made a slight modification to and had the following:
TRandom3 rand(0);
for (Int_t i = 0; i<10; i++){
Double_t ran = rand.gaus(1,5);
Double_t ran1 = rand.gaus(2,6);
cout<<ran<<endl;
cout<<ran1<<endl;
}
}
The second code does not work and gives the error:
Error: Can’t call TRandom3::gaus(1,5) in current scope randomnum1.C:21:
Possible candidates are…
(in TRandom3)
(in TRandom)
*** Interpreter error recovered ***
Could anyone help me understand why the second code does not work?
ROOT Version: 5.18
Platform: Ubuntu
Compiler: Not Provided