CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Plane Class Reference

#include <Plane.h>

Inheritance diagram for Plane:
Surface BasicReferenceCounted GloballyPositioned< float > BoundDiskSector Disk

Public Types

using BoundPlanePointer = ReferenceCountingPointer< Plane >
 
using ConstBoundPlanePointer = ConstReferenceCountingPointer< Plane >
 
using ConstPlanePointer = ConstReferenceCountingPointer< Plane >
 
using PlanePointer = ReferenceCountingPointer< Plane >
 
- 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

void computeSpan ()
 
float localZ (const GlobalPoint &gp) const
 
float localZ (const GlobalVector &gv) const
 Fast access to component perpendicular to plane for a vector. More...
 
float localZclamped (const GlobalPoint &gp) const
 
GlobalVector normalVector () const
 
template<typename... Args>
 Plane (Args &&... args)
 
float posPrec () const
 
SurfaceOrientation::Side side (const GlobalPoint &p, Scalar toler) const final
 
SurfaceOrientation::Side side (const LocalPoint &p, Scalar toler) const final
 
ConstReferenceCountingPointer< TangentPlanetangentPlane (const GlobalPoint &) const final
 tangent plane to surface from global point More...
 
ConstReferenceCountingPointer< TangentPlanetangentPlane (const LocalPoint &) const final
 tangent plane to surface from local point More...
 
 ~Plane () 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)
 
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

template<typename... Args>
static PlanePointer build (Args &&... args)
 
- Static Public Member Functions inherited from GloballyPositioned< float >
static float iniEta ()
 
static float iniPhi ()
 

Private Member Functions

void setPosPrec ()
 

Private Attributes

Scalar m_posPrec
 

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 plane in 3D space.

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() method. (The normal constructor will become private in the future).

Definition at line 16 of file Plane.h.

Member Typedef Documentation

◆ BoundPlanePointer

Definition at line 26 of file Plane.h.

◆ ConstBoundPlanePointer

Definition at line 27 of file Plane.h.

◆ ConstPlanePointer

Definition at line 25 of file Plane.h.

◆ PlanePointer

Definition at line 24 of file Plane.h.

Constructor & Destructor Documentation

◆ Plane()

template<typename... Args>
Plane::Plane ( Args &&...  args)
inline

Definition at line 19 of file Plane.h.

19  : Surface(std::forward<Args>(args)...) {
20  setPosPrec();
21  computeSpan();
22  }

References computeSpan(), and setPosPrec().

Referenced by build().

◆ ~Plane()

Plane::~Plane ( )
inlineoverride

Definition at line 37 of file Plane.h.

37 {}

Member Function Documentation

◆ build()

template<typename... Args>
static PlanePointer Plane::build ( Args &&...  args)
inlinestatic

◆ computeSpan()

void Plane::computeSpan ( )
inline

Definition at line 58 of file Plane.h.

58  {
59  if (theBounds)
60  theBounds->computeSpan(*this);
61  }

References Surface::theBounds.

Referenced by Plane().

◆ localZ() [1/2]

float Plane::localZ ( const GlobalPoint gp) const
inline

◆ localZ() [2/2]

float Plane::localZ ( const GlobalVector gv) const
inline

Fast access to component perpendicular to plane for a vector.

Definition at line 53 of file Plane.h.

53 { return normalVector().dot(gv); }

References Vector3DBase< T, FrameTag >::dot(), and normalVector().

◆ localZclamped()

float Plane::localZclamped ( const GlobalPoint gp) const
inline

Definition at line 47 of file Plane.h.

47  {
48  auto d = localZ(gp);
49  return std::abs(d) > posPrec() ? d : 0;
50  }

References funct::abs(), ztail::d, runTauDisplay::gp, localZ(), and posPrec().

◆ normalVector()

GlobalVector Plane::normalVector ( ) const
inline

◆ posPrec()

float Plane::posPrec ( ) const
inline

Definition at line 56 of file Plane.h.

56 { return m_posPrec; }

References m_posPrec.

Referenced by localZclamped().

◆ setPosPrec()

void Plane::setPosPrec ( )
inlineprivate

Definition at line 84 of file Plane.h.

84  {
85  constexpr auto maxf = std::numeric_limits<float>::max();
86  auto p = position();
87  float l = std::max(std::max(std::abs(p.x()), std::abs(p.y())), std::abs(p.z()));
89  l - ::nextafterf(l, maxf)); // LSB (can be multiplied by 4 or divided by 4 for safety depending on usage)
90  }

References funct::abs(), cmsLHEtoEOSManager::l, m_posPrec, SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, and GloballyPositioned< float >::position().

Referenced by Plane().

◆ side() [1/2]

SurfaceOrientation::Side Plane::side ( const GlobalPoint p,
Scalar  toler 
) const
inlinefinalvirtual

◆ side() [2/2]

SurfaceOrientation::Side Plane::side ( const LocalPoint p,
Scalar  tolerance 
) const
inlinefinalvirtual

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 65 of file Plane.h.

65  {
66  return (std::abs(p.z()) < toler)
69  }

References funct::abs(), SurfaceOrientation::negativeSide, SurfaceOrientation::onSurface, AlCaHLTBitMon_ParallelJobs::p, and SurfaceOrientation::positiveSide.

◆ tangentPlane() [1/2]

ConstReferenceCountingPointer< TangentPlane > Plane::tangentPlane ( const GlobalPoint ) const
finalvirtual

tangent plane to surface from global point

Implements Surface.

Definition at line 4 of file Plane.cc.

4  {
6 }

◆ tangentPlane() [2/2]

ConstReferenceCountingPointer< TangentPlane > Plane::tangentPlane ( const LocalPoint ) const
finalvirtual

tangent plane to surface from local point

Implements Surface.

Definition at line 8 of file Plane.cc.

8  {
10 }

Member Data Documentation

◆ m_posPrec

Scalar Plane::m_posPrec
private

Definition at line 92 of file Plane.h.

Referenced by posPrec(), and setPosPrec().

writedatasetfile.args
args
Definition: writedatasetfile.py:18
SurfaceOrientation::onSurface
Definition: Surface.h:18
Plane::computeSpan
void computeSpan()
Definition: Plane.h:58
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Plane::PlanePointer
ReferenceCountingPointer< Plane > PlanePointer
Definition: Plane.h:24
ConstReferenceCountingPointer
Definition: ReferenceCounted.h:67
GloballyPositioned< float >::GlobalVector
Vector3DBase< float, GlobalTag > GlobalVector
Definition: GloballyPositioned.h:25
Plane::m_posPrec
Scalar m_posPrec
Definition: Plane.h:92
DDAxes::z
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
Plane::setPosPrec
void setPosPrec()
Definition: Plane.h:84
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
Plane::localZ
float localZ(const GlobalPoint &gp) const
Definition: Plane.h:45
SurfaceOrientation::negativeSide
Definition: Surface.h:18
Vector3DBase::dot
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
Plane::posPrec
float posPrec() const
Definition: Plane.h:56
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
Plane::Plane
Plane(Args &&... args)
Definition: Plane.h:19
GloballyPositioned< float >::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
Surface::theBounds
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:107
Surface::Surface
Surface()
Definition: Surface.h:45
SurfaceOrientation::positiveSide
Definition: Surface.h:18
ztail.d
d
Definition: ztail.py:151
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
Plane::normalVector
GlobalVector normalVector() const
Definition: Plane.h:41