CMS 3D CMS Logo

GEMRing.cc
Go to the documentation of this file.
3 
4 GEMRing::GEMRing(int region, int station, int ring) : region_(region), station_(station), ring_(ring) {}
5 
7 
8 std::vector<GEMDetId> GEMRing::ids() const { return detIds_; }
9 
10 bool GEMRing::operator==(const GEMRing& ri) const {
11  return (region_ == ri.region() && station_ == ri.station() && ring_ == ri.ring());
12 }
13 
14 void GEMRing::add(GEMSuperChamber* sch) { superChambers_.emplace_back(sch); }
15 
16 std::vector<const GeomDet*> GEMRing::components() const {
17  std::vector<const GeomDet*> result;
18  for (auto sch : superChambers_) {
19  auto newSch(sch->components());
20  result.insert(result.end(), newSch.begin(), newSch.end());
21  }
22  return result;
23 }
24 
25 const GeomDet* GEMRing::component(DetId id) const { return superChamber(GEMDetId(id.rawId())); }
26 
28  if (id.region() != region_ || id.station() != station_ || id.ring() != ring_)
29  return nullptr; // not in this station
30  return superChamber(id.chamber());
31 }
32 
33 const GEMSuperChamber* GEMRing::superChamber(int isch) const {
34  for (auto sch : superChambers_) {
35  if (sch->id().chamber() == isch) {
36  return sch;
37  }
38  }
39  return nullptr;
40 }
41 
42 const std::vector<const GEMSuperChamber*>& GEMRing::superChambers() const { return superChambers_; }
43 
44 int GEMRing::nSuperChambers() const { return superChambers_.size(); }
45 
46 int GEMRing::region() const { return region_; }
47 
48 int GEMRing::station() const { return station_; }
49 
50 int GEMRing::ring() const { return ring_; }
GEMRing::region
int region() const
Return the region number.
Definition: GEMRing.cc:46
GEMRing::station
int station() const
Return the station number.
Definition: GEMRing.cc:48
GeomDet
Definition: GeomDet.h:27
GEMSuperChamber
Definition: GEMSuperChamber.h:19
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMRing::ring_
int ring_
Definition: GEMRing.h:65
GEMRing::ids
std::vector< GEMDetId > ids() const
Return the vector of GEMDetIds in this ring.
Definition: GEMRing.cc:8
GEMRing::superChamber
const GEMSuperChamber * superChamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMRing.cc:27
GEMRing::region_
int region_
Definition: GEMRing.h:63
GEMRing::ring
int ring() const
Return the ring number.
Definition: GEMRing.cc:50
DetId
Definition: DetId.h:17
GEMRing.h
GEMRing::detIds_
std::vector< GEMDetId > detIds_
Definition: GEMRing.h:67
GEMRing::operator==
bool operator==(const GEMRing &sch) const
equal if the id is the same
Definition: GEMRing.cc:10
sistrip::ring_
static const char ring_[]
Definition: ConstantsForGranularity.h:35
GEMRing::station_
int station_
Definition: GEMRing.h:64
GEMRing
Definition: GEMRing.h:18
GEMRing::components
std::vector< const GeomDet * > components() const
Return the super chambers in the ring.
Definition: GEMRing.cc:16
GEMRing::superChambers
const std::vector< const GEMSuperChamber * > & superChambers() const
Return the chambers in the ring.
Definition: GEMRing.cc:42
GEMDetId
Definition: GEMDetId.h:18
GEMRing::nSuperChambers
int nSuperChambers() const
Return numbers of chambers.
Definition: GEMRing.cc:44
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
GEMRing::GEMRing
GEMRing(int region, int station, int ring)
constructor
Definition: GEMRing.cc:4
GEMRing::superChambers_
std::vector< const GEMSuperChamber * > superChambers_
Definition: GEMRing.h:70
GEMRing::~GEMRing
~GEMRing()
destructor
Definition: GEMRing.cc:6
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
GEMRing::component
const GeomDet * component(DetId id) const
Return the sub-component (super chamber) with a given id in this ring.
Definition: GEMRing.cc:25
GEMSuperChamber.h
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
GEMRing::add
void add(GEMSuperChamber *ch)
Add super chamber to the ring which takes ownership.
Definition: GEMRing.cc:14
mps_fire.result
result
Definition: mps_fire.py:311