CMS 3D CMS Logo

ME0Layer.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6  setDetId(id);
7 }
8 
10 
11 ME0DetId ME0Layer::id() const { return detId_; }
12 
13 bool ME0Layer::operator==(const ME0Layer& ch) const { return this->id() == ch.id(); }
14 
15 void ME0Layer::add(const ME0EtaPartition* rl) { etaPartitions_.emplace_back(rl); }
16 
17 std::vector<const GeomDet*> ME0Layer::components() const {
18  return std::vector<const GeomDet*>(etaPartitions_.begin(), etaPartitions_.end());
19 }
20 
21 const GeomDet* ME0Layer::component(DetId id) const { return etaPartition(ME0DetId(id.rawId())); }
22 
23 const std::vector<const ME0EtaPartition*>& ME0Layer::etaPartitions() const { return etaPartitions_; }
24 
25 int ME0Layer::nEtaPartitions() const { return etaPartitions_.size(); }
26 
28  if (id.layerId() != detId_)
29  return nullptr; // not in this eta partition!
30  return etaPartition(id.roll());
31 }
32 
33 const ME0EtaPartition* ME0Layer::etaPartition(int isl) const {
34  for (auto roll : etaPartitions_) {
35  if (roll->id().roll() == isl)
36  return roll;
37  }
38  return nullptr;
39 }
ME0Layer::add
void add(const ME0EtaPartition *roll)
Add EtaPartition to the layer which takes ownership.
Definition: ME0Layer.cc:15
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
ME0Layer::etaPartitions
const std::vector< const ME0EtaPartition * > & etaPartitions() const
Return the eta partitions.
Definition: ME0Layer.cc:23
ME0Layer::components
std::vector< const GeomDet * > components() const override
Return the rolls in the layer.
Definition: ME0Layer.cc:17
GeomDet
Definition: GeomDet.h:27
ME0Layer::~ME0Layer
~ME0Layer() override
Destructor.
Definition: ME0Layer.cc:9
ME0Layer::component
const GeomDet * component(DetId id) const override
Return the sub-component (roll) with a given id in this layer.
Definition: ME0Layer.cc:21
ME0Layer::id
ME0DetId id() const
Return the ME0DetId of this layer.
Definition: ME0Layer.cc:11
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
ME0Layer::etaPartition
const ME0EtaPartition * etaPartition(ME0DetId id) const
Return the eta partition corresponding to the given id.
Definition: ME0Layer.cc:27
DetId
Definition: DetId.h:17
ME0Layer::detId_
ME0DetId detId_
Definition: ME0Layer.h:47
ME0Layer
Definition: ME0Layer.h:9
ME0DetId
Definition: ME0DetId.h:16
ME0Layer::nEtaPartitions
int nEtaPartitions() const
Retunr numbers of eta partitions.
Definition: ME0Layer.cc:25
ME0Layer::etaPartitions_
std::vector< const ME0EtaPartition * > etaPartitions_
Definition: ME0Layer.h:50
ME0Layer::operator==
bool operator==(const ME0Layer &ch) const
equal if the id is the same
Definition: ME0Layer.cc:13
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ME0EtaPartition.h
ME0Layer::ME0Layer
ME0Layer(ME0DetId id, const ReferenceCountingPointer< BoundPlane > &plane)
Constructor.
Definition: ME0Layer.cc:5
ME0EtaPartition
Definition: ME0EtaPartition.h:12
ME0Layer.h