Hello,
I have a some fairly coarsely distributed points in a TGraph 2D, and I’d like to use a simple interpolation (linear is fine) then pull random points from the result - along the lines of the GetRandom2 method in TH2, but using the interpolation.
Any suggestions on how to do this?
thanks!
Thanks - but I was hoping to draw points with a probability based on the (interpolated) z-axis value. I can always hack something together based on your suggestion, but wondered if this functionality already existed for TGraph2D - the interpolation etc is already there.
TGraph2D does not have the GetRandom2 method like TH2. But it has GetHistogram which returns a TH2D produced thanks to the Delaunay triangles of the TGraph2D. So you can use GetRandom2 on the TH2D returned by GetHistogram.