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