Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 13:03:00

0001 #ifndef Geometry_GEMGeometry_ME0Geometry_h
0002 #define Geometry_GEMGeometry_ME0Geometry_h
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0006 #include "Geometry/GEMGeometry/interface/ME0EtaPartition.h"
0007 #include "Geometry/GEMGeometry/interface/ME0Layer.h"
0008 #include "Geometry/GEMGeometry/interface/ME0Chamber.h"
0009 #include <vector>
0010 #include <map>
0011 
0012 class ME0Geometry : public TrackingGeometry {
0013 public:
0014   /// Default constructor
0015   ME0Geometry();
0016 
0017   /// Destructor
0018   ~ME0Geometry() override;
0019 
0020   // Return a vector of all det types
0021   const DetTypeContainer& detTypes() const override;
0022 
0023   // Return a vector of all GeomDetUnit
0024   const DetContainer& detUnits() const override;
0025 
0026   // Return a vector of all GeomDet
0027   const DetContainer& dets() const override;
0028 
0029   // Return a vector of all GeomDetUnit DetIds
0030   const DetIdContainer& detUnitIds() const override;
0031 
0032   // Return a vector of all GeomDet DetIds
0033   const DetIdContainer& detIds() const override;
0034 
0035   // Return the pointer to the GeomDetUnit corresponding to a given DetId
0036   const GeomDet* idToDetUnit(DetId) const override;
0037 
0038   // Return the pointer to the GeomDet corresponding to a given DetId
0039   const GeomDet* idToDet(DetId) const override;
0040 
0041   //---- Extension of the interface
0042 
0043   /// Return a etaPartition given its id
0044   const ME0EtaPartition* etaPartition(ME0DetId id) const;
0045 
0046   /// Return a layer given its id
0047   const ME0Layer* layer(ME0DetId id) const;
0048 
0049   /// Return a chamber given its id
0050   const ME0Chamber* chamber(ME0DetId id) const;
0051 
0052   /// Return a vector of all ME0 eta partitions
0053   const std::vector<ME0EtaPartition const*>& etaPartitions() const;
0054 
0055   /// Return a vector of all ME0 layers
0056   const std::vector<const ME0Layer*>& layers() const;
0057 
0058   /// Return a vector of all ME0 chambers
0059   const std::vector<const ME0Chamber*>& chambers() const;
0060 
0061   /// Add a ME0 etaPartition  to the Geometry
0062   void add(ME0EtaPartition* etaPartition);
0063 
0064   /// Add a ME0 layer  to the Geometry
0065   void add(ME0Layer* layer);
0066 
0067   /// Add a ME0 Chamber  to the Geometry
0068   void add(ME0Chamber* chamber);
0069 
0070 private:
0071   DetContainer theEtaPartitions;
0072   DetTypeContainer theEtaPartitionTypes;
0073   DetIdContainer theEtaPartitionIds;
0074   DetIdContainer theDetIds;
0075   DetContainer theDets;
0076 
0077   // Map for efficient lookup by DetId
0078   mapIdToDet theMap;
0079 
0080   std::vector<ME0EtaPartition const*> allEtaPartitions;  // Are not owned by this class; are owned by their layer.
0081   std::vector<ME0Layer const*> allLayers;                // Are not owned by this class; are owned by their chamber.
0082   std::vector<ME0Chamber const*> allChambers;            // Are owned by this class.
0083 };
0084 
0085 #endif