CMS 3D CMS Logo

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);
20  ~RectangularPlaneBounds() override;
21 
23  float length() const override { return 2*halfLength;}
25  float width() const override { return 2*halfWidth;}
27  float thickness() const override { return 2*halfThickness;}
28 
29  // basic bounds function
30  using Bounds::inside;
31 
32  bool inside( const Local2DPoint& p) const override {
33  return
34  (std::abs(p.x()) < halfWidth) &
35  (std::abs(p.y()) < halfLength);
36  }
37 
38  bool inside( const Local3DPoint& p) const override {
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  bool inside(const Local2DPoint& p, float tollerance) const override {
48  return (std::abs(p.x()) < (halfWidth + tollerance) ) &
49  (std::abs(p.y()) < (halfLength + tollerance) );
50  }
51 
52 
53  bool inside( const Local3DPoint& p, const LocalError& err,
54  float scale=1.f) const override;
55 
56  bool inside( const Local2DPoint& p, const LocalError& err, float scale=1.f) const override;
57 
58  float significanceInside(const Local3DPoint&, const LocalError&) const override;
59 
60 
61  // compatible of being inside or outside...
62  std::pair<bool,bool> inout( const Local3DPoint& p, const LocalError& err, float scale=1.f) const;
63 
64 
65  Bounds* clone() const override;
66 
67 private:
68  float halfWidth;
69  float halfLength;
71 
72 };
73 
74 #endif
float width() const override
Width along local X.
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.
T y() const
Definition: PV3DBase.h:63
RectangularPlaneBounds(float w, float h, float t)
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
T z() const
Definition: PV3DBase.h:64
bool inside(const Local2DPoint &p, float tollerance) const override
Determine if a point is inside the bounds, taking a tollerance into account.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float length() const override
Lenght along local Y.
float thickness() const override
Thickness of the volume in local Z.
Bounds * clone() const override
float significanceInside(const Local3DPoint &, const LocalError &) const override
std::pair< bool, bool > inout(const Local3DPoint &p, const LocalError &err, float scale=1.f) const
bool inside(const Local3DPoint &p) const override
Determine if the point is inside the bounds.
bool inside(const Local2DPoint &p) const override
Definition: Bounds.h:22
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62