Random draw according to a probability distribution in a histogram

Hi everyone !

I have a histogram with a variable A in the x-axis and a probability density P(A) in the y-axis.

I need to draw randomly some value of A according to the distribution of P(A).
Do you have any idea to do this ?

Florian

Hi Florian,

the method you are looking for is TH1::GetRandom.

Cheers,
D