CMS 3D CMS Logo

GEMStation.cc
Go to the documentation of this file.
1 #include <utility>
2 
6 
7 GEMStation::GEMStation(int region, int station) : region_(region), station_(station) {}
8 
10 
11 std::vector<GEMDetId> GEMStation::ids() const {
12  std::vector<GEMDetId> result;
13  for (auto& ri : rings_) {
14  std::vector<GEMDetId> newIds(ri->ids());
15  result.insert(result.end(), newIds.begin(), newIds.end());
16  }
17  return result;
18 }
19 
20 bool GEMStation::operator==(const GEMStation& st) const { return (region_ == st.region() && station_ == st.station()); }
21 
22 void GEMStation::add(GEMRing* ring) { rings_.emplace_back(ring); }
23 
24 std::vector<const GeomDet*> GEMStation::components() const {
25  std::vector<const GeomDet*> result;
26  for (auto ri : rings_) {
27  auto newSch(ri->components());
28  result.insert(result.end(), newSch.begin(), newSch.end());
29  }
30  return result;
31 }
32 
34  auto detId(GEMDetId(id.rawId()));
35  return ring(detId.ring())->component(id);
36 }
37 
39  if (id.region() != region_ || id.station() != station_)
40  return nullptr; // not in this station
41  return ring(id.ring())->superChamber(id.chamber());
42 }
43 
44 std::vector<const GEMSuperChamber*> GEMStation::superChambers() const {
45  std::vector<const GEMSuperChamber*> result;
46  for (auto ri : rings_) {
47  std::vector<const GEMSuperChamber*> newSch(ri->superChambers());
48  result.insert(result.end(), newSch.begin(), newSch.end());
49  }
50  return result;
51 }
52 
53 const GEMRing* GEMStation::ring(int ring) const {
54  for (auto ri : rings_) {
55  if (ring == ri->ring()) {
56  return ri;
57  }
58  }
59  return nullptr;
60 }
61 
62 const std::vector<const GEMRing*>& GEMStation::rings() const { return rings_; }
63 
64 int GEMStation::nRings() const { return rings_.size(); }
65 
67 
68 const std::string GEMStation::getName() const { return name_; }
69 
70 int GEMStation::region() const { return region_; }
71 
72 int GEMStation::station() const { return station_; }
GEMStation::rings_
std::vector< const GEMRing * > rings_
Definition: GEMStation.h:74
GEMStation::~GEMStation
~GEMStation()
destructor
Definition: GEMStation.cc:9
GeomDet
Definition: GeomDet.h:27
GEMStation::name_
std::string name_
Definition: GEMStation.h:75
GEMStation::setName
void setName(std::string name)
Set the station name.
Definition: GEMStation.cc:66
GEMSuperChamber
Definition: GEMSuperChamber.h:19
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMStation::operator==
bool operator==(const GEMStation &st) const
equal if the id is the same
Definition: GEMStation.cc:20
GEMStation::GEMStation
GEMStation(int region, int station)
constructor
Definition: GEMStation.cc:7
GEMStation::nRings
int nRings() const
Return numbers of rings for this station.
Definition: GEMStation.cc:64
GEMStation::superChambers
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMStation.cc:44
GEMStation::component
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this station.
Definition: GEMStation.cc:33
GEMRing::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
GEMRing::ring
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
DetId
Definition: DetId.h:17
GEMRing.h
GEMStation::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMStation.cc:38
GEMStation.h
GEMStation
Definition: GEMStation.h:19
GEMStation::rings
const std::vector< const GEMRing * > & rings() const
Return the rings in the station.
Definition: GEMStation.cc:62
GEMStation::station_
int station_
Definition: GEMStation.h:71
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMRing
Definition: GEMRing.h:18
GEMStation::region_
int region_
Definition: GEMStation.h:70
GEMStation::station
int station() const
Get the station.
Definition: GEMStation.cc:72
GEMDetId
Definition: GEMDetId.h:17
GEMStation::components
std::vector< const GeomDet * > components() const
Return the super chambers in the station.
Definition: GEMStation.cc:24
eostools.move
def move(src, dest)
Definition: eostools.py:511
GEMStation::add
void add(GEMRing *ring)
Add ring to the station which takes ownership.
Definition: GEMStation.cc:22
GEMStation::getName
const std::string getName() const
Set the station name.
Definition: GEMStation.cc:68
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
GEMStation::region
int region() const
Get the region.
Definition: GEMStation.cc:70
GEMSuperChamber.h
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
mps_fire.result
result
Definition: mps_fire.py:303
GEMStation::ring
const GEMRing * ring(int ring) const
Get a ring.
Definition: GEMStation.cc:53
GEMStation::ids
std::vector< GEMDetId > ids() const
Return the vector of GEMDetIds in this station.
Definition: GEMStation.cc:11