CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RectangularPlaneBounds.cc
Go to the documentation of this file.
3 #include <cmath>
4 
6  halfWidth(w), halfLength(h), halfThickness(t) {}
7 
8 
10  return fabs(p.x()) <= halfWidth && fabs(p.y()) <= halfLength;
11 }
12 
14  return
15  fabs(p.x()) < halfWidth &&
16  fabs(p.y()) < halfLength &&
17  fabs(p.z()) < halfThickness;
18 }
19 
20 bool RectangularPlaneBounds::inside(const Local2DPoint& p, float tollerance) const {
21  return std::abs(p.x()) < halfWidth + tollerance &&
22  std::abs(p.y()) < halfLength + tollerance;
23 
24 }
25 
27  float scale) const {
28  if(scale >=0){
29  return
30  fabs(p.z()) < halfThickness &&
31  (fabs(p.x()) < halfWidth || fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
32  (fabs(p.y()) < halfLength || fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
33  }else{
34  return
35  fabs(p.z()) < halfThickness &&
36  (fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
37  (fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
38  }
39 }
40 
42  float scale) const {
43  if(scale >=0){
44  return
45  (fabs(p.x()) < halfWidth || fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
46  (fabs(p.y()) < halfLength || fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
47  }else{
48  return
49  (fabs(p.x()) < halfWidth + std::sqrt(err.xx())*scale) &&
50  (fabs(p.y()) < halfLength + std::sqrt(err.yy())*scale);
51  }
52 }
53 
55  return new RectangularPlaneBounds(*this);
56 }
57 
58 
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV2DBase.h:45
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
virtual Bounds * clone() const
RectangularPlaneBounds(float w, float h, float t)
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
virtual bool inside(const Local2DPoint &p) const
Definition: Bounds.h:18
T x() const
Definition: PV2DBase.h:44
T x() const
Definition: PV3DBase.h:61
T w() const