CMS 3D CMS Logo

ME0Geometry.h
Go to the documentation of this file.
1 #ifndef Geometry_GEMGeometry_ME0Geometry_h
2 #define Geometry_GEMGeometry_ME0Geometry_h
3 
9 #include <vector>
10 #include <map>
11 
12 class ME0Geometry : public TrackingGeometry {
13 public:
15  ME0Geometry();
16 
18  ~ME0Geometry() override;
19 
20  // Return a vector of all det types
21  const DetTypeContainer& detTypes() const override;
22 
23  // Return a vector of all GeomDetUnit
24  const DetContainer& detUnits() const override;
25 
26  // Return a vector of all GeomDet
27  const DetContainer& dets() const override;
28 
29  // Return a vector of all GeomDetUnit DetIds
30  const DetIdContainer& detUnitIds() const override;
31 
32  // Return a vector of all GeomDet DetIds
33  const DetIdContainer& detIds() const override;
34 
35  // Return the pointer to the GeomDetUnit corresponding to a given DetId
36  const GeomDet* idToDetUnit(DetId) const override;
37 
38  // Return the pointer to the GeomDet corresponding to a given DetId
39  const GeomDet* idToDet(DetId) const override;
40 
41  //---- Extension of the interface
42 
44  const ME0EtaPartition* etaPartition(ME0DetId id) const;
45 
47  const ME0Layer* layer(ME0DetId id) const;
48 
50  const ME0Chamber* chamber(ME0DetId id) const;
51 
53  const std::vector<ME0EtaPartition const*>& etaPartitions() const;
54 
56  const std::vector<const ME0Layer*>& layers() const;
57 
59  const std::vector<const ME0Chamber*>& chambers() const;
60 
63 
65  void add(ME0Layer* layer);
66 
68  void add(ME0Chamber* chamber);
69 
70 private:
76 
77  // Map for efficient lookup by DetId
79 
80  std::vector<ME0EtaPartition const*> allEtaPartitions; // Are not owned by this class; are owned by their layer.
81  std::vector<ME0Layer const*> allLayers; // Are not owned by this class; are owned by their chamber.
82  std::vector<ME0Chamber const*> allChambers; // Are owned by this class.
83 };
84 
85 #endif
std::vector< ME0Layer const * > allLayers
Definition: ME0Geometry.h:81
DetContainer theEtaPartitions
Definition: ME0Geometry.h:71
DetTypeContainer theEtaPartitionTypes
Definition: ME0Geometry.h:72
~ME0Geometry() override
Destructor.
Definition: ME0Geometry.cc:10
mapIdToDet theMap
Definition: ME0Geometry.h:78
DetIdContainer theDetIds
Definition: ME0Geometry.h:74
DetContainer theDets
Definition: ME0Geometry.h:75
std::vector< ME0EtaPartition const * > allEtaPartitions
Definition: ME0Geometry.h:80
const GeomDet * idToDet(DetId) const override
Definition: ME0Geometry.cc:24
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: ME0Geometry.cc:18
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: ME0Geometry.cc:22
std::vector< const GeomDet * > DetContainer
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: ME0Geometry.cc:20
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
Definition: ME0Geometry.cc:29
const ME0Chamber * chamber(ME0DetId id) const
Return a chamber given its id.
Definition: ME0Geometry.cc:43
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
Definition: DetId.h:17
DetIdContainer theEtaPartitionIds
Definition: ME0Geometry.h:73
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: ME0Geometry.cc:16
std::vector< ME0Chamber const * > allChambers
Definition: ME0Geometry.h:82
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return a etaPartition given its id.
Definition: ME0Geometry.cc:35
std::vector< DetId > DetIdContainer
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:47
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: ME0Geometry.cc:12
std::vector< const GeomDetType * > DetTypeContainer
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: ME0Geometry.cc:14
const std::vector< const ME0Layer * > & layers() const
Return a vector of all ME0 layers.
Definition: ME0Geometry.cc:31
const ME0Layer * layer(ME0DetId id) const
Return a layer given its id.
Definition: ME0Geometry.cc:39
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:33
ME0Geometry()
Default constructor.
Definition: ME0Geometry.cc:9