CMS 3D CMS Logo

GEMGeometry.cc
Go to the documentation of this file.
1 
8 
10 
12 
14  return theEtaPartitionTypes;
15 }
16 
18  return theEtaPartitions;
19 }
20 
22  return theDets;
23 }
24 
26  return theEtaPartitionIds;
27 }
28 
30  return theDetIds;
31 }
32 
34  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
35 }
36 
37 
39  mapIdToDet::const_iterator i = theMap.find(id);
40  return (i != theMap.end()) ? i->second : nullptr;
41 }
42 
43 const std::vector<const GEMRegion*>& GEMGeometry::regions() const {
44  return allRegions;
45 }
46 
47 const std::vector<const GEMStation*>& GEMGeometry::stations() const {
48  return allStations;
49 }
50 
51 const std::vector<const GEMRing*>& GEMGeometry::rings() const{
52  return allRings;
53 }
54 
55 const std::vector<const GEMSuperChamber*>& GEMGeometry::superChambers() const {
56  return allSuperChambers;
57 }
58 
59 const std::vector<const GEMChamber*>& GEMGeometry::chambers() const {
60  return allChambers;
61 }
62 
63 const std::vector<const GEMEtaPartition*>& GEMGeometry::etaPartitions() const{
64  return allEtaPartitions;
65 }
66 
67 const GEMRegion* GEMGeometry::region(int re) const{
68  for (auto region : allRegions) {
69  if (re != region->region()) continue;
70  return region;
71  }
72  return nullptr;
73 }
74 
75 const GEMStation* GEMGeometry::station(int re, int st) const{
76  for (auto station : allStations) {
77  if (re != station->region() || st != station->station()) continue;
78  return station;
79  }
80  return nullptr;
81 }
82 
83 const GEMRing* GEMGeometry::ring(int re, int st, int ri) const{
84  for (auto ring : allRings) {
85  if (re != ring->region() || st != ring->station() || ri != ring->ring()) continue;
86  return ring;
87  }
88  return nullptr;
89 }
90 
92  return dynamic_cast<const GEMSuperChamber*>(idToDet(id.superChamberId()));
93 }
94 
96  return dynamic_cast<const GEMChamber*>(idToDet(id.chamberId()));
97 }
98 
100  return dynamic_cast<const GEMEtaPartition*>(idToDetUnit(id));
101 }
102 
103 void
105  allRegions.emplace_back(region);
106 }
107 
108 void
110  allStations.emplace_back(station);
111 }
112 
113 void
115  allRings.emplace_back(ring);
116 }
117 
118 void
120  allSuperChambers.emplace_back(superChamber);
121  theDets.emplace_back(superChamber);
122  theDetIds.emplace_back(superChamber->geographicalId());
123  theMap.insert(std::pair<DetId,GeomDet*>
124  (superChamber->geographicalId(),superChamber));
125 }
126 
127 void
129  theDets.emplace_back(etaPartition);
130  allEtaPartitions.emplace_back(etaPartition);
131  theEtaPartitions.emplace_back(etaPartition);
132  theEtaPartitionIds.emplace_back(etaPartition->geographicalId());
133  theDetIds.emplace_back(etaPartition->geographicalId());
134  theEtaPartitionTypes.emplace_back(&etaPartition->type());
135  theMap.insert(std::pair<DetId,const GeomDetUnit*>
136  (etaPartition->geographicalId(),etaPartition));
137 }
138 
139 void
141  allChambers.emplace_back(chamber);
142  theDets.emplace_back(chamber);
143  theDetIds.emplace_back(chamber->geographicalId());
144  theMap.insert(std::pair<DetId,GeomDet*>
145  (chamber->geographicalId(),chamber));
146 }
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: GEMGeometry.cc:29
int region() const
Return the region number.
Definition: GEMRing.cc:61
~GEMGeometry() override
Destructor.
Definition: GEMGeometry.cc:11
int station() const
Return the station number.
Definition: GEMRing.cc:65
std::vector< GeomDetType const * > DetTypeContainer
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:126
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:121
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:115
int region() const
Get the region.
Definition: GEMStation.cc:85
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:123
int station() const
Get the station.
Definition: GEMStation.cc:89
const DetUnitContainer & detUnits() const override
Returm a vector of all GeomDetUnit.
Definition: GEMGeometry.cc:17
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
int ring() const
Return the ring number.
Definition: GEMRing.cc:69
int region() const
Return the region.
Definition: GEMRegion.cc:74
mapIdToDet theMap
Definition: GEMGeometry.h:119
const GeomDetUnit * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:33
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 GeomDetType & type() const override
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
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
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
void add(GEMRegion *region)
Add a GEMRegion to the Geometry.
Definition: GEMGeometry.cc:104
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
DetUnitContainer theEtaPartitions
Definition: GEMGeometry.h:112
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
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