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 
87 void GEMGeometry::add(const GEMSuperChamber* superChamber) {
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 
94 void GEMGeometry::add(const GEMEtaPartition* etaPartition) {
95  theDets.emplace_back(etaPartition);
96  allEtaPartitions.emplace_back(etaPartition);
97  theEtaPartitions.emplace_back(etaPartition);
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 }
110 
111 bool GEMGeometry::hasME0() const { return station(1, 0) != nullptr and station(-1, 0) != nullptr; }
112 
113 bool GEMGeometry::hasGE11() const { return station(1, 1) != nullptr and station(-1, 1) != nullptr; }
114 
115 bool GEMGeometry::hasGE21() const { return station(1, 2) != nullptr and station(-1, 2) != nullptr; }
GEMRing::region
int region() const
Return the region number.
Definition: GEMRing.cc:46
GEMGeometry::theEtaPartitionTypes
DetTypeContainer theEtaPartitionTypes
Definition: GEMGeometry.h:119
GEMGeometry::allEtaPartitions
std::vector< const GEMEtaPartition * > allEtaPartitions
Definition: GEMGeometry.h:126
GEMGeometry::region
const GEMRegion * region(int region) const
Definition: GEMGeometry.cc:42
GEMRing::station
int station() const
Return the station number.
Definition: GEMRing.cc:48
GEMGeometry::theEtaPartitionIds
DetIdContainer theEtaPartitionIds
Definition: GEMGeometry.h:120
GEMGeometry::add
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.
Definition: GEMGeometry.cc:81
mps_fire.i
i
Definition: mps_fire.py:428
GEMGeometry::~GEMGeometry
~GEMGeometry() override
Destructor.
Definition: GEMGeometry.cc:11
GEMGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: GEMGeometry.cc:15
GeomDet
Definition: GeomDet.h:27
GEMGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: GEMGeometry.cc:13
GEMEtaPartition::type
const GeomDetType & type() const override
Definition: GEMEtaPartition.cc:22
GEMSuperChamber
Definition: GEMSuperChamber.h:19
GEMGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
GEMGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:23
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMGeometry::GEMGeometry
GEMGeometry()
Default constructor.
Definition: GEMGeometry.cc:9
GEMGeometry::ring
const GEMRing * ring(int region, int station, int ring) const
Return a GEMRing.
Definition: GEMGeometry.cc:60
GEMEtaPartition
Definition: GEMEtaPartition.h:12
GEMGeometry::allRings
std::vector< const GEMRing * > allRings
Definition: GEMGeometry.h:129
GEMGeometry::theEtaPartitions
DetContainer theEtaPartitions
Definition: GEMGeometry.h:117
GEMGeometry::stations
const std::vector< const GEMStation * > & stations() const
Return a vector of all GEM stations.
Definition: GEMGeometry.cc:32
GEMGeometry::allSuperChambers
std::vector< const GEMSuperChamber * > allSuperChambers
Definition: GEMGeometry.h:128
GEMGeometry::hasME0
bool hasME0() const
Definition: GEMGeometry.cc:111
GEMRing::ring
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
GEMGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: GEMGeometry.cc:17
GEMGeometry::theMap
mapIdToDet theMap
Definition: GEMGeometry.h:124
DetId
Definition: DetId.h:17
GEMGeometry::theDetIds
DetIdContainer theDetIds
Definition: GEMGeometry.h:121
GEMStation
Definition: GEMStation.h:19
GEMGeometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: GEMGeometry.cc:19
GEMGeometry::station
const GEMStation * station(int region, int station) const
Definition: GEMGeometry.cc:51
GEMRing
Definition: GEMRing.h:18
TrackingGeometry::DetTypeContainer
std::vector< const GeomDetType * > DetTypeContainer
Definition: TrackingGeometry.h:28
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
GEMGeometry::theDets
DetContainer theDets
Definition: GEMGeometry.h:118
GEMStation::station
int station() const
Get the station.
Definition: GEMStation.cc:72
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
GEMGeometry::chambers
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:38
GEMGeometry::allStations
std::vector< const GEMStation * > allStations
Definition: GEMGeometry.h:130
TrackingGeometry::DetContainer
std::vector< const GeomDet * > DetContainer
Definition: TrackingGeometry.h:29
GEMDetId
Definition: GEMDetId.h:18
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88338
GEMGeometry::hasGE21
bool hasGE21() const
Definition: GEMGeometry.cc:115
GEMGeometry::regions
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
GEMGeometry::hasGE11
bool hasGE11() const
Definition: GEMGeometry.cc:113
GEMChamber
Definition: GEMChamber.h:19
GeomDet.h
GEMGeometry.h
GEMGeometry::allChambers
std::vector< const GEMChamber * > allChambers
Definition: GEMGeometry.h:127
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
GEMStation::region
int region() const
Get the region.
Definition: GEMStation.cc:70
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
GEMGeometry::etaPartitions
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40
GEMGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: GEMGeometry.cc:21
GEMGeometry::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:69
GEMGeometry::superChambers
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:36
GEMRegion
Definition: GEMRegion.h:19
GEMGeometry::chamber
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73
GEMGeometry::allRegions
std::vector< const GEMRegion * > allRegions
Definition: GEMGeometry.h:131
GEMGeometry::rings
const std::vector< const GEMRing * > & rings() const
Return a vector of all GEM rings.
Definition: GEMGeometry.cc:34
GEMRegion::region
int region() const
Return the region.
Definition: GEMRegion.cc:64
GEMGeometry::etaPartition
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:77