File indexing completed on 2023-03-17 13:03:51
0001
0002
0003
0004
0005
0006
0007
0008 #include "Geometry/RPCGeometry/interface/RPCChamber.h"
0009
0010
0011 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0012
0013
0014 #include <iostream>
0015
0016
0017
0018
0019 RPCChamber::RPCChamber(RPCDetId id, const ReferenceCountingPointer<BoundPlane>& plane) : GeomDet(plane), theId(id) {
0020 setDetId(id);
0021 }
0022
0023
0024 RPCChamber::~RPCChamber() {}
0025
0026 RPCDetId RPCChamber::id() const { return theId; }
0027
0028
0029
0030 bool RPCChamber::operator==(const RPCChamber& ch) const { return this->id() == ch.id(); }
0031
0032 void RPCChamber::add(RPCRoll* rl) { theRolls.emplace_back(rl); }
0033
0034 std::vector<const GeomDet*> RPCChamber::components() const {
0035 return std::vector<const GeomDet*>(theRolls.begin(), theRolls.end());
0036 }
0037
0038 const GeomDet* RPCChamber::component(DetId id) const { return roll(RPCDetId(id.rawId())); }
0039
0040 const std::vector<const RPCRoll*>& RPCChamber::rolls() const { return theRolls; }
0041
0042 int RPCChamber::nrolls() const { return theRolls.size(); }
0043
0044 const RPCRoll* RPCChamber::roll(RPCDetId id) const {
0045 if (id.chamberId() != theId)
0046 return nullptr;
0047 return roll(id.roll());
0048 }
0049
0050 const RPCRoll* RPCChamber::roll(int isl) const {
0051 for (auto theRoll : theRolls) {
0052 if (theRoll->id().roll() == isl)
0053 return theRoll;
0054 }
0055 return nullptr;
0056 }