File indexing completed on 2024-04-06 12:04:13
0001 #ifndef Geom_Bounds_H
0002 #define Geom_Bounds_H
0003
0004 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0005 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0006
0007 #include "DataFormats/GeometrySurface/interface/BoundSpan.h"
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 class Bounds {
0019 public:
0020 virtual ~Bounds() {}
0021
0022
0023
0024 virtual float length() const = 0;
0025
0026
0027
0028 virtual float width() const = 0;
0029
0030
0031
0032 virtual float thickness() const = 0;
0033
0034
0035 virtual float widthAtHalfLength() const { return width(); }
0036
0037
0038 virtual bool inside(const Local3DPoint&) const = 0;
0039 virtual bool inside(const Local2DPoint& p) const { return inside(Local3DPoint(p.x(), p.y(), 0)); }
0040
0041
0042 virtual bool inside(const Local2DPoint& p, float tollerance) const {
0043 return inside(p, LocalError(tollerance * tollerance, 0.f, tollerance * tollerance));
0044 }
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 virtual bool inside(const Local3DPoint&, const LocalError&, float scale = 1.f) const = 0;
0055
0056
0057 virtual bool inside(const Local2DPoint& p, const LocalError& err, float scale = 1.f) const {
0058 return inside(Local3DPoint(p.x(), p.y(), 0), err, scale);
0059 }
0060
0061 virtual float significanceInside(const Local3DPoint&, const LocalError&) const;
0062
0063 virtual Bounds* clone() const = 0;
0064
0065 std::pair<float, float> const& phiSpan() const { return m_span.phiSpan(); }
0066 std::pair<float, float> const& zSpan() const { return m_span.zSpan(); }
0067 std::pair<float, float> const& rSpan() const { return m_span.rSpan(); }
0068
0069 void computeSpan(Surface const& plane) { m_span.compute(plane); }
0070
0071 private:
0072 BoundSpan m_span;
0073 };
0074
0075 #endif