CMS 3D CMS Logo

GEMSuperChamber.cc
Go to the documentation of this file.
3 
5  : GeomDet(plane), detId_(id) {
6  setDetId(id);
7 }
8 
10 
11 GEMDetId GEMSuperChamber::id() const { return detId_; }
12 
13 bool GEMSuperChamber::operator==(const GEMSuperChamber& sch) const { return this->id() == sch.id(); }
14 
15 void GEMSuperChamber::add(const GEMChamber* ch) { chambers_.emplace_back(ch); }
16 
17 std::vector<const GeomDet*> GEMSuperChamber::components() const {
18  return std::vector<const GeomDet*>(chambers_.begin(), chambers_.end());
19 }
20 
21 const GeomDet* GEMSuperChamber::component(DetId id) const { return chamber(GEMDetId(id.rawId())); }
22 
23 const std::vector<const GEMChamber*>& GEMSuperChamber::chambers() const { return chambers_; }
24 
25 int GEMSuperChamber::nChambers() const { return chambers_.size(); }
26 
28  if (id.chamber() != detId_.chamber())
29  return nullptr; // not in this super chamber!
30  return chamber(id.layer());
31 }
32 
33 const GEMChamber* GEMSuperChamber::chamber(int isl) const {
34  for (auto ch : chambers_) {
35  if (ch->id().layer() == isl)
36  return ch;
37  }
38  return nullptr;
39 }
std::vector< const GeomDet * > components() const override
Return the chambers in the super chamber.
const GEMChamber * chamber(GEMDetId id) const
Return the chamber corresponding to the given id.
void setDetId(DetId id)
Definition: GeomDet.h:99
int chamber() const
Definition: GEMDetId.h:177
bool operator==(const GEMSuperChamber &sch) const
equal if the id is the same
const GeomDet * component(DetId id) const override
Return the sub-component (chamber) with a given id in this super chamber.
~GEMSuperChamber() override
destructor
void add(const GEMChamber *ch)
Add chamber to the super chamber which takes ownership.
Definition: DetId.h:17
int nChambers() const
Return numbers of chambers.
GEMDetId id() const
Return the GEMDetId of this super chamber.
const std::vector< const GEMChamber * > & chambers() const
Return the chambers in the super chamber.
GEMSuperChamber(GEMDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
constructor
std::vector< const GEMChamber * > chambers_