Get random number from a negative binomial

Hi everyone,

I’m looking for how to get random numbers from a negative binomial distribution.
I fond that: root.cern.ch/root/html/ROOT__Ma … ngMT_.html
but I dont understand how to use it.

Thanks

Quentin

Hi,

with the doxygen doc it might be clearer.
The random generator is a templated class and its template argument is an engine:
o root.cern.ch/doc/master/classRO … andom.html
o root.cern.ch/doc/master/classRO … ngine.html

So you can, e.g., instantiate a generator and invoke its methods as follows:

root [0] ROOT::Math::Random<ROOT::Math::GSLRngMT> myGen;
root [1] myGen.SetSeed(123)
root [2] myGen.Gaus(1,2)
(double) 5.79768

Cheers,
Danilo