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

 Cylinder (const PositionType &pos, const RotationType &rot, SimpleCylinderBounds const &bounds)
 
template<typename... Args>
 Cylinder (Scalar radius, Args &&... args)
 
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
 
Side side (const LocalPoint &p, Scalar toler) const override
 
virtual Side side (const LocalPoint &p, Scalar tolerance=0) const=0
 
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 GlobalPoint &p, Scalar tolerance=0) const
 
virtual Side side (const LocalPoint &p, Scalar tolerance=0) const =0
 
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 (BasicReferenceCounted &&)
 
 BasicReferenceCounted (const 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
 
GlobalVector toGlobal (const LocalVector &lv) const
 
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) 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.

22 : Surface(std::forward<Args>(args)...), theRadius(radius) {}

Referenced by build().

◆ Cylinder() [2/2]

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

Definition at line 24 of file Cylinder.h.

◆ ~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.

55  {
56  return CylinderPointer(new Cylinder(radius, pos, rot, bounds));
57  }

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

Referenced by psClasses.BuildThread::run().

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

77  {
78  GlobalVector yPlane(rotation().z());
79  GlobalVector xPlane(yPlane.cross(aPoint - position()));
80  return Plane(aPoint, RotationType(xPlane, yPlane));
81  }

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

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

84 { return fastTangent(toGlobal(aPoint)); }

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

Referenced by fastTangent().

◆ radius()

Scalar Cylinder::radius ( ) const
inline

◆ side() [1/3]

virtual Side Surface::side
inline

Definition at line 74 of file Surface.h.

74 { return side(toLocal(p), tolerance); }

◆ side() [2/3]

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

◆ side() [3/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.

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

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 }

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

Referenced by tangentPlane().

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

15  {
16  return tangentPlane(toGlobal(aPoint));
17 }

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

Member Data Documentation

◆ theRadius

Scalar Cylinder::theRadius
private

Definition at line 87 of file Cylinder.h.

Referenced by radius().

Vector3DBase
Definition: Vector3DBase.h:8
writedatasetfile.args
args
Definition: writedatasetfile.py:18
SurfaceOrientation::onSurface
Definition: Surface.h:18
Bounds::width
virtual float width() const =0
Cylinder::radius
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
Cylinder::side
Side side(const LocalPoint &p, Scalar toler) const override
Definition: Cylinder.cc:9
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Cylinder::fastTangent
Plane fastTangent(const GlobalPoint &aPoint) const
tangent plane to surface from global point
Definition: Cylinder.h:77
pos
Definition: PixelAliasList.h:18
ConstReferenceCountingPointer
Definition: ReferenceCounted.h:67
GloballyPositioned< float >::RotationType
TkRotation< float > RotationType
Definition: GloballyPositioned.h:22
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
DDAxes::z
Bounds::clone
virtual Bounds * clone() const =0
TangentPlane
Plane TangentPlane
Definition: Surface.h:25
Bounds::thickness
virtual float thickness() const =0
Cylinder::tangentPlane
ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const override
tangent plane to surface from global point
Definition: Cylinder.cc:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:29
Cylinder::CylinderPointer
ReferenceCountingPointer< Cylinder > CylinderPointer
Definition: Cylinder.h:30
SurfaceOrientation::negativeSide
Definition: Surface.h:18
Cylinder::Cylinder
Cylinder(Scalar radius, Args &&... args)
Definition: Cylinder.h:22
GloballyPositioned< float >::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
GeometryError
Definition: GeomExceptions.h:18
GloballyPositioned< float >::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
Plane
Definition: Plane.h:16
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Surface::Surface
Surface()
Definition: Surface.h:45
SurfaceOrientation::positiveSide
Definition: Surface.h:18
Cylinder::computeRadius
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:28
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GloballyPositioned< float >::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
GloballyPositioned< float >::Scalar
float Scalar
Definition: GloballyPositioned.h:20
Cylinder::theRadius
Scalar theRadius
Definition: Cylinder.h:87
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443