Re: Random Numbers revisited.

Pasha Murat (murat@cdfsga.fnal.gov)
Wed, 29 Jul 1998 12:01:47 -0500 (CDT)


Rene Brun writes:
> millerte wrote:
> > In PAW, the corresponding function call was 'hrndm1'. Perhaps one
> > of several solutions exist currently: that functionality is there
> > and I'm blind at reading the class def, a "good" function to fit
> > to my current histogram exists but I'm not clever enough to figure
> > it out, or perhaps this functionality is "in the pipeline"?
> >
> > Thanks for your time,
> > -Tim
>
> Tim,
> This method exists in ROOT.
> TH1 class has 2 methods FillRandom
> void FillRandom(char *fname, Int_t ntimes=5000);
> void FillRandom(TH1 *h, Int_t ntimes=5000);
>
> The 1st starts from a function, the 2nd one from an histogram.
>
> Rene Brun

Hello,
I feel that I am missing something in the discussion above so I'd
appreciate to be given a clarification. Let me explain what exactly I'm
missing:

- what `hrndm1' does it returns a *single* random number distributed
according a probability distribution stored in a given histogram.
- `FillRandom' methods do very different thing - they *fill a histogram*
according to a given probability density stored elsewhere, therefore it seems
to me that they miss functionality of `hrndm1' which is quite often needed by
the users.

So is it possible to generate (and retrieve!) a single random number (set of
numbers) which probability density is stored in a given histogram ?

Thanks, Pasha.