CMS 3D CMS Logo

GEMGeometry.h
Go to the documentation of this file.
1 #ifndef GEMGeometry_GEMGeometry_h
2 #define GEMGeometry_GEMGeometry_h
3 
19 #include <vector>
20 #include <map>
21 
22 class GeomDetType;
23 
24 class GEMGeometry : public TrackingGeometry {
25 public:
27  GEMGeometry();
28 
30  ~GEMGeometry() override;
31 
32  friend class GEMGeometryBuilder;
33  friend class GeometryAligner;
34 
35  // Return a vector of all det types
36  const DetTypeContainer& detTypes() const override;
37 
38  // Return a vector of all GeomDet
39  const DetContainer& detUnits() const override;
40 
41  // Return a vector of all GeomDet
42  const DetContainer& dets() const override;
43 
44  // Return a vector of all GeomDet DetIds
45  const DetIdContainer& detUnitIds() const override;
46 
47  // Return a vector of all GeomDet DetIds
48  const DetIdContainer& detIds() const override;
49 
50  // Return the pointer to the GeomDet corresponding to a given DetId
51  const GeomDet* idToDetUnit(DetId) const override;
52 
53  // Return the pointer to the GeomDet corresponding to a given DetId
54  const GeomDet* idToDet(DetId) const override;
55 
56  //---- Extension of the interface
57 
59  const std::vector<const GEMRegion*>& regions() const;
60 
62  const std::vector<const GEMStation*>& stations() const;
63 
65  const std::vector<const GEMRing*>& rings() const;
66 
68  const std::vector<const GEMSuperChamber*>& superChambers() const;
69 
71  const std::vector<const GEMChamber*>& chambers() const;
72 
74  const std::vector<const GEMEtaPartition*>& etaPartitions() const;
75 
76  // Return a GEMRegion
77  const GEMRegion* region(int region) const;
78 
79  // Return a GEMStation
80  const GEMStation* station(int region, int station) const;
81 
83  const GEMRing* ring(int region, int station, int ring) const;
84 
85  // Return a GEMSuperChamber given its id
86  const GEMSuperChamber* superChamber(GEMDetId id) const;
87 
88  // Return a GEMChamber given its id
89  const GEMChamber* chamber(GEMDetId id) const;
90 
92  const GEMEtaPartition* etaPartition(GEMDetId id) const;
93 
95  void add(const GEMRegion* region);
96 
98  void add(const GEMStation* station);
99 
101  void add(const GEMRing* ring);
102 
104  void add(const GEMSuperChamber* sch);
105 
107  void add(const GEMChamber* ch);
108 
110  void add(const GEMEtaPartition* etaPartition);
111 
112  bool hasME0() const;
113  bool hasGE11() const;
114  bool hasGE21() const;
115 
116 private:
122 
123  // Map for efficient lookup by DetId
125 
126  std::vector<const GEMEtaPartition*> allEtaPartitions; // Are not owned by this class; are owned by their chamber.
127  std::vector<const GEMChamber*> allChambers; // Are not owned by this class; are owned by their superchamber.
128  std::vector<const GEMSuperChamber*> allSuperChambers; // Are owned by this class.
129  std::vector<const GEMRing*> allRings; // Are owned by this class.
130  std::vector<const GEMStation*> allStations; // Are owned by this class.
131  std::vector<const GEMRegion*> allRegions; // Are owned by this class.
132 };
133 
134 #endif
~GEMGeometry() override
Destructor.
Definition: GEMGeometry.cc:11
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:131
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:126
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:23
const std::vector< const GEMRing * > & rings() const
Return a vector of all GEM rings.
Definition: GEMGeometry.cc:34
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: GEMGeometry.cc:15
Class to update a given geometry with a set of alignments.
DetContainer theEtaPartitions
Definition: GEMGeometry.h:117
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:120
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:128
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: GEMGeometry.cc:13
const std::vector< const GEMStation * > & stations() const
Return a vector of all GEM stations.
Definition: GEMGeometry.cc:32
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: GEMGeometry.cc:17
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: GEMGeometry.cc:19
GEMGeometry()
Default constructor.
Definition: GEMGeometry.cc:9
const GEMRing * ring(int region, int station, int ring) const
Return a GEMRing.
Definition: GEMGeometry.cc:60
bool hasME0() const
Definition: GEMGeometry.cc:111
DetIdContainer theDetIds
Definition: GEMGeometry.h:121
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:129
std::vector< const GeomDet * > DetContainer
mapIdToDet theMap
Definition: GEMGeometry.h:124
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:38
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
bool hasGE11() const
Definition: GEMGeometry.cc:113
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
Definition: DetId.h:17
DetContainer theDets
Definition: GEMGeometry.h:118
bool hasGE21() const
Definition: GEMGeometry.cc:115
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: GEMGeometry.cc:21
std::vector< DetId > DetIdContainer
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
std::vector< const GeomDetType * > DetTypeContainer
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:119
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:42
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:127
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:69
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:36
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.
Definition: GEMGeometry.cc:81
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40