CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 GloballyPositioned< float > BasicReferenceCounted BoundaryPlane GCC11_FINAL< T, TOPO > GCC11_FINAL< T, TOPO >

Public Types

typedef
ReferenceCountingPointer
< Plane
BoundPlanePointer
 
typedef
ConstReferenceCountingPointer
< Plane
ConstBoundPlanePointer
 
typedef
ConstReferenceCountingPointer
< Plane
ConstPlanePointer
 
typedef
ReferenceCountingPointer
< Plane
PlanePointer
 
- Public Types inherited from Surface
typedef GloballyPositioned< float > Base
 
typedef SurfaceOrientation::Side Side
 
- Public Types inherited from GloballyPositioned< float >
typedef Point3DBase< float,
GlobalTag
GlobalPoint
 
typedef Vector3DBase< float,
GlobalTag
GlobalVector
 
typedef Point3DBase< float,
LocalTag
LocalPoint
 
typedef Vector3DBase< float,
LocalTag
LocalVector
 
typedef Point3DBase< float,
GlobalTag
PositionType
 
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
 
virtual SurfaceOrientation::Side side (const LocalPoint &p, Scalar toler) const GCC11_FINAL
 
virtual SurfaceOrientation::Side side (const GlobalPoint &p, Scalar toler) const GCC11_FINAL
 
virtual
ReferenceCountingPointer
< TangentPlane
tangentPlane (const GlobalPoint &) const GCC11_FINAL
 tangent plane to surface from global point More...
 
virtual
ReferenceCountingPointer
< TangentPlane
tangentPlane (const LocalPoint &) const GCC11_FINAL
 tangent plane to surface from local point More...
 
 ~Plane ()
 
- 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
 
virtual ~Surface ()
 
- 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 ()
 
- Public Member Functions inherited from BasicReferenceCounted
void addReference () const
 
 BasicReferenceCounted ()
 
 BasicReferenceCounted (const BasicReferenceCounted &iRHS)
 
const BasicReferenceCountedoperator= (const BasicReferenceCounted &)
 
unsigned int references () const
 
void removeReference () const
 
virtual ~BasicReferenceCounted ()
 

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

Member Typedef Documentation

Definition at line 27 of file Plane.h.

Definition at line 28 of file Plane.h.

Definition at line 26 of file Plane.h.

Definition at line 25 of file Plane.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file Plane.h.

References computeSpan(), and setPosPrec().

Referenced by build().

21  :
22  Surface(std::forward<Args>(args)...){setPosPrec();computeSpan();}
void computeSpan()
Definition: Plane.h:68
void setPosPrec()
Definition: Plane.h:91
Surface()
Definition: Surface.h:59
Plane::~Plane ( )
inline

Definition at line 41 of file Plane.h.

41 {}

Member Function Documentation

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

Definition at line 68 of file Plane.h.

References Surface::theBounds.

Referenced by Plane().

68 { if(theBounds) theBounds->computeSpan(*this);}
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:150
float Plane::localZ ( const GlobalPoint gp) const
inline

Fast access to distance from plane for a point. return 0 if too close

Definition at line 49 of file Plane.h.

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

Referenced by fastProp(), localZclamped(), side(), and SETSeedFinder::sortByLayer().

49  {
50  return normalVector().dot(gp-position());
51  }
GlobalVector normalVector() const
Definition: Plane.h:45
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
const PositionType & position() const
float Plane::localZ ( const GlobalVector gv) const
inline

Fast access to component perpendicular to plane for a vector.

Definition at line 61 of file Plane.h.

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

61  {
62  return normalVector().dot(gv);
63  }
GlobalVector normalVector() const
Definition: Plane.h:45
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
float Plane::localZclamped ( const GlobalPoint gp) const
inline

Definition at line 54 of file Plane.h.

References abs, localZ(), and posPrec().

54  {
55  auto d = localZ(gp);
56  return std::abs(d) > posPrec() ? d : 0;
57  }
float localZ(const GlobalPoint &gp) const
Definition: Plane.h:49
#define abs(x)
Definition: mlp_lapack.h:159
float posPrec() const
Definition: Plane.h:66
GlobalVector Plane::normalVector ( ) const
inline
float Plane::posPrec ( ) const
inline

Definition at line 66 of file Plane.h.

References m_posPrec.

Referenced by localZclamped().

66 { return m_posPrec;}
Scalar m_posPrec
Definition: Plane.h:100
void Plane::setPosPrec ( )
inlineprivate

Definition at line 91 of file Plane.h.

References abs, constexpr, prof2calltree::l, m_posPrec, max(), AlCaHLTBitMon_ParallelJobs::p, and GloballyPositioned< float >::position().

Referenced by Plane().

91  {
92 #ifndef CMS_NOCXX11
94  auto p = position();
95  float l = std::max(std::max(std::abs(p.x()),std::abs(p.y())),std::abs(p.z()));
96  m_posPrec = std::abs(l-::nextafterf(l,maxf)); // LSB (can be multiplied by 4 or divided by 4 for safety depending on usage)
97 #endif
98  }
Scalar m_posPrec
Definition: Plane.h:100
#define abs(x)
Definition: mlp_lapack.h:159
const T & max(const T &a, const T &b)
const PositionType & position() const
#define constexpr
virtual SurfaceOrientation::Side Plane::side ( const LocalPoint p,
Scalar  tolerance 
) const
inlinevirtual

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.

Reimplemented in GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

Definition at line 73 of file Plane.h.

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

virtual SurfaceOrientation::Side Plane::side ( const GlobalPoint p,
Scalar  toler 
) const
inlinevirtual
ReferenceCountingPointer< TangentPlane > Plane::tangentPlane ( const GlobalPoint ) const
virtual

tangent plane to surface from global point

Implements Surface.

Definition at line 6 of file Plane.cc.

7 {
8  return ReferenceCountingPointer<TangentPlane>(const_cast<Plane*>(this));
9 }
Definition: Plane.h:17
ReferenceCountingPointer< TangentPlane > Plane::tangentPlane ( const LocalPoint ) const
virtual

tangent plane to surface from local point

Implements Surface.

Reimplemented in GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

Definition at line 12 of file Plane.cc.

13 {
14  return ReferenceCountingPointer<TangentPlane>(const_cast<Plane*>(this));
15 }
Definition: Plane.h:17

Member Data Documentation

Scalar Plane::m_posPrec
private

Definition at line 100 of file Plane.h.

Referenced by posPrec(), and setPosPrec().