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 LocalPoint &p, Scalar toler) const final
 
SurfaceOrientation::Side side (const GlobalPoint &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 (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

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.

References computeSpan(), and setPosPrec().

Referenced by build().

19  : Surface(std::forward<Args>(args)...) {
20  setPosPrec();
21  computeSpan();
22  }
void computeSpan()
Definition: Plane.h:58
void setPosPrec()
Definition: Plane.h:84
Surface()
Definition: Surface.h:45

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

References Bounds::computeSpan(), and Surface::theBounds.

Referenced by Plane().

58  {
59  if (theBounds)
60  theBounds->computeSpan(*this);
61  }
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:107
void computeSpan(Surface const &plane)
Definition: Bounds.h:69

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

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

53 { return normalVector().dot(gv); }
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
GlobalVector normalVector() const
Definition: Plane.h:41

◆ localZclamped()

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

Definition at line 47 of file Plane.h.

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

47  {
48  auto d = localZ(gp);
49  return std::abs(d) > posPrec() ? d : 0;
50  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
d
Definition: ztail.py:151
float localZ(const GlobalPoint &gp) const
Definition: Plane.h:45
float posPrec() const
Definition: Plane.h:56

◆ normalVector()

GlobalVector Plane::normalVector ( ) const
inline

◆ posPrec()

float Plane::posPrec ( ) const
inline

Definition at line 56 of file Plane.h.

References m_posPrec.

Referenced by localZclamped().

56 { return m_posPrec; }
Scalar m_posPrec
Definition: Plane.h:92

◆ setPosPrec()

void Plane::setPosPrec ( )
inlineprivate

Definition at line 84 of file Plane.h.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), MainPageGenerator::l, m_posPrec, WZElectronSkims53X_cff::max, AlCaHLTBitMon_ParallelJobs::p, and GloballyPositioned< float >::position().

Referenced by Plane().

84  {
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  }
Scalar m_posPrec
Definition: Plane.h:92
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const PositionType & position() const

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

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

◆ side() [2/2]

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

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

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

Member Data Documentation

◆ m_posPrec

Scalar Plane::m_posPrec
private

Definition at line 92 of file Plane.h.

Referenced by posPrec(), and setPosPrec().