CMS 3D CMS Logo

GeneralNSurfaceDelimitedBounds.cc
Go to the documentation of this file.
1 
2 
5 
6 bool GeneralNSurfaceDelimitedBounds::inside(const Local3DPoint& lp, const LocalError& le, float scale) const {
7  // derive on-surface tolerance from LocalError in a very approximate way
8  float tolerance = scale * sqrt(le.xx() * le.xx() + le.yy() * le.yy());
9 
10  return myInside(lp, tolerance);
11 }
12 
14  // cout << "GeneralNSurfaceDelimitedBounds::myInside called with local point " << lp << endl;
15 
17 
18  // cout << "corresponding Global point " << gp << endl;
19 
20  for (SurfaceContainer::const_iterator i = theLimits.begin(); i != theLimits.end(); i++) {
21  // cout << "Local pos in boundary surface " << i->first->toLocal(gp)
22  // << " side " << i->first->side(gp, tolerance) << " should be "
23  // << i->second << endl;
24 
25  SurfaceOrientation::Side side = i->first->side(gp, tolerance);
26  if (side != i->second && side != SurfaceOrientation::onSurface)
27  return false;
28  }
29  return true;
30 }
bool myInside(const Local3DPoint &lp, float tolerance) const
const double tolerance
float yy() const
Definition: LocalError.h:24
bool inside(const Local3DPoint &lp) const override
Determine if the point is inside the bounds.
T sqrt(T t)
Definition: SSEVec.h:23
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
float xx() const
Definition: LocalError.h:22