CMS 3D CMS Logo

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