CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RectangularPlaneBounds.h
Go to the documentation of this file.
1 #ifndef Geom_RectangularPlaneBounds_H
2 #define Geom_RectangularPlaneBounds_H
3 
4 
7 
8 
14 class RectangularPlaneBounds final : public Bounds {
15 public:
16 
19  RectangularPlaneBounds( float w, float h, float t);
21 
23  virtual float length() const { return 2*halfLength;}
25  virtual float width() const { return 2*halfWidth;}
27  virtual float thickness() const { return 2*halfThickness;}
28 
29  // basic bounds function
30  using Bounds::inside;
31 
32  virtual bool inside( const Local2DPoint& p) const {
33  return
34  (std::abs(p.x()) < halfWidth) &
35  (std::abs(p.y()) < halfLength);
36  }
37 
38  virtual bool inside( const Local3DPoint& p) const {
39  return
40  (std::abs(p.x()) < halfWidth) &
41  (std::abs(p.y()) < halfLength) &
42  (std::abs(p.z()) < halfThickness);
43  }
44 
45 
46 
47  virtual bool inside(const Local2DPoint& p, float tollerance) const {
48  return (std::abs(p.x()) < (halfWidth + tollerance) ) &
49  (std::abs(p.y()) < (halfLength + tollerance) );
50  }
51 
52 
53  virtual bool inside( const Local3DPoint& p, const LocalError& err,
54  float scale=1.f) const;
55 
56  virtual bool inside( const Local2DPoint& p, const LocalError& err, float scale=1.f) const;
57 
58  // compatible of being inside or outside...
59  std::pair<bool,bool> inout( const Local3DPoint& p, const LocalError& err, float scale=1.f) const;
60 
61 
62  virtual Bounds* clone() const;
63 
64 private:
65  float halfWidth;
66  float halfLength;
68 
69 };
70 
71 #endif
T y() const
Definition: PV2DBase.h:46
const double w
Definition: UKUtility.cc:23
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual float thickness() const
Thickness of the volume in local Z.
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
T y() const
Definition: PV3DBase.h:63
virtual Bounds * clone() const
virtual bool inside(const Local2DPoint &p) const
RectangularPlaneBounds(float w, float h, float t)
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
virtual float width() const
Width along local X.
virtual bool inside(const Local3DPoint &p) const
Determine if the point is inside the bounds.
std::pair< bool, bool > inout(const Local3DPoint &p, const LocalError &err, float scale=1.f) const
virtual float length() const
Lenght along local Y.
virtual bool inside(const Local2DPoint &p, float tollerance) const
Determine if a point is inside the bounds, taking a tollerance into account.
Definition: Bounds.h:22
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62