CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RectangularPlaneBounds Class Reference

#include <RectangularPlaneBounds.h>

Inheritance diagram for RectangularPlaneBounds:
Bounds

Public Member Functions

virtual Boundsclone () const
 
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local3DPoint &p) const
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local3DPoint &p, const LocalError &err, float scale=1.) const
 Determine if a point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual float length () const
 Lenght along local Y. More...
 
 RectangularPlaneBounds (float w, float h, float t)
 
virtual float thickness () const
 Thickness of the volume in local Z. More...
 
virtual float width () const
 Width along local X. More...
 
- Public Member Functions inherited from Bounds
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
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().

5  :
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Function Documentation

Bounds * RectangularPlaneBounds::clone ( void  ) const
virtual

Implements Bounds.

Definition at line 48 of file RectangularPlaneBounds.cc.

References RectangularPlaneBounds().

48  {
49  return new RectangularPlaneBounds(*this);
50 }
RectangularPlaneBounds(float w, float h, float t)
bool RectangularPlaneBounds::inside ( const Local2DPoint p) const
virtual

Reimplemented from Bounds.

Definition at line 9 of file RectangularPlaneBounds.cc.

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

Referenced by TrackerValidationVariables::fillHitQuantities().

9  {
10  return fabs(p.x()) <= halfWidth && fabs(p.y()) <= halfLength;
11 }
T y() const
Definition: PV2DBase.h:40
T x() const
Definition: PV2DBase.h:39
bool RectangularPlaneBounds::inside ( const Local3DPoint ) const
virtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 13 of file RectangularPlaneBounds.cc.

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

13  {
14  return
15  fabs(p.x()) < halfWidth &&
16  fabs(p.y()) < halfLength &&
17  fabs(p.z()) < halfThickness;
18 }
bool RectangularPlaneBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale = 1. 
) const
virtual

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

Implements Bounds.

Definition at line 20 of file RectangularPlaneBounds.cc.

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

21  {
22  if(scale >=0){
23  return
24  fabs(p.z()) < halfThickness &&
25  (fabs(p.x()) < halfWidth || fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
26  (fabs(p.y()) < halfLength || fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
27  }else{
28  return
29  fabs(p.z()) < halfThickness &&
30  (fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
31  (fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
32  }
33 }
T sqrt(T t)
Definition: SSEVec.h:28
bool RectangularPlaneBounds::inside ( const Local2DPoint p,
const LocalError err,
float  scale = 1. 
) const
virtual

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

Reimplemented from Bounds.

Definition at line 35 of file RectangularPlaneBounds.cc.

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

36  {
37  if(scale >=0){
38  return
39  (fabs(p.x()) < halfWidth || fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
40  (fabs(p.y()) < halfLength || fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
41  }else{
42  return
43  (fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
44  (fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
45  }
46 }
float xx() const
Definition: LocalError.h:19
T y() const
Definition: PV2DBase.h:40
float yy() const
Definition: LocalError.h:21
T sqrt(T t)
Definition: SSEVec.h:28
T x() const
Definition: PV2DBase.h:39
virtual float RectangularPlaneBounds::length ( ) const
inlinevirtual
virtual float RectangularPlaneBounds::thickness ( ) const
inlinevirtual

Thickness of the volume in local Z.

Implements Bounds.

Definition at line 26 of file RectangularPlaneBounds.h.

References halfThickness.

virtual float RectangularPlaneBounds::width ( ) const
inlinevirtual

Member Data Documentation

float RectangularPlaneBounds::halfLength
private

Definition at line 42 of file RectangularPlaneBounds.h.

Referenced by inside(), and length().

float RectangularPlaneBounds::halfThickness
private

Definition at line 43 of file RectangularPlaneBounds.h.

Referenced by inside(), and thickness().

float RectangularPlaneBounds::halfWidth
private

Definition at line 41 of file RectangularPlaneBounds.h.

Referenced by inside(), and width().