Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Geometry_GEMGeometry_ME0GeometryBuilder_H
0002 #define Geometry_GEMGeometry_ME0GeometryBuilder_H
0003 /*
0004 //\class ME0GeometryBuilder
0005 
0006  Description: ME0 Geometry builder for DD4hep
0007               DD4hep part added to the original old file (DD version) made by M. Maggi (INFN Bari)
0008 //
0009 // Author:  Sergio Lo Meo (sergio.lo.meo@cern.ch) following what Ianna Osborne made for DTs (DD4hep migration)
0010 //          Created:  29 Apr 2019 
0011 */
0012 
0013 #include "DataFormats/GeometrySurface/interface/Plane.h"
0014 #include "DataFormats/MuonDetId/interface/ME0DetId.h"
0015 #include "DD4hep/DD4hepUnits.h"
0016 #include <string>
0017 #include <map>
0018 #include <vector>
0019 
0020 class DDCompactView;
0021 class DDFilteredView;
0022 namespace cms {
0023   class DDFilteredView;
0024   class DDCompactView;
0025 }  // namespace cms
0026 class ME0Geometry;
0027 class ME0Chamber;
0028 class ME0Layer;
0029 class ME0EtaPartition;
0030 class MuonGeometryConstants;
0031 
0032 class ME0GeometryBuilder {
0033 public:
0034   ME0GeometryBuilder();
0035 
0036   ~ME0GeometryBuilder();
0037 
0038   ME0Geometry* build(const DDCompactView* cview, const MuonGeometryConstants& muonConstants);
0039   //dd4hep
0040   ME0Geometry* build(const cms::DDCompactView* cview, const MuonGeometryConstants& muonConstants);
0041 
0042 private:
0043   ME0Geometry* buildGeometry(DDFilteredView& fview, const MuonGeometryConstants& muonConstants);
0044   std::map<ME0DetId, std::vector<ME0DetId>> chids;
0045 
0046   typedef ReferenceCountingPointer<BoundPlane> ME0BoundPlane;
0047 
0048   ME0BoundPlane boundPlane(const DDFilteredView& fv, Bounds* bounds, bool isOddChamber) const;
0049 
0050   ME0Chamber* buildChamber(DDFilteredView& fv, ME0DetId detId) const;
0051 
0052   ME0Layer* buildLayer(DDFilteredView& fv, ME0DetId detId) const;
0053 
0054   ME0EtaPartition* buildEtaPartition(DDFilteredView& fv, ME0DetId detId) const;
0055   //dd4hep
0056   ME0Geometry* buildGeometry(cms::DDFilteredView& fview, const MuonGeometryConstants& muonConstants);
0057 
0058   ME0BoundPlane boundPlane(const cms::DDFilteredView& fv, Bounds* bounds, bool isOddChamber) const;
0059 
0060   ME0Chamber* buildChamber(cms::DDFilteredView& fv, ME0DetId detId) const;
0061 
0062   ME0Layer* buildLayer(cms::DDFilteredView& fv, ME0DetId detId) const;
0063 
0064   ME0EtaPartition* buildEtaPartition(cms::DDFilteredView& fv, ME0DetId detId) const;
0065 
0066   static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
0067 };
0068 
0069 #endif