Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GEMGeometry_GEMGeometry_h
0002 #define GEMGeometry_GEMGeometry_h
0003 
0004 /** \class GEMGeometry
0005  *
0006  *  The model of the geometry of GEM.
0007  *
0008  *  \author M. Maggi - INFN Bari
0009  */
0010 
0011 #include "DataFormats/DetId/interface/DetId.h"
0012 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0013 #include "Geometry/GEMGeometry/interface/GEMEtaPartition.h"
0014 #include "Geometry/GEMGeometry/interface/GEMChamber.h"
0015 #include "Geometry/GEMGeometry/interface/GEMSuperChamber.h"
0016 #include "Geometry/GEMGeometry/interface/GEMRing.h"
0017 #include "Geometry/GEMGeometry/interface/GEMStation.h"
0018 #include "Geometry/GEMGeometry/interface/GEMRegion.h"
0019 #include <vector>
0020 #include <map>
0021 
0022 class GeomDetType;
0023 
0024 class GEMGeometry : public TrackingGeometry {
0025 public:
0026   /// Default constructor
0027   GEMGeometry();
0028 
0029   /// Destructor
0030   ~GEMGeometry() override;
0031 
0032   friend class GEMGeometryBuilder;
0033   friend class GeometryAligner;
0034 
0035   // Return a vector of all det types
0036   const DetTypeContainer& detTypes() const override;
0037 
0038   // Return a vector of all GeomDet
0039   const DetContainer& detUnits() const override;
0040 
0041   // Return a vector of all GeomDet
0042   const DetContainer& dets() const override;
0043 
0044   // Return a vector of all GeomDet DetIds
0045   const DetIdContainer& detUnitIds() const override;
0046 
0047   // Return a vector of all GeomDet DetIds
0048   const DetIdContainer& detIds() const override;
0049 
0050   // Return the pointer to the GeomDet corresponding to a given DetId
0051   const GeomDet* idToDetUnit(DetId) const override;
0052 
0053   // Return the pointer to the GeomDet corresponding to a given DetId
0054   const GeomDet* idToDet(DetId) const override;
0055 
0056   //---- Extension of the interface
0057 
0058   /// Return a vector of all GEM regions
0059   const std::vector<const GEMRegion*>& regions() const;
0060 
0061   /// Return a vector of all GEM stations
0062   const std::vector<const GEMStation*>& stations() const;
0063 
0064   /// Return a vector of all GEM rings
0065   const std::vector<const GEMRing*>& rings() const;
0066 
0067   /// Return a vector of all GEM super chambers
0068   const std::vector<const GEMSuperChamber*>& superChambers() const;
0069 
0070   /// Return a vector of all GEM chambers
0071   const std::vector<const GEMChamber*>& chambers() const;
0072 
0073   /// Return a vector of all GEM eta partitions
0074   const std::vector<const GEMEtaPartition*>& etaPartitions() const;
0075 
0076   // Return a GEMRegion
0077   const GEMRegion* region(int region) const;
0078 
0079   // Return a GEMStation
0080   const GEMStation* station(int region, int station) const;
0081 
0082   /// Return a GEMRing
0083   const GEMRing* ring(int region, int station, int ring) const;
0084 
0085   // Return a GEMSuperChamber given its id
0086   const GEMSuperChamber* superChamber(GEMDetId id) const;
0087 
0088   // Return a GEMChamber given its id
0089   const GEMChamber* chamber(GEMDetId id) const;
0090 
0091   /// Return a GEMEtaPartition given its id
0092   const GEMEtaPartition* etaPartition(GEMDetId id) const;
0093 
0094   /// Add a GEMRegion to the Geometry
0095   void add(const GEMRegion* region);
0096 
0097   /// Add a GEMStation to the Geometry
0098   void add(const GEMStation* station);
0099 
0100   /// Add a GEMRing to the Geometry
0101   void add(const GEMRing* ring);
0102 
0103   /// Add a GEMSuperChamber to the Geometry
0104   void add(const GEMSuperChamber* sch);
0105 
0106   /// Add a GEMChamber to the Geometry
0107   void add(const GEMChamber* ch);
0108 
0109   /// Add a GEMEtaPartition  to the Geometry
0110   void add(const GEMEtaPartition* etaPartition);
0111 
0112   bool hasME0() const;
0113   bool hasGE11() const;
0114   bool hasGE21() const;
0115 
0116 private:
0117   DetContainer theEtaPartitions;
0118   DetContainer theDets;
0119   DetTypeContainer theEtaPartitionTypes;
0120   DetIdContainer theEtaPartitionIds;
0121   DetIdContainer theDetIds;
0122 
0123   // Map for efficient lookup by DetId
0124   mapIdToDet theMap;
0125 
0126   std::vector<const GEMEtaPartition*> allEtaPartitions;  // Are not owned by this class; are owned by their chamber.
0127   std::vector<const GEMChamber*> allChambers;  // Are not owned by this class; are owned by their superchamber.
0128   std::vector<const GEMSuperChamber*> allSuperChambers;  // Are owned by this class.
0129   std::vector<const GEMRing*> allRings;                  // Are owned by this class.
0130   std::vector<const GEMStation*> allStations;            // Are owned by this class.
0131   std::vector<const GEMRegion*> allRegions;              // Are owned by this class.
0132 };
0133 
0134 #endif