CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RectangularPlaneBounds Class Referencefinal

#include <RectangularPlaneBounds.h>

Inheritance diagram for RectangularPlaneBounds:
Bounds

Public Member Functions

Boundsclone () const override
 
std::pair< bool, bool > inout (const Local3DPoint &p, const LocalError &err, float scale=1.f) const
 
bool inside (const Local2DPoint &p) const override
 
bool inside (const Local3DPoint &p) const override
 Determine if the point is inside the bounds. More...
 
bool inside (const Local2DPoint &p, float tollerance) const override
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
bool inside (const Local3DPoint &p, const LocalError &err, float scale=1.f) const override
 Determine if a point is inside the bounds, taking error into account. More...
 
bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.f) const override
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
float length () const override
 Lenght along local Y. More...
 
 RectangularPlaneBounds (float w, float h, float t)
 
float significanceInside (const Local3DPoint &, const LocalError &) const override
 
float thickness () const override
 Thickness of the volume in local Z. More...
 
float width () const override
 Width along local X. More...
 
 ~RectangularPlaneBounds () override
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Attributes

float halfLength
 
float halfThickness
 
float halfWidth
 

Detailed Description

Rectangular plane bounds. Local Coordinate system coincides with center of the box with X axis along the width and Y axis along the lenght.

Definition at line 14 of file RectangularPlaneBounds.h.

Constructor & Destructor Documentation

RectangularPlaneBounds::RectangularPlaneBounds ( float  w,
float  h,
float  t 
)

Construct from half width (extension in local X), half length (Y) and half thickness (Z)

Definition at line 5 of file RectangularPlaneBounds.cc.

Referenced by clone().

RectangularPlaneBounds::~RectangularPlaneBounds ( )
override

Definition at line 9 of file RectangularPlaneBounds.cc.

9 {}

Member Function Documentation

Bounds * RectangularPlaneBounds::clone ( void  ) const
overridevirtual

Implements Bounds.

Definition at line 50 of file RectangularPlaneBounds.cc.

References RectangularPlaneBounds().

Referenced by inside().

50  {
51  return new RectangularPlaneBounds(*this);
52 }
RectangularPlaneBounds(float w, float h, float t)
std::pair< bool, bool > RectangularPlaneBounds::inout ( const Local3DPoint p,
const LocalError err,
float  scale = 1.f 
) const

Definition at line 35 of file RectangularPlaneBounds.cc.

References funct::abs(), halfLength, halfWidth, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by inside().

35  {
36  float xl = std::abs(p.x()) - std::sqrt(err.xx())*scale;
37  float xh = std::abs(p.x()) + std::sqrt(err.xx())*scale;
38  bool inx = xl<halfWidth;
39  bool outx = xh>halfWidth;
40 
41  float yl = std::abs(p.y()) - std::sqrt(err.yy())*scale;
42  float yh = std::abs(p.y()) + std::sqrt(err.yy())*scale;
43  bool iny = yl<halfLength;
44  bool outy = yh>halfLength;
45 
46  return std::pair<bool,bool>(inx&&iny,outx||outy);
47 
48 }
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:63
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV3DBase.h:62
bool RectangularPlaneBounds::inside ( const Local2DPoint p) const
inlineoverridevirtual

Reimplemented from Bounds.

Definition at line 32 of file RectangularPlaneBounds.h.

References funct::abs(), halfLength, halfWidth, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by TrackerValidationVariables::fillHitQuantities(), and inside().

32  {
33  return
34  (std::abs(p.x()) < halfWidth) &
35  (std::abs(p.y()) < halfLength);
36  }
T y() const
Definition: PV2DBase.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV2DBase.h:45
bool RectangularPlaneBounds::inside ( const Local3DPoint ) const
inlineoverridevirtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 38 of file RectangularPlaneBounds.h.

References funct::abs(), halfLength, halfThickness, halfWidth, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

38  {
39  return
40  (std::abs(p.x()) < halfWidth) &
41  (std::abs(p.y()) < halfLength) &
42  (std::abs(p.z()) < halfThickness);
43  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool RectangularPlaneBounds::inside ( const Local2DPoint p,
float  tollerance 
) const
inlineoverridevirtual

Determine if a point is inside the bounds, taking a tollerance into account.

Reimplemented from Bounds.

Definition at line 47 of file RectangularPlaneBounds.h.

References funct::abs(), clone(), f, halfLength, halfWidth, inout(), inside(), AlCaHLTBitMon_ParallelJobs::p, Scenarios_cff::scale, significanceInside(), PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

47  {
48  return (std::abs(p.x()) < (halfWidth + tollerance) ) &
49  (std::abs(p.y()) < (halfLength + tollerance) );
50  }
T y() const
Definition: PV2DBase.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV2DBase.h:45
bool RectangularPlaneBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale = 1.f 
) const
overridevirtual

Determine if a point is inside the bounds, taking error into account.

Implements Bounds.

Definition at line 11 of file RectangularPlaneBounds.cc.

References funct::abs(), halfLength, halfThickness, halfWidth, inside(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

12  {
13  if( (scale >=0) && inside(p) ) return true;
14  return
15  std::abs(p.z()) < halfThickness &&
16  (std::abs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
17  (std::abs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
18 }
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool inside(const Local2DPoint &p) const override
bool RectangularPlaneBounds::inside ( const Local2DPoint p,
const LocalError err,
float  scale = 1.f 
) const
overridevirtual

Determine if a 2D point is inside the bounds, taking error into account.

Reimplemented from Bounds.

Definition at line 20 of file RectangularPlaneBounds.cc.

References funct::abs(), halfLength, halfWidth, inside(), mathSSE::sqrt(), PV2DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV2DBase< T, PVType, FrameType >::y(), and LocalError::yy().

21  {
22  if( (scale >=0) && inside(p) ) return true;
23  return
24  (std::abs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
25  (std::abs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
26 }
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV2DBase.h:46
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool inside(const Local2DPoint &p) const override
T x() const
Definition: PV2DBase.h:45
float RectangularPlaneBounds::length ( ) const
inlineoverridevirtual
float RectangularPlaneBounds::significanceInside ( const Local3DPoint p,
const LocalError err 
) const
overridevirtual

Reimplemented from Bounds.

Definition at line 28 of file RectangularPlaneBounds.cc.

References funct::abs(), halfLength, halfWidth, SiStripPI::max, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by inside().

28  {
29  return std::max((std::abs(p.x()) - halfWidth )/std::sqrt(err.xx()),
30  (std::abs(p.y()) - halfLength)/std::sqrt(err.yy())
31  );
32 }
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:63
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV3DBase.h:62
float RectangularPlaneBounds::thickness ( ) const
inlineoverridevirtual

Thickness of the volume in local Z.

Implements Bounds.

Definition at line 27 of file RectangularPlaneBounds.h.

References halfThickness, and Bounds::inside().

float RectangularPlaneBounds::width ( ) const
inlineoverridevirtual

Member Data Documentation

float RectangularPlaneBounds::halfLength
private

Definition at line 69 of file RectangularPlaneBounds.h.

Referenced by inout(), inside(), length(), and significanceInside().

float RectangularPlaneBounds::halfThickness
private

Definition at line 70 of file RectangularPlaneBounds.h.

Referenced by inside(), and thickness().

float RectangularPlaneBounds::halfWidth
private

Definition at line 68 of file RectangularPlaneBounds.h.

Referenced by inout(), inside(), significanceInside(), and width().