Graphical line cut

Hi rooters,

I would like to do a cut on a scatter plot and/or 2d histogram with a line that is not a straight line.
For this reason I would really like to create it with a graphical cut but as far as I know the TCutG has to be a closed poly-line.

Do you have any idea?

Many thanks in advance!


ROOT Version: 6.08.06
Platform: Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
Compiler: gcc version 4.9.2


Hi,
If nobody else can give you a hint, our graphics expert @couet will give you an answer as soon as he’s back from vacation

Hi,
how is your “not a straight line” defined?

The line m u s t be closed, otherwise points would “leak out”
Each line can be approximated by a polyline (to any accuracy)
Special cases (circle, ellipse…) should be straightforward.
Otto

1 Like

I would like to do a sort of steps cut.
More in detail my problem is that I can create a cut from a graph/2Dhisto done with a certain (i.e. smaller) energy range but then I want to apply such cut on a more extended energy range so I cannot close the poly-line around the population I see in the first plot because the real data distribution is more extended in energy…
The idea is to draw a line and select all data below such line but the line cannot be straight and this makes it more complicated to be realized with a TCut like x<x0

You can close the polygon (last point = 1st point) but that’s not mandatory. If it is not closed TCutG will do it for you. Then, when the cut is applied, the inside of the polygon will be consider as 'true" and the outside as 'false".

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