File indexing completed on 2023-03-17 11:19:28
0001 #include "FWCore/Framework/interface/EventSetup.h"
0002 #include "FWCore/Framework/interface/ESHandle.h"
0003 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0004 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0005 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0006 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
0007 #include "Geometry/RPCGeometry/interface/RPCChamber.h"
0008 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0009 #include "DTObjectMap.h"
0010 #include "DTStationIndex.h"
0011
0012 DTObjectMap::DTObjectMap(RPCGeometry const& rpcGeo) {
0013 for (TrackingGeometry::DetContainer::const_iterator it = rpcGeo.dets().begin(); it < rpcGeo.dets().end(); it++) {
0014 if (dynamic_cast<const RPCChamber*>(*it) != nullptr) {
0015 auto ch = dynamic_cast<const RPCChamber*>(*it);
0016 std::vector<const RPCRoll*> roles = (ch->rolls());
0017 for (std::vector<const RPCRoll*>::const_iterator r = roles.begin(); r != roles.end(); ++r) {
0018 RPCDetId rpcId = (*r)->id();
0019 int region = rpcId.region();
0020 if (region == 0) {
0021 int wheel = rpcId.ring();
0022 int sector = rpcId.sector();
0023 int station = rpcId.station();
0024 DTStationIndex ind(region, wheel, sector, station);
0025 std::set<RPCDetId> myrolls;
0026 if (rollstore.find(ind) != rollstore.end())
0027 myrolls = rollstore[ind];
0028 myrolls.insert(rpcId);
0029 rollstore[ind] = myrolls;
0030 }
0031 }
0032 }
0033 }
0034 }
0035
0036 std::set<RPCDetId> const& DTObjectMap::getRolls(DTStationIndex index) const {
0037
0038
0039
0040 static const std::set<RPCDetId> empty;
0041 return (rollstore.find(index) == rollstore.end()) ? empty : rollstore.at(index);
0042 }
0043
0044
0045 #include "FWCore/Utilities/interface/typelookup.h"
0046 TYPELOOKUP_DATA_REG(DTObjectMap);