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 
26  public:
28  GEMGeometry();
29 
31  ~GEMGeometry() override;
32 
33  // Return a vector of all det types
34  const DetTypeContainer& detTypes() const override;
35 
36  // Return a vector of all GeomDet
37  const DetContainer& detUnits() const override;
38 
39  // Return a vector of all GeomDet
40  const DetContainer& dets() const override;
41 
42  // Return a vector of all GeomDet DetIds
43  const DetIdContainer& detUnitIds() const override;
44 
45  // Return a vector of all GeomDet DetIds
46  const DetIdContainer& detIds() const override;
47 
48  // Return the pointer to the GeomDet corresponding to a given DetId
49  const GeomDet* idToDetUnit(DetId) const override;
50 
51  // Return the pointer to the GeomDet corresponding to a given DetId
52  const GeomDet* idToDet(DetId) const override;
53 
54 
55  //---- Extension of the interface
56 
58  const std::vector<const GEMRegion*>& regions() const;
59 
61  const std::vector<const GEMStation*>& stations() const;
62 
64  const std::vector<const GEMRing*>& rings() const;
65 
67  const std::vector<const GEMSuperChamber*>& superChambers() const;
68 
70  const std::vector<const GEMChamber*>& chambers() const;
71 
73  const std::vector<const GEMEtaPartition*>& etaPartitions() const;
74 
75  // Return a GEMRegion
76  const GEMRegion* region(int region) const;
77 
78  // Return a GEMStation
79  const GEMStation* station(int region, int station) const;
80 
82  const GEMRing* ring(int region, int station, int ring) const;
83 
84  // Return a GEMSuperChamber given its id
85  const GEMSuperChamber* superChamber(GEMDetId id) const;
86 
87  // Return a GEMChamber given its id
88  const GEMChamber* chamber(GEMDetId id) const;
89 
91  const GEMEtaPartition* etaPartition(GEMDetId id) const;
92 
94  void add(const GEMRegion* region);
95 
97  void add(const GEMStation* station);
98 
100  void add(const GEMRing* ring);
101 
103  void add(const GEMSuperChamber* sch);
104 
106  void add(const GEMChamber* ch);
107 
109  void add(const GEMEtaPartition* etaPartition);
110 
111  private:
117 
118  // Map for efficient lookup by DetId
120 
121  std::vector<const GEMEtaPartition*> allEtaPartitions; // Are not owned by this class; are owned by their chamber.
122  std::vector<const GEMChamber*> allChambers; // Are not owned by this class; are owned by their superchamber.
123  std::vector<const GEMSuperChamber*> allSuperChambers; // Are owned by this class.
124  std::vector<const GEMRing*> allRings; // Are owned by this class.
125  std::vector<const GEMStation*> allStations; // Are owned by this class.
126  std::vector<const GEMRegion*> allRegions; // Are owned by this class.
127 };
128 
129 #endif
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: GEMGeometry.cc:29
~GEMGeometry() override
Destructor.
Definition: GEMGeometry.cc:11
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: GEMGeometry.cc:17
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:126
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:121
DetContainer theEtaPartitions
Definition: GEMGeometry.h:112
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:115
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:123
const GEMRing * ring(int region, int station, int ring) const
Return a GEMRing.
Definition: GEMGeometry.cc:83
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:67
GEMGeometry()
Default constructor.
Definition: GEMGeometry.cc:9
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: GEMGeometry.cc:13
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:99
DetIdContainer theDetIds
Definition: GEMGeometry.h:116
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:124
mapIdToDet theMap
Definition: GEMGeometry.h:119
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:125
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: GEMGeometry.cc:21
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:43
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:33
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:75
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
Definition: DetId.h:18
DetContainer theDets
Definition: GEMGeometry.h:113
const std::vector< const GEMRing * > & rings() const
Return a vector of all GEM rings.
Definition: GEMGeometry.cc:51
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: GEMGeometry.cc:25
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:38
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:95
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:59
std::vector< DetId > DetIdContainer
std::vector< const GeomDet * > DetContainer
std::unordered_map< unsigned int, const GeomDet * > mapIdToDet
const std::vector< const GEMStation * > & stations() const
Return a vector of all GEM stations.
Definition: GEMGeometry.cc:47
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:114
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:122
std::vector< const GeomDetType * > DetTypeContainer
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.
Definition: GEMGeometry.cc:104