CMS 3D CMS Logo

GEMRegion.cc
Go to the documentation of this file.
4 
5 GEMRegion::GEMRegion(int region) : region_(region) {}
6 
8 
9 std::vector<GEMDetId> GEMRegion::ids() const {
10  std::vector<GEMDetId> result;
11  for (auto st : stations_) {
12  std::vector<GEMDetId> newIds(st->ids());
13  result.insert(result.end(), newIds.begin(), newIds.end());
14  }
15  return result;
16 }
17 
18 bool GEMRegion::operator==(const GEMRegion& re) const { return region_ == re.region(); }
19 
20 void GEMRegion::add(GEMStation* st) { stations_.emplace_back(st); }
21 
22 std::vector<const GeomDet*> GEMRegion::components() const {
23  std::vector<const GeomDet*> result;
24  for (auto st : stations_) {
25  auto newSch(st->components());
26  result.insert(result.end(), newSch.begin(), newSch.end());
27  }
28  return result;
29 }
30 
32  auto detId(GEMDetId(id.rawId()));
33  return station(detId.station())->component(id);
34 }
35 
37  if (id.region() != region_)
38  return nullptr; // not in this region
39  return station(id.station())->ring(id.ring())->superChamber(id);
40 }
41 
42 std::vector<const GEMSuperChamber*> GEMRegion::superChambers() const {
43  std::vector<const GEMSuperChamber*> result;
44  for (auto st : stations_) {
45  std::vector<const GEMSuperChamber*> newSch(st->superChambers());
46  result.insert(result.end(), newSch.begin(), newSch.end());
47  }
48  return result;
49 }
50 
51 const GEMStation* GEMRegion::station(int st) const {
52  for (auto stat : stations_) {
53  if (st == stat->station()) {
54  return stat;
55  }
56  }
57  return nullptr;
58 }
59 
60 const std::vector<const GEMStation*>& GEMRegion::stations() const { return stations_; }
61 
62 int GEMRegion::nStations() const { return stations_.size(); }
63 
64 int GEMRegion::region() const { return region_; }
GEMRegion::station
const GEMStation * station(int st) const
Return a station.
Definition: GEMRegion.cc:51
GEMRegion::components
std::vector< const GeomDet * > components() const
Return the super chambers in the region.
Definition: GEMRegion.cc:22
GEMRegion::add
void add(GEMStation *st)
Add station to the region which takes ownership.
Definition: GEMRegion.cc:20
GeomDet
Definition: GeomDet.h:27
GEMSuperChamber
Definition: GEMSuperChamber.h:19
GEMRegion::ids
std::vector< GEMDetId > ids() const
Return the vector of GEMDetIds in this ring.
Definition: GEMRegion.cc:9
GEMRegion::operator==
bool operator==(const GEMRegion &reg) const
equal if the id is the same
Definition: GEMRegion.cc:18
GEMRegion::region_
int region_
Definition: GEMRegion.h:61
GEMRing::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
GEMRegion::GEMRegion
GEMRegion(int region)
constructor
Definition: GEMRegion.cc:5
DetId
Definition: DetId.h:17
GEMRegion::~GEMRegion
~GEMRegion()
destructor
Definition: GEMRegion.cc:7
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1119
GEMRegion::nStations
int nStations() const
Return numbers of stations.
Definition: GEMRegion.cc:62
GEMRegion.h
GEMStation.h
GEMStation
Definition: GEMStation.h:19
GEMRegion::stations_
std::vector< const GEMStation * > stations_
Definition: GEMRegion.h:63
GEMDetId
Definition: GEMDetId.h:18
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88338
GEMRegion::stations
const std::vector< const GEMStation * > & stations() const
Return all stations.
Definition: GEMRegion.cc:60
GEMRegion::superChambers
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMRegion.cc:42
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
GEMSuperChamber.h
GEMRegion::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the super chamber corresponding to the given id.
Definition: GEMRegion.cc:36
mps_fire.result
result
Definition: mps_fire.py:311
GEMStation::ring
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
GEMRegion
Definition: GEMRegion.h:19
GEMRegion::component
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this region.
Definition: GEMRegion.cc:31
GEMRegion::region
int region() const
Return the region.
Definition: GEMRegion.cc:64