CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 : 0;
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 0;
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 0;
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 0;
89 }
90 
92  for (auto sch : allSuperChambers){
93  if (sch->id() != id) continue;
94  return sch;
95  }
96  return 0;
97 }
98 
100  return dynamic_cast<const GEMChamber*>(idToDet(id.chamberId()));
101 }
102 
104  return dynamic_cast<const GEMEtaPartition*>(idToDetUnit(id));
105 }
106 
107 void
109  allRegions.push_back(region);
110 }
111 
112 void
114  allStations.push_back(station);
115 }
116 
117 void
119  allRings.push_back(ring);
120 }
121 
122 void
124  allSuperChambers.push_back(superChamber);
125  theDets.push_back(superChamber);
126  theDetIds.push_back(superChamber->geographicalId());
127  theMap.insert(std::pair<DetId,GeomDet*>
128  (superChamber->geographicalId(),superChamber));
129 }
130 
131 void
133  theDets.push_back(etaPartition);
134  allEtaPartitions.push_back(etaPartition);
135  theEtaPartitions.push_back(etaPartition);
136  theEtaPartitionIds.push_back(etaPartition->geographicalId());
137  theDetIds.push_back(etaPartition->geographicalId());
138  theEtaPartitionTypes.push_back(&etaPartition->type());
139  theMap.insert(std::pair<DetId,const GeomDetUnit*>
140  (etaPartition->geographicalId(),etaPartition));
141 }
142 
143 void
145  allChambers.push_back(chamber);
146  theDets.push_back(chamber);
147  theDetIds.push_back(chamber->geographicalId());
148  theMap.insert(std::pair<DetId,GeomDet*>
149  (chamber->geographicalId(),chamber));
150 }
int region() const
Return the region number.
Definition: GEMRing.cc:61
int station() const
Return the station number.
Definition: GEMRing.cc:65
std::vector< GeomDetType const * > DetTypeContainer
int i
Definition: DBlmapReader.cc:9
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
int region() const
Get the region.
Definition: GEMStation.cc:83
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
int station() const
Get the station.
Definition: GEMStation.cc:87
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
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
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
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
const GeomDetType & type() const
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