#include <RectangularPlaneBounds.h>
Public Member Functions | |
virtual Bounds * | clone () const |
virtual bool | inside (const Local2DPoint &p) const |
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. | |
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. | |
virtual bool | inside (const Local2DPoint &p, float tollerance) const |
Determine if a point is inside the bounds, taking a tollerance into account. | |
virtual bool | inside (const Local3DPoint &p) const |
Determine if the point is inside the bounds. | |
virtual float | length () const |
Lenght along local Y. | |
RectangularPlaneBounds (float w, float h, float t) | |
virtual float | thickness () const |
Thickness of the volume in local Z. | |
virtual float | width () const |
Width along local X. | |
Private Attributes | |
float | halfLength |
float | halfThickness |
float | halfWidth |
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.
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().
: halfWidth(w), halfLength(h), halfThickness(t) {}
Bounds * RectangularPlaneBounds::clone | ( | void | ) | const [virtual] |
Implements Bounds.
Definition at line 54 of file RectangularPlaneBounds.cc.
References RectangularPlaneBounds().
{ return new RectangularPlaneBounds(*this); }
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 41 of file RectangularPlaneBounds.cc.
References halfLength, halfWidth, mathSSE::sqrt(), PV2DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV2DBase< T, PVType, FrameType >::y(), and LocalError::yy().
{ if(scale >=0){ return (fabs(p.x()) < halfWidth || fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) && (fabs(p.y()) < halfLength || fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale); }else{ return (fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) && (fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale); } }
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().
{ return fabs(p.x()) <= halfWidth && fabs(p.y()) <= halfLength; }
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 26 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().
{ if(scale >=0){ return fabs(p.z()) < halfThickness && (fabs(p.x()) < halfWidth || fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) && (fabs(p.y()) < halfLength || fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale); }else{ return fabs(p.z()) < halfThickness && (fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) && (fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale); } }
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().
{ return fabs(p.x()) < halfWidth && fabs(p.y()) < halfLength && fabs(p.z()) < halfThickness; }
bool RectangularPlaneBounds::inside | ( | const Local2DPoint & | p, |
float | tollerance | ||
) | const [virtual] |
Determine if a point is inside the bounds, taking a tollerance into account.
Reimplemented from Bounds.
Definition at line 20 of file RectangularPlaneBounds.cc.
References abs, halfLength, halfWidth, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().
virtual float RectangularPlaneBounds::length | ( | ) | const [inline, virtual] |
Lenght along local Y.
Implements Bounds.
Definition at line 22 of file RectangularPlaneBounds.h.
References halfLength.
Referenced by TrackerValidationVariables::fillHitQuantities(), and SiStripMonitorMuonHLT::Normalizer().
{ return 2*halfLength;}
virtual float RectangularPlaneBounds::thickness | ( | ) | const [inline, virtual] |
Thickness of the volume in local Z.
Implements Bounds.
Definition at line 26 of file RectangularPlaneBounds.h.
References halfThickness.
{ return 2*halfThickness;}
virtual float RectangularPlaneBounds::width | ( | ) | const [inline, virtual] |
Width along local X.
Implements Bounds.
Definition at line 24 of file RectangularPlaneBounds.h.
References halfWidth.
Referenced by TrackerValidationVariables::fillHitQuantities(), and SiStripMonitorMuonHLT::Normalizer().
{ return 2*halfWidth;}
float RectangularPlaneBounds::halfLength [private] |
Definition at line 45 of file RectangularPlaneBounds.h.
float RectangularPlaneBounds::halfThickness [private] |
Definition at line 46 of file RectangularPlaneBounds.h.
Referenced by inside(), and thickness().
float RectangularPlaneBounds::halfWidth [private] |
Definition at line 44 of file RectangularPlaneBounds.h.