Go to the documentation of this file.00001 #ifndef RecoTracker_TkDetLayers_DiskSectorBounds_h
00002 #define RecoTracker_TkDetLayers_DiskSectorBounds_h
00003
00004
00005 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00006 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00007 #include "DataFormats/GeometrySurface/interface/Bounds.h"
00008 #include <algorithm>
00009 #include <cmath>
00010
00011
00012 class DiskSectorBounds : public Bounds {
00013 public:
00014
00015 DiskSectorBounds( float rmin, float rmax, float zmin, float zmax, float phiExt) :
00016 theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExt(phiExt) {
00017 if ( theRmin > theRmax) std::swap( theRmin, theRmax);
00018 if ( theZmin > theZmax) std::swap( theZmin, theZmax);
00019 theOffset = theRmin + (theRmax-theRmin)/2. ;
00020 }
00021
00022 virtual float length() const { return theRmax-theRmin*cos(thePhiExt/2.);}
00023 virtual float width() const { return 2*theRmax*sin(thePhiExt/2.);}
00024 virtual float thickness() const { return theZmax-theZmin;}
00025
00026 virtual bool inside( const Local3DPoint& p) const;
00027
00028 virtual bool inside( const Local3DPoint& p, const LocalError& err, float scale) const;
00029
00030 virtual bool inside( const Local2DPoint& p, const LocalError& err) const {
00031 return Bounds::inside(p,err);
00032 }
00033
00034 virtual Bounds* clone() const {
00035 return new DiskSectorBounds(*this);
00036 }
00037
00038 float innerRadius() const {return theRmin;}
00039 float outerRadius() const {return theRmax;}
00040 float phiExtension() const {return thePhiExt;}
00041
00042 private:
00043 float theRmin;
00044 float theRmax;
00045 float theZmin;
00046 float theZmax;
00047 float thePhiExt;
00048 float theOffset;
00049 };
00050
00051 #endif
00052