Go to the documentation of this file.00001 #ifndef Geom_Bounds_H
00002 #define Geom_Bounds_H
00003
00004
00005 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00006 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00007
00008 #include "DataFormats/GeometrySurface/interface/BoundSpan.h"
00009
00010 #include "FWCore/Utilities/interface/GCC11Compatibility.h"
00011
00012
00022 class Bounds {
00023 public:
00024 virtual ~Bounds() {}
00025
00028 virtual float length() const = 0;
00029
00032 virtual float width() const = 0;
00033
00036 virtual float thickness() const = 0;
00037
00039 virtual float widthAtHalfLength() const {return width();}
00040
00042 virtual bool inside( const Local3DPoint&) const = 0;
00043 virtual bool inside( const Local2DPoint& p) const {
00044 return inside( Local3DPoint(p.x(), p.y(), 0) );
00045 }
00046
00048 virtual bool inside(const Local2DPoint& p, float tollerance) const {
00049 return inside(p,LocalError(tollerance*tollerance,0.f,tollerance*tollerance));
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00060 virtual bool inside( const Local3DPoint&, const LocalError&, float scale=1.f) const = 0;
00061
00063 virtual bool inside( const Local2DPoint& p, const LocalError& err,
00064 float scale=1.f) const {
00065 return inside( Local3DPoint(p.x(), p.y(), 0), err, scale);
00066 }
00067
00068 virtual Bounds* clone() const = 0;
00069
00070 std::pair<float,float> const & phiSpan() const { return m_span.phiSpan(); }
00071 std::pair<float,float> const & zSpan() const { return m_span.zSpan(); }
00072 std::pair<float,float> const & rSpan() const { return m_span.rSpan(); }
00073
00074 void computeSpan(Surface const & plane) { m_span.compute(plane);}
00075
00076 private:
00077
00078 BoundSpan m_span;
00079
00080 };
00081
00082 #endif