I’ve been trying to use the TMath::IsInside(Float_t px, Float_t py, Int_t np, Float_t* x, Float_t* y) function but its always returning false for me. Here is a link that references the definition of the function: TMath
I wrote my code in this file: thresholdPlots.cpp (10.0 KB) , where the TMath::IsInside() function is used on line 93.
Point (4200; 120) lays outside the signalBox
Point (4200; 125) lays outside the signalBox
Point (4200; 130) lays outside the signalBox
Point (4200; 135) lays outside the signalBox
Point (4200; 140) lays inside the signalBox
Point (4200; 145) lays inside the signalBox
Point (4200; 150) lays inside the signalBox
This is exactly what I expected with these test values. Can you confirm this quick test of mine works fine for you, too (I’m on ROOT 6.14/04)?
Apologies for the late reply, I ran your test and it passed all the test cases. Thank you for your help. I guess there is a bug in my code that I’m not seeing.
If the values are such that the else if returns true, then the following if will never return true. You have probably mixed up Pi0Pt and Pi0RecZ in either the else if or in the if condition.