Is "IsInside()" different in ROOT 5.22 and 5.34?


I use the condition “TCutG->IsInside(x,y)” in a code, that loops over the data, to select the events inside a polygon cut.

I have used for long time this code in ROOT 5.22.00 i. Recently I updated to ROOT 5.34/18 and I noticed that now, running exactly the same code with exactly the same data, I get ~90% of the events inside the polygon cut! I mean, ~90% of the events that I had running the code in the older ROOT version.

I wonder if the definition of the IsInside() function is different in the two ROOT versions. I am not an expert, but looking in the web I have seen two different IsInside() functions, one working only for closed polygon cuts, and the other one for both open and closed cuts… Anyway, my cuts are always closed.

Or, perhaps, could it be that the treatment of the points on the boundaries of the polygon is changed between the two ROOT versions?

Thank you in advance for any help.


after checking the code in the repository I confirm that the algorithm was improved during the years.
Do you have in hands an example of a polygon and a point for which the algorithms give 2 different answers, i.e. a reproducer? Even better if the new algorithm gives the wrong result.


yes this code was change to be faster and more precise.

Hi all,
thank you for your answers.

Unfortunately I cannot post an example of the different behaviour, because I don’t have the older ROOT version anymore. I can only compare the total number of events inside the cut, and now it is ~ 90% less than before.

Do you know if the two versions of the IsInside() function make a different treatment of the points on the boundaries? This is the only idea that come to my mind in order to explain the different results.

Today I did some other try with the new ROOT and it looks that the new IsInside() function acts correctly. But I would like to understand why the older one was giving more events, e.g., if it was taking wrong events. Unfortunately now I cannot check the old one anymore.

Thank you. Cheers

Yes they behaved differently. The new version should be better.

OK, thanks a lot.