CMS 3D CMS Logo

Cylinder.cc
Go to the documentation of this file.
1 
2 
6 
7 #include <cfloat>
8 
10  Scalar lz = p.perp() - radius();
11  return (fabs(lz) < toler ? SurfaceOrientation::onSurface
13 }
14 
16  return tangentPlane(toGlobal(aPoint));
17 }
18 
20  //
21  // Tangent plane at specified point. In order to avoid
22  // possible numerical problems currently no attempt is made
23  // to verify, if the point is actually on the cylinder.
24  //
25  // local y parallel to axis
26  GlobalVector yPlane(rotation().z());
27  // local x normal to y and a vector linking the specified
28  // point with the axis
29  GlobalVector xPlane(yPlane.cross(aPoint - position()));
30  Scalar size = std::max(std::max(std::abs(xPlane.x()), std::abs(xPlane.y())), std::abs(xPlane.z()));
31  if (size < FLT_MIN)
32  throw GeometryError("Attempt to construct TangentPlane on cylinder axis");
33  // // local z defined by x and y (should point outwards from axis)
34  // GlobalVector zPlane(xPlane.cross(yPlane));
35  // rotation constructor will normalize...
36  return ConstReferenceCountingPointer<TangentPlane>(new TangentPlane(aPoint, RotationType(xPlane, yPlane)));
37 }
size
Write out results.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
T perp() const
Definition: PV3DBase.h:69
ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const override
tangent plane to surface from global point
Definition: Cylinder.cc:19
Side side(const LocalPoint &p, Scalar toler) const override
Definition: Cylinder.cc:9
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Plane TangentPlane
Definition: Surface.h:27
TkRotation< float > RotationType
const RotationType & rotation() const
const PositionType & position() const