CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GEMChamber.cc
Go to the documentation of this file.
1 
9 #include <iostream>
10 
12  setDetId(id);
13 }
14 
16 
17 GEMDetId GEMChamber::id() const { return detId_; }
18 
19 bool GEMChamber::operator==(const GEMChamber& ch) const { return this->id() == ch.id(); }
20 
21 void GEMChamber::add(const GEMEtaPartition* rl) { etaPartitions_.emplace_back(rl); }
22 
23 std::vector<const GeomDet*> GEMChamber::components() const {
24  return std::vector<const GeomDet*>(etaPartitions_.begin(), etaPartitions_.end());
25 }
26 
27 const GeomDet* GEMChamber::component(DetId id) const { return etaPartition(GEMDetId(id.rawId())); }
28 
29 const std::vector<const GEMEtaPartition*>& GEMChamber::etaPartitions() const { return etaPartitions_; }
30 
31 int GEMChamber::nEtaPartitions() const { return etaPartitions_.size(); }
32 
34  if (id.chamberId() != detId_)
35  return nullptr; // not in this eta partition!
36  return etaPartition(id.roll());
37 }
38 
40  for (auto roll : etaPartitions_) {
41  if (roll->id().roll() == isl)
42  return roll;
43  }
44  return nullptr;
45 }
bool operator==(const GEMChamber &ch) const
equal if the id is the same
Definition: GEMChamber.cc:19
GEMDetId detId_
Definition: GEMChamber.h:57
void setDetId(DetId id)
Definition: GeomDet.h:99
std::vector< const GEMEtaPartition * > etaPartitions_
Definition: GEMChamber.h:60
GEMDetId id() const
Return the GEMDetId of this chamber.
Definition: GEMChamber.cc:17
GEMChamber(GEMDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
Constructor.
Definition: GEMChamber.cc:11
std::vector< const GeomDet * > components() const override
Return the rolls in the chamber.
Definition: GEMChamber.cc:23
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return the eta partitions.
Definition: GEMChamber.cc:29
~GEMChamber() override
Destructor.
Definition: GEMChamber.cc:15
Definition: DetId.h:17
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return the eta partition corresponding to the given id.
Definition: GEMChamber.cc:33
int nEtaPartitions() const
Retunr numbers of eta partitions.
Definition: GEMChamber.cc:31
void add(const GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
Definition: GEMChamber.cc:21
const GeomDet * component(DetId id) const override
Return the sub-component (roll) with a given id in this chamber.
Definition: GEMChamber.cc:27