Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Geometry_GEMGeometry_GEMGeometryBuilder_H
0002 #define Geometry_GEMGeometry_GEMGeometryBuilder_H
0003 
0004 #include "DataFormats/GeometrySurface/interface/Plane.h"
0005 /*
0006 //\class GEMGeometryBuilder
0007 
0008  Description: GEM Geometry builder from DD & DD4hep
0009               DD4hep part added to the original old file (DD version) made by M. Maggi (INFN Bari)
0010 //
0011 // Author:  Sergio Lo Meo (sergio.lo.meo@cern.ch) following what Ianna Osburne made for DTs (DD4hep migration)
0012 //          Created:  27 Jan 2020 
0013 */
0014 #include <string>
0015 #include <map>
0016 #include <vector>
0017 #include "DataFormats/MuonDetId/interface/GEMDetId.h"
0018 #include "DD4hep/DD4hepUnits.h"
0019 
0020 class DDCompactView;
0021 class DDFilteredView;
0022 namespace cms {
0023   class DDFilteredView;
0024   class DDCompactView;
0025   class MuonNumbering;
0026 }  // namespace cms
0027 class GEMGeometry;
0028 class GEMSuperChamber;
0029 class GEMChamber;
0030 class GEMEtaPartition;
0031 class MuonGeometryConstants;
0032 
0033 class GEMGeometryBuilder {
0034 public:
0035   GEMGeometryBuilder();
0036 
0037   ~GEMGeometryBuilder();
0038 
0039   // for DDD
0040   void build(GEMGeometry& theGeometry, const DDCompactView* cview, const MuonGeometryConstants& muonConstants);
0041   // for DD4hep
0042   void build(GEMGeometry& theGeometry, const cms::DDCompactView* cview, const MuonGeometryConstants& muonConstants);
0043 
0044 private:
0045   std::map<GEMDetId, std::vector<GEMDetId>> chids;
0046 
0047   // for DDD
0048   typedef ReferenceCountingPointer<BoundPlane> RCPBoundPlane;
0049 
0050   RCPBoundPlane boundPlane(const DDFilteredView& fv, Bounds* bounds, bool isOddChamber) const;
0051 
0052   GEMSuperChamber* buildSuperChamber(DDFilteredView& fv, GEMDetId detId) const;
0053 
0054   GEMChamber* buildChamber(DDFilteredView& fv, GEMDetId detId) const;
0055 
0056   GEMEtaPartition* buildEtaPartition(DDFilteredView& fv, GEMDetId detId) const;
0057 
0058   // for DD4hep
0059 
0060   RCPBoundPlane boundPlane(const cms::DDFilteredView& fv, Bounds* bounds, bool isOddChamber) const;
0061 
0062   GEMSuperChamber* buildSuperChamber(cms::DDFilteredView& fv, GEMDetId detId) const;
0063 
0064   GEMChamber* buildChamber(cms::DDFilteredView& fv, GEMDetId detId) const;
0065 
0066   GEMEtaPartition* buildEtaPartition(cms::DDFilteredView& fv, GEMDetId detId) const;
0067 
0068   // Common
0069   void buildRegions(GEMGeometry&, const std::vector<GEMSuperChamber*>&, bool demonstratorGeometry);
0070 
0071   static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
0072 };
0073 
0074 #endif