CMS 3D CMS Logo

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