When creating a TCutG are points on the boundaries considered inside or outside?
I created some tcutg and then use the points defining the tcutg to test whether they are inside or out and it seems that the condition is marked as true only in some cases. Looking at the source for IsInside I believe that the if statement checking the x position should have a less than or equal sign not just less than for the case that y[i] == yp.
if (x[i]+(yp-y[i])/(y[j]-y[i])*(x[j]-x[i])<=xp) {
template <typename T> Bool_t TMath::IsInside(T xp, T yp, Int_t np, T *x, T *y)
{
// Function which returns kTRUE if point xp,yp lies inside the
// polygon defined by the np points in arrays x and y, kFALSE otherwise.
// Note that the polygon may be open or closed.
Int_t i, j = np-1 ;
Bool_t oddNodes = kFALSE;
for (i=0; i<np; i++) {
if ((y[i]<yp && y[j]>=yp) || (y[j]<yp && y[i]>=yp)) {
if (x[i]+(yp-y[i])/(y[j]-y[i])*(x[j]-x[i])<=xp) {
oddNodes = !oddNodes;
}
}
j=i;
}
return oddNodes;
}