Re: Random numbers

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Sep 23 1997 - 17:38:45 MEST


Nick van Eijndhoven wrote:
> 
> Dear all,
> Is there a facility within ROOT to obtain random numbers via a user
> defined function ?
> A scenario of filling first a histo according to some function and then
> obtain random numbers according to that hist would do fine for the moment.
> However, some facility to provide a function pointer of a user defined function
> and then be able to retrieve random numbers from that would of course be
> nicer. Maybe something like the fitting of user functions to a histo could
> be provided for class TRandom ?
> 

You can use TH1::FillRandom. (see the fillrandom tutorial).
Fill Random fills an histogram from a user definer function.
I intend to extend the TF1 and TF2 classes to return random numbers
from any type of functions. This is in the pipeline.

Rene Brun



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