Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:10

0001 #include "Geometry/GEMGeometry/interface/ME0Layer.h"
0002 #include "Geometry/GEMGeometry/interface/ME0EtaPartition.h"
0003 #include <iostream>
0004 
0005 ME0Layer::ME0Layer(ME0DetId id, const ReferenceCountingPointer<BoundPlane>& plane) : GeomDet(plane), detId_(id) {
0006   setDetId(id);
0007 }
0008 
0009 ME0Layer::~ME0Layer() {}
0010 
0011 ME0DetId ME0Layer::id() const { return detId_; }
0012 
0013 bool ME0Layer::operator==(const ME0Layer& ch) const { return this->id() == ch.id(); }
0014 
0015 void ME0Layer::add(const ME0EtaPartition* rl) { etaPartitions_.emplace_back(rl); }
0016 
0017 std::vector<const GeomDet*> ME0Layer::components() const {
0018   return std::vector<const GeomDet*>(etaPartitions_.begin(), etaPartitions_.end());
0019 }
0020 
0021 const GeomDet* ME0Layer::component(DetId id) const { return etaPartition(ME0DetId(id.rawId())); }
0022 
0023 const std::vector<const ME0EtaPartition*>& ME0Layer::etaPartitions() const { return etaPartitions_; }
0024 
0025 int ME0Layer::nEtaPartitions() const { return etaPartitions_.size(); }
0026 
0027 const ME0EtaPartition* ME0Layer::etaPartition(ME0DetId id) const {
0028   if (id.layerId() != detId_)
0029     return nullptr;  // not in this eta partition!
0030   return etaPartition(id.roll());
0031 }
0032 
0033 const ME0EtaPartition* ME0Layer::etaPartition(int isl) const {
0034   for (auto roll : etaPartitions_) {
0035     if (roll->id().roll() == isl)
0036       return roll;
0037   }
0038   return nullptr;
0039 }