File indexing completed on 2024-04-06 12:04:14
0001 #ifndef Geom_RectangularPlaneBounds_H
0002 #define Geom_RectangularPlaneBounds_H
0003
0004 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0005 #include "DataFormats/GeometrySurface/interface/Bounds.h"
0006
0007
0008
0009
0010
0011
0012 class RectangularPlaneBounds final : public Bounds {
0013 public:
0014
0015
0016 RectangularPlaneBounds(float w, float h, float t);
0017 ~RectangularPlaneBounds() override;
0018
0019
0020 float length() const override { return 2 * halfLength; }
0021
0022 float width() const override { return 2 * halfWidth; }
0023
0024 float thickness() const override { return 2 * halfThickness; }
0025
0026
0027 using Bounds::inside;
0028
0029 bool inside(const Local2DPoint& p) const override {
0030 return (std::abs(p.x()) < halfWidth) && (std::abs(p.y()) < halfLength);
0031 }
0032
0033 bool inside(const Local3DPoint& p) const override {
0034 return (std::abs(p.x()) < halfWidth) && (std::abs(p.y()) < halfLength) && (std::abs(p.z()) < halfThickness);
0035 }
0036
0037 bool inside(const Local2DPoint& p, float tollerance) const override {
0038 return (std::abs(p.x()) < (halfWidth + tollerance)) && (std::abs(p.y()) < (halfLength + tollerance));
0039 }
0040
0041 bool inside(const Local3DPoint& p, const LocalError& err, float scale = 1.f) const override;
0042
0043 bool inside(const Local2DPoint& p, const LocalError& err, float scale = 1.f) const override;
0044
0045 float significanceInside(const Local3DPoint&, const LocalError&) const override;
0046
0047
0048 std::pair<bool, bool> inout(const Local3DPoint& p, const LocalError& err, float scale = 1.f) const;
0049
0050 Bounds* clone() const override;
0051
0052 private:
0053 float halfWidth;
0054 float halfLength;
0055 float halfThickness;
0056 };
0057
0058 #endif