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

FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const double w
Definition: UKUtility.cc:23
RectangularPlaneBounds::~RectangularPlaneBounds ( )
override

Definition at line 8 of file RectangularPlaneBounds.cc.

8 {}

Member Function Documentation

Bounds * RectangularPlaneBounds::clone ( void  ) const
overridevirtual

Implements Bounds.

Definition at line 43 of file RectangularPlaneBounds.cc.

References RectangularPlaneBounds().

Referenced by inside().

43 { return new RectangularPlaneBounds(*this); }
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 29 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().

29  {
30  float xl = std::abs(p.x()) - std::sqrt(err.xx()) * scale;
31  float xh = std::abs(p.x()) + std::sqrt(err.xx()) * scale;
32  bool inx = xl < halfWidth;
33  bool outx = xh > halfWidth;
34 
35  float yl = std::abs(p.y()) - std::sqrt(err.yy()) * scale;
36  float yh = std::abs(p.y()) + std::sqrt(err.yy()) * scale;
37  bool iny = yl < halfLength;
38  bool outy = yh > halfLength;
39 
40  return std::pair<bool, bool>(inx && iny, outx || outy);
41 }
float xx() const
Definition: LocalError.h:22
T y() const
Definition: PV3DBase.h:60
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV3DBase.h:59
bool RectangularPlaneBounds::inside ( const Local2DPoint p) const
inlineoverridevirtual

Reimplemented from Bounds.

Definition at line 29 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().

29  {
30  return (std::abs(p.x()) < halfWidth) & (std::abs(p.y()) < halfLength);
31  }
T y() const
Definition: PV2DBase.h:44
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV2DBase.h:43
bool RectangularPlaneBounds::inside ( const Local3DPoint ) const
inlineoverridevirtual
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 37 of file RectangularPlaneBounds.h.

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

37  {
38  return (std::abs(p.x()) < (halfWidth + tollerance)) & (std::abs(p.y()) < (halfLength + tollerance));
39  }
T y() const
Definition: PV2DBase.h:44
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV2DBase.h:43
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 10 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().

10  {
11  if ((scale >= 0) && inside(p))
12  return true;
13  return std::abs(p.z()) < halfThickness && (std::abs(p.x()) < halfWidth + std::sqrt(err.xx()) * scale) &&
14  (std::abs(p.y()) < halfLength + std::sqrt(err.yy()) * scale);
15 }
T sqrt(T t)
Definition: SSEVec.h:19
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 17 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().

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

Reimplemented from Bounds.

Definition at line 24 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().

24  {
25  return std::max((std::abs(p.x()) - halfWidth) / std::sqrt(err.xx()),
26  (std::abs(p.y()) - halfLength) / std::sqrt(err.yy()));
27 }
float xx() const
Definition: LocalError.h:22
T y() const
Definition: PV3DBase.h:60
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV3DBase.h:59
float RectangularPlaneBounds::thickness ( ) const
inlineoverridevirtual

Thickness of the volume in local Z.

Implements Bounds.

Definition at line 24 of file RectangularPlaneBounds.h.

References halfThickness, and Bounds::inside().

24 { return 2 * halfThickness; }
float RectangularPlaneBounds::width ( ) const
inlineoverridevirtual

Member Data Documentation

float RectangularPlaneBounds::halfLength
private

Definition at line 54 of file RectangularPlaneBounds.h.

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

float RectangularPlaneBounds::halfThickness
private

Definition at line 55 of file RectangularPlaneBounds.h.

Referenced by inside(), and thickness().

float RectangularPlaneBounds::halfWidth
private

Definition at line 53 of file RectangularPlaneBounds.h.

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