CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoTracker/TkDetLayers/src/DiskSectorBounds.h

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 #pragma GCC visibility push(hidden)
00013 class DiskSectorBounds GCC11_FINAL : public Bounds {
00014 public:
00015   
00016    DiskSectorBounds( float rmin, float rmax, float zmin, float zmax, float phiExt) : 
00017      theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExt(phiExt) {
00018      if ( theRmin > theRmax) std::swap( theRmin, theRmax);
00019      if ( theZmin > theZmax) std::swap( theZmin, theZmax);
00020      theOffset = theRmin + (theRmax-theRmin)/2. ;
00021    }
00022    
00023    virtual float length()    const { return theRmax-theRmin*cos(thePhiExt/2.);}
00024    virtual float width()     const { return 2*theRmax*sin(thePhiExt/2.);}
00025    virtual float thickness() const { return theZmax-theZmin;}
00026  
00027    virtual bool inside( const Local3DPoint& p) const;
00028      
00029    virtual bool inside( const Local3DPoint& p, const LocalError& err, float scale) const;
00030  
00031    virtual bool inside( const Local2DPoint& p, const LocalError& err) const {
00032      return Bounds::inside(p,err);
00033    }
00034  
00035    virtual Bounds* clone() const { 
00036      return new DiskSectorBounds(*this);
00037    }
00038  
00039    float innerRadius() const {return theRmin;}
00040    float outerRadius() const {return theRmax;}
00041    float phiExtension() const {return thePhiExt;}
00042  
00043  private:
00044    float theRmin;
00045    float theRmax;
00046    float theZmin;
00047    float theZmax;
00048    float thePhiExt;
00049    float theOffset;
00050  };
00051  
00052 #pragma GCC visibility pop
00053 #endif 
00054