I have a ROOT application which uses
TCutG* cutg=(TCutG*)gPad->WaitPrimitive(“CUTG”,“CutG”);
in a canvas with a single 2D histogram so that I can use the graphics editor to draw a polygon with left mouse clicks, and close it with a double click or a left mouse click near the start point.
I find the polygon closes prematurely unless I draw a really large one.
The behaviour seems independent of the binning, but it is worse when used on a divided canvas.
Sometimes however, it works OK, but I have not been able to make it work to reliably draw small polygon ROIs.
Apart from this problem, the cut works quite OK when looping over events in the nTuple.
When I use this source file … applying the TCutg technology to another 2D histogram … it works quite fine … and I don’t see really any reason why it works in this case and not in the previous case.
Dear all,
I can reproduce Simons issue with my example macro.
The problem is in TCreatePromitives::Polyline.
The condition for “Terminate polyline” is calculated from
user coordinates instead of Pixels, so if the cut has all points more then 0.007
apart it works otherwise not.
Note the whole range of the X an Y axis of Target_pos is only -0.005 - 0.005
sorry, my post was too terse:
I modified the macro to use Simons histogram, both now in attachment
Cheers
Otto target_pos.root (14.1 KB) wait_tcutg.C (1.04 KB)
I checked the part of TCreatePrimitives.cxx you pointed. You are right that hardcoded value “0.07” is the problem. I need now to find the best way to fix it.