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  virtual ~ME0Geometry();
20 
21  // Return a vector of all det types
22  virtual const DetTypeContainer& detTypes() const;
23 
24  // Return a vector of all GeomDetUnit
25  virtual const DetUnitContainer& detUnits() const;
26 
27  // Return a vector of all GeomDet
28  virtual const DetContainer& dets() const;
29 
30  // Return a vector of all GeomDetUnit DetIds
31  virtual const DetIdContainer& detUnitIds() const;
32 
33  // Return a vector of all GeomDet DetIds
34  virtual const DetIdContainer& detIds() const;
35 
36  // Return the pointer to the GeomDetUnit corresponding to a given DetId
37  virtual const GeomDetUnit* idToDetUnit(DetId) const;
38 
39  // Return the pointer to the GeomDet corresponding to a given DetId
40  virtual const GeomDet* idToDet(DetId) const;
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
std::vector< ME0Layer const * > allLayers
Definition: ME0Geometry.h:84
std::vector< GeomDetType const * > DetTypeContainer
DetTypeContainer theEtaPartitionTypes
Definition: ME0Geometry.h:75
const ME0Layer * layer(ME0DetId id) const
Return a layer given its id.
Definition: ME0Geometry.cc:69
virtual const GeomDet * idToDet(DetId) const
Definition: ME0Geometry.cc:42
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: ME0Geometry.cc:18
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
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: ME0Geometry.cc:23
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: ME0Geometry.cc:13
virtual ~ME0Geometry()
Destructor.
Definition: ME0Geometry.cc:10
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
std::unordered_map< unsigned int, GeomDet const * > mapIdToDet
DetUnitContainer theEtaPartitions
Definition: ME0Geometry.h:74
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
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: ME0Geometry.cc:38
std::vector< ME0Chamber const * > allChambers
Definition: ME0Geometry.h:85
const std::vector< const ME0Layer * > & layers() const
Return a vector of all ME0 layers.
Definition: ME0Geometry.cc:54
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
Definition: ME0Geometry.cc:79
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: ME0Geometry.cc:28
std::vector< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: ME0Geometry.cc:33
ME0Geometry()
Default constructor.
Definition: ME0Geometry.cc:9
std::vector< DetId > DetIdContainer