CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes

Cylinder Class Reference

#include <Cylinder.h>

Inheritance diagram for Cylinder:
Surface GloballyPositioned< float > BasicReferenceCounted GCC11_FINAL< T >

List of all members.

Public Types

typedef
ConstReferenceCountingPointer
< Cylinder
ConstCylinderPointer
typedef
ReferenceCountingPointer
< Cylinder
CylinderPointer

Public Member Functions

 Cylinder (const PositionType &pos, const RotationType &rot, Scalar radius)
 Cylinder (const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp)
Plane fastTangent (const GlobalPoint &aPoint) const
 tangent plane to surface from global point
Plane fastTangent (const LocalPoint &aPoint) const
 tangent plane to surface from local point
Scalar radius () const
 Radius of the cylinder.
virtual Side side (const LocalPoint &p, Scalar toler) const
virtual
ReferenceCountingPointer
< TangentPlane > 
tangentPlane (const LocalPoint &) const
 tangent plane to surface from local point
virtual
ReferenceCountingPointer
< TangentPlane > 
tangentPlane (const GlobalPoint &) const
 tangent plane to surface from global point
 ~Cylinder ()

Static Public Member Functions

static CylinderPointer build (const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)

Private Attributes

Scalar theRadius

Detailed Description

A Cylinder.

Warning:
Surfaces are reference counted, so only ReferenceCountingPointer should be used to point to them. For this reason, they should be using the static build() methods. (The normal constructor will become private in the future).
Date:
2012/10/21 09:08:13
Revision:
1.7

Definition at line 20 of file Cylinder.h.


Member Typedef Documentation

Definition at line 23 of file Cylinder.h.

Definition at line 22 of file Cylinder.h.


Constructor & Destructor Documentation

Cylinder::~Cylinder ( ) [inline]

Definition at line 37 of file Cylinder.h.

{}
Cylinder::Cylinder ( const PositionType pos,
const RotationType rot,
Scalar  radius 
) [inline]

Do not use this constructor directly; use the static build method, which returns a ReferenceCountingPointer. This constructor will soon become private

Definition at line 44 of file Cylinder.h.

Referenced by build().

Cylinder::Cylinder ( const PositionType pos,
const RotationType rot,
Scalar  radius,
MediumProperties mp 
) [inline]

Do not use this constructor directly; use the static build method, which returns a ReferenceCountingPointer. This constructor will soon become private

Definition at line 50 of file Cylinder.h.

                               : 
    Surface( pos, rot, mp), theRadius(radius) {}

Member Function Documentation

static CylinderPointer Cylinder::build ( const PositionType pos,
const RotationType rot,
Scalar  radius,
MediumProperties mp = 0 
) [inline, static]

Construct a cylinder with the specified radius. The reference frame is defined by pos and rot; the cylinder axis is parallel to the local Z axis.

Definition at line 29 of file Cylinder.h.

References Cylinder().

Referenced by TrackExtrapolator::propagateTrackToVolume().

                                                       {
    return CylinderPointer(new Cylinder(pos, rot, radius, mp));
  }
Plane Cylinder::fastTangent ( const LocalPoint aPoint) const [inline]

tangent plane to surface from local point

Definition at line 77 of file Cylinder.h.

References fastTangent(), and Surface::toGlobal().

                                                    {
    return fastTangent(toGlobal(aPoint));
  } 
Plane Cylinder::fastTangent ( const GlobalPoint aPoint) const [inline]

tangent plane to surface from global point

Definition at line 70 of file Cylinder.h.

References Vector3DBase< T, FrameTag >::cross(), GloballyPositioned< float >::position(), GloballyPositioned< float >::rotation(), and z.

Referenced by fastTangent().

                                                    {
    GlobalVector yPlane(rotation().z());
    GlobalVector xPlane(yPlane.cross(aPoint-position()));
    return Plane(aPoint,RotationType(xPlane, yPlane));
  }
Scalar Cylinder::radius ( ) const [inline]
Surface::Side Cylinder::side ( const LocalPoint p,
Scalar  tolerance 
) const [virtual]

Returns the side of the surface on which the point is. Not defined for 1-sided surfaces (Moebius leaf etc.) For normal 2-sided surfaces the meaning of side is surface type dependent.

Implements Surface.

Definition at line 9 of file Cylinder.cc.

References SurfaceOrientation::negativeSide, SurfaceOrientation::onSurface, PV3DBase< T, PVType, FrameType >::perp(), SurfaceOrientation::positiveSide, and radius().

ReferenceCountingPointer< TangentPlane > Cylinder::tangentPlane ( const GlobalPoint aPoint) const [virtual]

tangent plane to surface from global point

Implements Surface.

Definition at line 23 of file Cylinder.cc.

References abs, Vector3DBase< T, FrameTag >::cross(), max(), GloballyPositioned< float >::position(), GloballyPositioned< float >::rotation(), findQualityFiles::size, and z.

Referenced by tangentPlane().

{
  //
  // Tangent plane at specified point. In order to avoid
  // possible numerical problems currently no attempt is made 
  // to verify, if the point is actually on the cylinder.
  //
  // local y parallel to axis
  GlobalVector yPlane(rotation().z());
  // local x normal to y and a vector linking the specified
  // point with the axis
  GlobalVector xPlane(yPlane.cross(aPoint-position()));
  Scalar size = std::max(std::max(std::abs(xPlane.x()),std::abs(xPlane.y())), std::abs(xPlane.z()));
  if ( size<FLT_MIN ) 
    throw GeometryError("Attempt to construct TangentPlane on cylinder axis");
//   // local z defined by x and y (should point outwards from axis)
//   GlobalVector zPlane(xPlane.cross(yPlane));
  // rotation constructor will normalize...
  return ReferenceCountingPointer<TangentPlane>(new TangentPlane(aPoint,
                                                                 RotationType(xPlane,
                                                                              yPlane),
                                                                 this));
}
ReferenceCountingPointer< TangentPlane > Cylinder::tangentPlane ( const LocalPoint aPoint) const [virtual]

tangent plane to surface from local point

Implements Surface.

Definition at line 17 of file Cylinder.cc.

References tangentPlane(), and Surface::toGlobal().

{
  return tangentPlane(toGlobal(aPoint));
}

Member Data Documentation

Definition at line 83 of file Cylinder.h.

Referenced by radius().