168 const Char_t* axis =
"")
const;
203 distance = dist2 = 9999.;
204 Int_t i_nearest_point = 0, inear1 = 0, inear2 = 0;
209 for (i = 0; i <
fNpoints - 1; i++) {
223 inear2 = i + i_nearest_point;
229 if (distance < 9999.)
233 if (inear2 > 0 && inear2 < (
fNpoints - 1))
245 Int_t& i_nearest_point)
268 TVector2 P1(xp1, yp1), P2(xp2, yp2), P(px, py);
275 Double_t sum = (P1P - MP).Mod() + (P2P - MP).Mod();
279 if (P1P.
Mod() < P2P.
Mod()) {
321 TVector2 P1(xp1, yp1), P2(xp2, yp2), P(px, py);
331 if (!strcmp(opt,
"left")) {
332 result = (phi > 90. && phi < 270.);
334 else if (!strcmp(opt,
"right")) {
335 result = (phi < 90. || phi > 270.);
337 else if (!strcmp(opt,
"above")) {
338 result = (phi > 0. && phi < 180.);
340 else if (!strcmp(opt,
"below")) {
341 result = (phi > 180. && phi < 360.);
361 if (!strcmp(opt,
"left")) {
367 else if (!strcmp(opt,
"right")) {
374 else if (!strcmp(opt,
"above")) {
381 else if (!strcmp(opt,
"below")) {
391 Int_t prev_i_stop = 0;
393 while ((i_start < i_stop - 1) || same_sign) {
395 if (same_sign && (prev_i_stop == 0))
break;
396 else if (same_sign) {
398 i_stop = prev_i_stop;
401 prev_i_stop = i_stop;
402 i_stop = (
Int_t)((i_start + i_stop) / 2 + 0.5);
408 Double_t a = (YY[i_stop] - YY[i_start]) / (XX[i_stop] - XX[i_start]);
411 Bool_t res = (sign * yy < sign * (
a * xx +
b));
421 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,0,3)
433 #if ROOT_VERSION_CODE >= ROOT_VERSION(4,0,3)
465 else if (ax ==
"Y") {
469 return (in_range_x && in_range_y);
#define ClassDef(name, id)
Base class for lines/cuts used for particle identification in 2D data maps.
static KVIDLine * MakeIDLine(TObject *obj, Double_t xdeb=-1., Double_t xfin=-1., Double_t np=1., Bool_t save=kFALSE)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Bool_t PosRelToLine(Option_t *opt, Double_t px, Double_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Double_t DistanceToLine(Double_t px, Double_t py, Int_t &)
Bool_t WhereAmI(Double_t px, Double_t py, Option_t *opt)
void GetStartPoint(Double_t &x, Double_t &y) const
Bool_t IsBetweenEndPoints(Double_t x, Double_t y, const Char_t *axis="") const
void GetEndPoint(Double_t &x, Double_t &y) const
virtual void WaitForPrimitive()
Base class for graphical cuts used in particle identification.
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
TVector2 Norm(const TVector2 &v) const
Double_t Min(Double_t a, Double_t b)
Double_t Sign(Double_t a, Double_t b)
Double_t Max(Double_t a, Double_t b)
constexpr Double_t RadToDeg()