CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
Cylinder Class Referencefinal

#include <Cylinder.h>

Inheritance diagram for Cylinder:
Surface BasicReferenceCounted GloballyPositioned< float >

Public Types

typedef ReferenceCountingPointer< CylinderBoundCylinderPointer
 
typedef ConstReferenceCountingPointer< CylinderConstBoundCylinderPointer
 
typedef ConstReferenceCountingPointer< CylinderConstCylinderPointer
 
typedef ReferenceCountingPointer< CylinderCylinderPointer
 
- Public Types inherited from Surface
using Base = GloballyPositioned< float >
 
using Side = SurfaceOrientation::Side
 
- Public Types inherited from GloballyPositioned< float >
typedef Point3DBase< float, GlobalTagGlobalPoint
 
typedef Vector3DBase< float, GlobalTagGlobalVector
 
typedef Point3DBase< float, LocalTagLocalPoint
 
typedef Vector3DBase< float, LocalTagLocalVector
 
typedef Point3DBase< float, GlobalTagPositionType
 
typedef TkRotation< float > RotationType
 
typedef float Scalar
 

Public Member Functions

template<typename... Args>
 Cylinder (Scalar radius, Args &&... args)
 
 Cylinder (const PositionType &pos, const RotationType &rot, SimpleCylinderBounds const &bounds)
 
Plane fastTangent (const GlobalPoint &aPoint) const
 tangent plane to surface from global point More...
 
Plane fastTangent (const LocalPoint &aPoint) const
 tangent plane to surface from local point More...
 
Scalar radius () const
 Radius of the cylinder. More...
 
virtual Side side (const GlobalPoint &p, Scalar tolerance=0) const
 
virtual Side side (const LocalPoint &p, Scalar tolerance=0) const=0
 
Side side (const LocalPoint &p, Scalar toler) const override
 
ConstReferenceCountingPointer< TangentPlanetangentPlane (const GlobalPoint &) const override
 tangent plane to surface from global point More...
 
ConstReferenceCountingPointer< TangentPlanetangentPlane (const LocalPoint &) const override
 tangent plane to surface from local point More...
 
 ~Cylinder () override
 
- Public Member Functions inherited from Surface
const Boundsbounds () const
 
const MediumPropertiesmediumProperties () const
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
void setMediumProperties (const MediumProperties &mp)
 
virtual Side side (const LocalPoint &p, Scalar tolerance=0) const =0
 
virtual Side side (const GlobalPoint &p, Scalar tolerance=0) const
 
GlobalPoint toGlobal (const Point2DBase< Scalar, LocalTag > lp) const
 
std::pair< float, float > const & zSpan () const
 
 ~Surface () override
 
- Public Member Functions inherited from BasicReferenceCounted
void addReference () const
 
 BasicReferenceCounted ()
 
 BasicReferenceCounted (const BasicReferenceCounted &)
 
 BasicReferenceCounted (BasicReferenceCounted &&)
 
BasicReferenceCountedoperator= (BasicReferenceCounted &&)
 
BasicReferenceCountedoperator= (const BasicReferenceCounted &)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~BasicReferenceCounted ()
 
- Public Member Functions inherited from GloballyPositioned< float >
float eta () const
 
 GloballyPositioned ()
 
 GloballyPositioned (const PositionType &pos, const RotationType &rot)
 
void move (const GlobalVector &displacement)
 
float phi () const
 
const PositionTypeposition () const
 
void rotate (const RotationType &rotation)
 
const RotationTyperotation () const
 
GlobalPoint toGlobal (const LocalPoint &lp) const
 
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
GlobalVector toGlobal (const LocalVector &lv) const
 
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
Vector3DBase< U, LocalTagtoLocal (const Vector3DBase< U, GlobalTag > &gv) const
 
virtual ~GloballyPositioned ()
 

Static Public Member Functions

static CylinderPointer build (const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
 
static CylinderPointer build (Scalar radius, const PositionType &pos, const RotationType &rot, Bounds *bounds=nullptr)
 
static float computeRadius (Bounds const &bounds)
 
- Static Public Member Functions inherited from GloballyPositioned< float >
static float iniEta ()
 
static float iniPhi ()
 

Private Attributes

Scalar theRadius
 

Additional Inherited Members

- Protected Member Functions inherited from Surface
 Surface ()
 
 Surface (const PositionType &pos, const RotationType &rot)
 
 Surface (const PositionType &pos, const RotationType &rot, Bounds *bounds)
 
 Surface (const PositionType &pos, const RotationType &rot, MediumProperties mp)
 
 Surface (const PositionType &pos, const RotationType &rot, MediumProperties mp, Bounds *bounds)
 
 Surface (const Surface &iSurface)
 
 Surface (Surface &&iSurface)
 
- Protected Attributes inherited from Surface
extstd::clone_ptr< BoundstheBounds
 
MediumProperties theMediumProperties
 

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).

Definition at line 19 of file Cylinder.h.

Member Typedef Documentation

◆ BoundCylinderPointer

Definition at line 32 of file Cylinder.h.

◆ ConstBoundCylinderPointer

Definition at line 33 of file Cylinder.h.

◆ ConstCylinderPointer

Definition at line 31 of file Cylinder.h.

◆ CylinderPointer

Definition at line 30 of file Cylinder.h.

Constructor & Destructor Documentation

◆ Cylinder() [1/2]

template<typename... Args>
Cylinder::Cylinder ( Scalar  radius,
Args &&...  args 
)
inline

Definition at line 22 of file Cylinder.h.

Referenced by build().

22 : Surface(std::forward<Args>(args)...), theRadius(radius) {}
Surface()
Definition: Surface.h:45
Scalar theRadius
Definition: Cylinder.h:87
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64

◆ Cylinder() [2/2]

Cylinder::Cylinder ( const PositionType pos,
const RotationType rot,
SimpleCylinderBounds const &  bounds 
)
inline

Definition at line 24 of file Cylinder.h.

Surface()
Definition: Surface.h:45
Scalar theRadius
Definition: Cylinder.h:87
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:28

◆ ~Cylinder()

Cylinder::~Cylinder ( )
inlineoverride

Definition at line 59 of file Cylinder.h.

59 {}

Member Function Documentation

◆ build() [1/2]

static CylinderPointer Cylinder::build ( const PositionType pos,
const RotationType rot,
Scalar  radius,
Bounds bounds = nullptr 
)
inlinestatic

◆ build() [2/2]

static CylinderPointer Cylinder::build ( Scalar  radius,
const PositionType pos,
const RotationType rot,
Bounds bounds = nullptr 
)
inlinestatic

Definition at line 52 of file Cylinder.h.

References Cylinder(), radius(), and makeMuonMisalignmentScenario::rot.

Referenced by psClasses.BuildThread::run().

55  {
56  return CylinderPointer(new Cylinder(radius, pos, rot, bounds));
57  }
Cylinder(Scalar radius, Args &&... args)
Definition: Cylinder.h:22
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
ReferenceCountingPointer< Cylinder > CylinderPointer
Definition: Cylinder.h:30

◆ computeRadius()

static float Cylinder::computeRadius ( Bounds const &  bounds)
inlinestatic

◆ fastTangent() [1/2]

Plane Cylinder::fastTangent ( const GlobalPoint aPoint) const
inline

tangent plane to surface from global point

Definition at line 77 of file Cylinder.h.

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

77  {
78  GlobalVector yPlane(rotation().z());
79  GlobalVector xPlane(yPlane.cross(aPoint - position()));
80  return Plane(aPoint, RotationType(xPlane, yPlane));
81  }
Definition: Plane.h:16
const PositionType & position() const
TkRotation< float > RotationType
const RotationType & rotation() const

◆ fastTangent() [2/2]

Plane Cylinder::fastTangent ( const LocalPoint aPoint) const
inline

tangent plane to surface from local point

Definition at line 84 of file Cylinder.h.

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

Referenced by fastTangent().

84 { return fastTangent(toGlobal(aPoint)); }
Plane fastTangent(const GlobalPoint &aPoint) const
tangent plane to surface from global point
Definition: Cylinder.h:77
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79

◆ radius()

Scalar Cylinder::radius ( ) const
inline

◆ side() [1/3]

virtual Side Surface::side

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.

◆ side() [2/3]

virtual Side Surface::side
inline

Definition at line 74 of file Surface.h.

74 { return side(toLocal(p), tolerance); }
const double tolerance
LocalPoint toLocal(const GlobalPoint &gp) const
Side side(const LocalPoint &p, Scalar toler) const override
Definition: Cylinder.cc:9

◆ side() [3/3]

Surface::Side Cylinder::side ( const LocalPoint p,
Scalar  toler 
) const
override

◆ tangentPlane() [1/2]

ConstReferenceCountingPointer< TangentPlane > Cylinder::tangentPlane ( const GlobalPoint aPoint) const
overridevirtual

tangent plane to surface from global point

Implements Surface.

Definition at line 19 of file Cylinder.cc.

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

Referenced by tangentPlane().

19  {
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.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Plane TangentPlane
Definition: Surface.h:25
const PositionType & position() const
TkRotation< float > RotationType
const RotationType & rotation() const

◆ tangentPlane() [2/2]

ConstReferenceCountingPointer< TangentPlane > Cylinder::tangentPlane ( const LocalPoint aPoint) const
overridevirtual

tangent plane to surface from local point

Implements Surface.

Definition at line 15 of file Cylinder.cc.

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

15  {
16  return tangentPlane(toGlobal(aPoint));
17 }
ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const override
tangent plane to surface from global point
Definition: Cylinder.cc:19
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79

Member Data Documentation

◆ theRadius

Scalar Cylinder::theRadius
private

Definition at line 87 of file Cylinder.h.

Referenced by radius().