CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~GEMGeometry();
32 
33  // Return a vector of all det types
34  virtual const DetTypeContainer& detTypes() const override;
35 
36  // Return a vector of all GeomDetUnit
37  virtual const DetUnitContainer& detUnits() const override;
38 
39  // Return a vector of all GeomDet
40  virtual const DetContainer& dets() const override;
41 
42  // Return a vector of all GeomDetUnit DetIds
43  virtual const DetIdContainer& detUnitIds() const override;
44 
45  // Return a vector of all GeomDet DetIds
46  virtual const DetIdContainer& detIds() const override;
47 
48  // Return the pointer to the GeomDetUnit corresponding to a given DetId
49  virtual const GeomDetUnit* idToDetUnit(DetId) const override;
50 
51  // Return the pointer to the GeomDet corresponding to a given DetId
52  virtual 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(GEMRegion* region);
95 
97  void add(GEMStation* station);
98 
100  void add(GEMRing* ring);
101 
103  void add(GEMSuperChamber* sch);
104 
106  void add(GEMChamber* ch);
107 
109  void add(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 chamber.
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
std::vector< GeomDetType const * > DetTypeContainer
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:126
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:121
virtual const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:33
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:115
virtual const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:38
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:123
virtual const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: GEMGeometry.cc:13
virtual const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: GEMGeometry.cc:21
virtual const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: GEMGeometry.cc:25
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 GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:103
DetIdContainer theDetIds
Definition: GEMGeometry.h:116
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:124
virtual ~GEMGeometry()
Destructor.
Definition: GEMGeometry.cc:11
mapIdToDet theMap
Definition: GEMGeometry.h:119
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:125
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 GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:75
std::unordered_map< unsigned int, GeomDet const * > mapIdToDet
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
Definition: DetId.h:18
void add(GEMRegion *region)
Add a GEMRegion to the Geometry.
Definition: GEMGeometry.cc:108
DetContainer theDets
Definition: GEMGeometry.h:113
const std::vector< const GEMRing * > & rings() const
Return a vector of all GEM rings.
Definition: GEMGeometry.cc:51
DetUnitContainer theEtaPartitions
Definition: GEMGeometry.h:112
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:99
virtual const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: GEMGeometry.cc:29
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:59
virtual const DetUnitContainer & detUnits() const override
Returm a vector of all GeomDetUnit.
Definition: GEMGeometry.cc:17
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< GeomDet const * > DetContainer
std::vector< GeomDetUnit const * > DetUnitContainer
std::vector< DetId > DetIdContainer