TRandom methods

From: ZVYAGIN (ZVYAGIN@mx.ihep.su)
Date: Tue Jan 18 2000 - 11:24:17 MET


Dear ROOTers,

I have a couple of questions about methods of TRandom class.

These are declarations from class TRandom

virtual Float_t Gaus      (Float_t mean = 0, Float_t sigma = 1)
virtual Float_t Landau    (Float_t mean = 0, Float_t sigma = 1)
virtual Int_t   Poisson   (Float_t mean)
virtual void    Rannor    (Float_t& a, Float_t& b)
virtual Float_t Rndm      (Int_t i = 0)

The first question: why all this methods are not 'static' ones? It will be 
much simpler to use code

double r = TRandom::Gaus();  // Very simple and clear. Like in CLHEP

then 

TRandom rndm;
double r = rndm.Gaus();

May be it is better to have static function (like in class TMath) plus 
method for setting user-defined engine of random generator instead of 
single virtual function?

The second question. Are there any problems that prevents using Double_t 
type instead of Float_t? The code I have requires double type and can not 
work with Float_t. (That is why I use CLHEP instead of ROOT for 
generating random numbers.)

P.S. The keyword 'static' is not present on generated HTML documentation.
Take a look on http://root.cern.ch/root/html/TMath.html (you will not 
find 'static' keyword) and then on $ROOTSYS/TMath.h.

With best wishes,
Alexander.



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:17 MET