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 }
GEMSuperChamber::detId_
GEMDetId detId_
Definition: GEMSuperChamber.h:60
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
GEMSuperChamber::add
void add(const GEMChamber *ch)
Add chamber to the super chamber which takes ownership.
Definition: GEMSuperChamber.cc:15
GEMSuperChamber::chambers
const std::vector< const GEMChamber * > & chambers() const
Return the chambers in the super chamber.
Definition: GEMSuperChamber.cc:23
GeomDet
Definition: GeomDet.h:27
GEMSuperChamber
Definition: GEMSuperChamber.h:19
GEMSuperChamber::chamber
const GEMChamber * chamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMSuperChamber.cc:27
GEMSuperChamber::nChambers
int nChambers() const
Return numbers of chambers.
Definition: GEMSuperChamber.cc:25
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
DetId
Definition: DetId.h:17
GEMSuperChamber::components
std::vector< const GeomDet * > components() const override
Return the chambers in the super chamber.
Definition: GEMSuperChamber.cc:17
GEMSuperChamber::GEMSuperChamber
GEMSuperChamber(GEMDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
constructor
Definition: GEMSuperChamber.cc:4
GEMSuperChamber::chambers_
std::vector< const GEMChamber * > chambers_
Definition: GEMSuperChamber.h:63
GEMSuperChamber::~GEMSuperChamber
~GEMSuperChamber() override
destructor
Definition: GEMSuperChamber.cc:9
GEMSuperChamber::component
const GeomDet * component(DetId id) const override
Return the sub-component (chamber) with a given id in this super chamber.
Definition: GEMSuperChamber.cc:21
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:177
GEMSuperChamber::operator==
bool operator==(const GEMSuperChamber &sch) const
equal if the id is the same
Definition: GEMSuperChamber.cc:13
GEMDetId
Definition: GEMDetId.h:17
GEMChamber.h
GEMChamber
Definition: GEMChamber.h:19
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
GEMSuperChamber.h
GEMSuperChamber::id
GEMDetId id() const
Return the GEMDetId of this super chamber.
Definition: GEMSuperChamber.cc:11