CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DataFormats/GeometrySurface/src/SimpleCylinderBounds.cc

Go to the documentation of this file.
00001 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00002 #include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
00003 
00004 
00005 SimpleCylinderBounds::SimpleCylinderBounds( float rmin, float rmax, float zmin, float zmax) : 
00006   theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax) {
00007   if ( theRmin > theRmax) std::swap( theRmin, theRmax);
00008   if ( theZmin > theZmax) std::swap( theZmin, theZmax);
00009 }
00010 
00011 bool SimpleCylinderBounds::inside( const Local3DPoint& p) const {
00012   return p.z()    > theZmin && p.z()    < theZmax &&
00013     p.perp() > theRmin && p.perp() < theRmax;
00014 }
00015 
00016 bool SimpleCylinderBounds::inside( const Local3DPoint& p, const LocalError& err,float scale) const {
00017 
00018     SimpleCylinderBounds tmp( theRmin, theRmax,
00019                               theZmin - sqrt(err.yy())*scale,
00020                               theZmax + sqrt(err.yy())*scale);
00021     
00022     return tmp.inside(p);
00023   }
00024 
00025 bool SimpleCylinderBounds::inside( const Local2DPoint& p, const LocalError& err) const {
00026   return Bounds::inside(p,err);
00027 }
00028 
00029 Bounds* SimpleCylinderBounds::clone() const { 
00030   return new SimpleCylinderBounds(*this);
00031 }