CMS 3D CMS Logo

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 }
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
GEMChamber::operator==
bool operator==(const GEMChamber &ch) const
equal if the id is the same
Definition: GEMChamber.cc:19
GeomDet
Definition: GeomDet.h:27
GEMChamber::~GEMChamber
~GEMChamber() override
Destructor.
Definition: GEMChamber.cc:15
GEMEtaPartition
Definition: GEMEtaPartition.h:12
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
DetId
Definition: DetId.h:17
GEMChamber::add
void add(const GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
Definition: GEMChamber.cc:21
GEMEtaPartition.h
GEMChamber::etaPartitions
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return the eta partitions.
Definition: GEMChamber.cc:29
GEMChamber::component
const GeomDet * component(DetId id) const override
Return the sub-component (roll) with a given id in this chamber.
Definition: GEMChamber.cc:27
GEMChamber::detId_
GEMDetId detId_
Definition: GEMChamber.h:57
GEMDetId
Definition: GEMDetId.h:18
GEMChamber.h
GEMChamber::etaPartition
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return the eta partition corresponding to the given id.
Definition: GEMChamber.cc:33
GEMChamber::nEtaPartitions
int nEtaPartitions() const
Retunr numbers of eta partitions.
Definition: GEMChamber.cc:31
GEMChamber
Definition: GEMChamber.h:19
GEMChamber::GEMChamber
GEMChamber(GEMDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
Constructor.
Definition: GEMChamber.cc:11
GEMChamber::etaPartitions_
std::vector< const GEMEtaPartition * > etaPartitions_
Definition: GEMChamber.h:60
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
GEMChamber::id
GEMDetId id() const
Return the GEMDetId of this chamber.
Definition: GEMChamber.cc:17
GEMChamber::components
std::vector< const GeomDet * > components() const override
Return the rolls in the chamber.
Definition: GEMChamber.cc:23