Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Geom_SimpleCylinderBounds_H
0002 #define Geom_SimpleCylinderBounds_H
0003 
0004 /** \class SimpleCylinderBounds
0005  *
0006  *  Cylinder bounds. The cylinder axis coincides with the Z axis.
0007  *  The bounds limit the length at constant Z, and allow finite thickness.
0008  *  The cylinder bound in this way looks like a pipe cut 
0009  *  perpendicularily to it's axis. Width is intended as the (outer) diameter
0010  *  of the pipe and thickness as the thickness of the pipe, i.e.
0011  *  difference between outer and inner radius
0012  */
0013 
0014 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0015 #include "DataFormats/GeometrySurface/interface/Bounds.h"
0016 #include <cmath>
0017 #include <algorithm>
0018 
0019 class SimpleCylinderBounds final : public Bounds {
0020 public:
0021   SimpleCylinderBounds(float rmin, float rmax, float zmin, float zmax);
0022 
0023   /// Lenght of the cylinder
0024   float length() const override { return theZmax - theZmin; }
0025   /// Outer diameter of the cylinder
0026   float width() const override { return 2 * theRmax; }
0027   /// Thikness of the "pipe", i.e. difference between outer and inner radius
0028   float thickness() const override { return theRmax - theRmin; }
0029 
0030   using Bounds::inside;
0031   bool inside(const Local3DPoint& p) const override;
0032 
0033   bool inside(const Local3DPoint& p, const LocalError& err, float scale) const override;
0034 
0035   virtual bool inside(const Local2DPoint& p, const LocalError& err) const;
0036 
0037   Bounds* clone() const override;
0038 
0039 private:
0040   float theRmin;
0041   float theRmax;
0042   float theZmin;
0043   float theZmax;
0044 };
0045 
0046 #endif  // Geom_SimpleCylinderBounds_H