CMS 3D CMS Logo

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 >

List of all members.

Public Types

typedef
ReferenceCountingPointer
< Plane
BoundPlanePointer
typedef
ConstReferenceCountingPointer
< Plane
ConstBoundPlanePointer
typedef
ConstReferenceCountingPointer
< Plane
ConstPlanePointer
typedef
ReferenceCountingPointer
< Plane
PlanePointer

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.
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 LocalPoint &) const GCC11_FINAL
 tangent plane to surface from local point
virtual
ReferenceCountingPointer
< TangentPlane > 
tangentPlane (const GlobalPoint &) const GCC11_FINAL
 tangent plane to surface from global point
 ~Plane ()

Static Public Member Functions

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

Private Member Functions

void setPosPrec ()

Private Attributes

Scalar m_posPrec

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.

Reimplemented in GCC11_FINAL< T, TOPO >.

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

                         :
    Surface(std::forward<Args>(args)...){setPosPrec();computeSpan();}
Plane::~Plane ( ) [inline]

Definition at line 41 of file Plane.h.

{}

Member Function Documentation

template<typename... Args>
static PlanePointer Plane::build ( Args &&...  args) [inline, static]

Construct a Plane. The reference frame is defined by pos and rot; the plane is orthogonal to the local Z axis.

Reimplemented in GCC11_FINAL< T, TOPO >.

Definition at line 36 of file Plane.h.

References harvestRelVal::args, and Plane().

Referenced by ReferenceTrajectory::construct(), TrackExtrapolator::propagateTrackToVolume(), and KFBasedPixelFitter::run().

                                             {
    return PlanePointer(new Plane(std::forward<Args>(args)...));
  }
void Plane::computeSpan ( ) [inline]

Definition at line 68 of file Plane.h.

References Surface::theBounds.

Referenced by Plane().

{ if(theBounds) theBounds->computeSpan(*this);}
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().

                                              {
    return normalVector().dot(gv);
  }
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 RPCSeedPattern::extropolateStep(), fastProp(), localZclamped(), side(), and SETSeedFinder::sortByLayer().

                                             {
    return normalVector().dot(gp-position());
  }
float Plane::localZclamped ( const GlobalPoint gp) const [inline]

Definition at line 54 of file Plane.h.

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

                                                    {
    auto d = localZ(gp);
    return std::abs(d) > posPrec() ? d : 0; 
  }
GlobalVector Plane::normalVector ( ) const [inline]
float Plane::posPrec ( ) const [inline]

Definition at line 66 of file Plane.h.

References m_posPrec.

Referenced by localZclamped().

{ return m_posPrec;}
void Plane::setPosPrec ( ) [inline, private]

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

                    {
#ifndef CMS_NOCXX11
    constexpr auto maxf = std::numeric_limits<float>::max();
    auto p = position();
    float l = std::max(std::max(std::abs(p.x()),std::abs(p.y())),std::abs(p.z()));
    m_posPrec = std::abs(l-::nextafterf(l,maxf));  //  LSB  (can be multiplied by 4 or divided by 4 for safety depending on usage)
#endif
  }
virtual SurfaceOrientation::Side Plane::side ( const LocalPoint p,
Scalar  tolerance 
) const [inline, virtual]

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 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 [inline, virtual]
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.

{
  return ReferenceCountingPointer<TangentPlane>(const_cast<Plane*>(this));
}
ReferenceCountingPointer< TangentPlane > Plane::tangentPlane ( const LocalPoint ) const [virtual]

tangent plane to surface from local point

Implements Surface.

Definition at line 12 of file Plane.cc.

{
  return ReferenceCountingPointer<TangentPlane>(const_cast<Plane*>(this));
}

Member Data Documentation

Definition at line 100 of file Plane.h.

Referenced by posPrec(), and setPosPrec().