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 
21  float scale) const {
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 }
34 
36  float scale) const {
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 }
47 
49  return new RectangularPlaneBounds(*this);
50 }
51 
52 
float xx() const
Definition: LocalError.h:19
T y() const
Definition: PV2DBase.h:40
T y() const
Definition: PV3DBase.h:57
virtual Bounds * clone() const
RectangularPlaneBounds(float w, float h, float t)
float yy() const
Definition: LocalError.h:21
T sqrt(T t)
Definition: SSEVec.h:28
T z() const
Definition: PV3DBase.h:58
virtual bool inside(const Local2DPoint &p) const
Definition: Bounds.h:18
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
T x() const
Definition: PV2DBase.h:39
T x() const
Definition: PV3DBase.h:56