CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DataFormats/GeometrySurface/interface/Bounds.h

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   // For propagation with uncertainties - one has to know by how
00053   // much one missed a surface
00054   // virtual Local2DVector<float> howFar( const Local2DPoint&) = 0;
00055   //
00056   // Or maybe a better way of determining if a surface is "touched"
00057   // by a trajectory is to have a method
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