Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:14

0001 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0002 #include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
0003 
0004 SimpleCylinderBounds::SimpleCylinderBounds(float rmin, float rmax, float zmin, float zmax)
0005     : theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax) {
0006   if (theRmin > theRmax)
0007     std::swap(theRmin, theRmax);
0008   if (theZmin > theZmax)
0009     std::swap(theZmin, theZmax);
0010 }
0011 
0012 bool SimpleCylinderBounds::inside(const Local3DPoint& p) const {
0013   return p.z() > theZmin && p.z() < theZmax && p.perp() > theRmin && p.perp() < theRmax;
0014 }
0015 
0016 bool SimpleCylinderBounds::inside(const Local3DPoint& p, const LocalError& err, float scale) const {
0017   SimpleCylinderBounds tmp(theRmin, theRmax, theZmin - sqrt(err.yy()) * scale, theZmax + sqrt(err.yy()) * scale);
0018 
0019   return tmp.inside(p);
0020 }
0021 
0022 bool SimpleCylinderBounds::inside(const Local2DPoint& p, const LocalError& err) const { return Bounds::inside(p, err); }
0023 
0024 Bounds* SimpleCylinderBounds::clone() const { return new SimpleCylinderBounds(*this); }