Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:26

0001 #ifndef DetLayers_CylinderBuilderFromDet_h
0002 #define DetLayers_CylinderBuilderFromDet_h
0003 
0004 /** \class CylinderBuilderFromDet
0005  *  Given a container of GeomDets, constructs a cylinder of minimal
0006  *  dimensions that contains all of the Dets completely (all corners
0007  *  etc.) 
0008  *  Useful for defining a BarrelDetLayer from a group of DetUnits.
0009  *
0010  */
0011 
0012 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0013 #include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
0014 
0015 #include <vector>
0016 #include <limits>
0017 
0018 class CylinderBuilderFromDet {
0019 public:
0020   typedef GeomDet Det;
0021   typedef Surface::PositionType PositionType;
0022   typedef Surface::RotationType RotationType;
0023   typedef PositionType::BasicVectorType Vector;
0024 
0025   CylinderBuilderFromDet()
0026       : rmin(std::numeric_limits<float>::max()),
0027         rmax(0.0),
0028         zmin(std::numeric_limits<float>::max()),
0029         zmax(std::numeric_limits<float>::min()) {}
0030 
0031   BoundCylinder* operator()(std::vector<const Det*>::const_iterator first,
0032                             std::vector<const Det*>::const_iterator last) const;
0033 
0034   void operator()(const Det& det);
0035 
0036   BoundCylinder* build() const;
0037 
0038 private:
0039   float rmin;
0040   float rmax;
0041   float zmin;
0042   float zmax;
0043 };
0044 
0045 #endif