Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-12-09 23:46:26

0001 #ifndef Geom_SimpleDiskBounds_H
0002 #define Geom_SimpleDiskBounds_H
0003 
0004 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0005 #include "DataFormats/GeometrySurface/interface/Bounds.h"
0006 
0007 /** \class SimpleDiskBounds
0008  * Plane bounds that define a disk with a concentric hole in the middle.
0009  */
0010 
0011 class SimpleDiskBounds final : public Bounds {
0012 public:
0013   /// Construct the bounds from min and max R and Z in LOCAL coordinates.
0014   SimpleDiskBounds(float rmin, float rmax, float zmin, float zmax);
0015 
0016   float length() const override { return theZmax - theZmin; }
0017   float width() const override { return 2 * theRmax; }
0018   float thickness() const override { return theZmax - theZmin; }
0019 
0020   bool inside(const Local3DPoint& p) const override {
0021     return ((p.z() > theZmin) && (p.z() < theZmax)) &&
0022            ((p.perp2() > theRmin * theRmin) && (p.perp2() < theRmax * theRmax));
0023   }
0024 
0025   using Bounds::inside;
0026 
0027   bool inside(const Local3DPoint& p, const LocalError& err, float scale) const override;
0028 
0029   virtual bool inside(const Local2DPoint& p, const LocalError& err) const;
0030 
0031   Bounds* clone() const override;
0032 
0033   /// Extension of the Bounds interface
0034   float innerRadius() const { return theRmin; }
0035   float outerRadius() const { return theRmax; }
0036 
0037   float minZ() const { return theZmin; }
0038   float maxZ() const { return theZmax; }
0039 
0040 private:
0041   float theRmin;
0042   float theRmax;
0043   float theZmin;
0044   float theZmax;
0045 };
0046 
0047 #endif  // Geom_SimpleDiskBounds_H