How to obtain a smooth cut

Hello everyone,

I’m trying to make a cut to a tree to pick the events of interest.
I used a TCutG to circle the events, but it’s not natural I think, because the edge of these events is not a polygon actually.

So here I want your help to obtain a cut with a smooth edge(not polygon).

Thank you.

There is no constructor for TCutG from functions, it only takes arrays of points. So you have to somehow create arrays (for x and y) with as many points as you need to make them smooth.
A TGraph can be made from a TF1, so you could make a TGraph (note that by default, it is created with 100 points, but you can change that with TF1::SetNpx()) and then take its x and y points as arrays with GetX() and GetY(). However, since TGaph does not take TF2, if you want a circle for example, or closed shapes, you would have to make 2 TGraphs (upper and lower) and concatenate their arrays.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.