Re: [ROOTTALK] TH1::FillRandom(TH1 *h, Int_t ntimes)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat May 15 1999 - 10:57:01 MEST


Hi Gerco,
In my development version 2.22, I have made extensive changes to
this function. As you say the PRO version assumes the same binning
for the source and destination histograms.
The new version implements a set of new functions TH1::GetRandom
to return a random number from a 1-d, 2-d, 3-d histogram.
The old TH1::FillRandom has been rewritten to use this new function.

Rene Brun

On Fri, 14 May 1999, Gerco Onderwater wrote:

> Hi All once more,
> 
> When I create a histo h1 and try to fill it randomly by using
> TH1::FillRandom(h2, ntimes), it is quietly assumed that h1 and h2 have the
> same the binning, axis-ranges etc.; only the dimension is checked. If both
> histogram definitions don't happen to be the same, the result can be
> anything! After having a look at the code, it seems to me that this can be
> solved without too much trouble, by putting in a few checks. However, it
> would be more elegant to allow them to be different, so that e.g. the
> effect of binning can be checked without too much trouble (rebinning would
> do the same, I know ...). The integrating part should then explicitly work
> on h2 and the "AddBinContent(bin)" should become a "Fill(x,y,z)" or so.  
> 
> have a nice weekend,
> 
> -- Gerco
> 
> Dr. C.J.G. Onderwater
> Nuclear Physics Laboratory
> 312 Loomis Laboratory of Physics
> University of Illinois at Urbana-Champaign
> 1110 West Green Street
> Urbana, IL 61801-3080     
> Phone : (217) 244-7363
> Fax   : (217) 333-1215  
> E-mail: onderwat@uiuc.edu
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:33 MET