CMS 3D CMS Logo

DTObjectMap.cc
Go to the documentation of this file.
11 
13  for (TrackingGeometry::DetContainer::const_iterator it = rpcGeo.dets().begin(); it < rpcGeo.dets().end(); it++) {
14  if (dynamic_cast<const RPCChamber*>(*it) != nullptr) {
15  auto ch = dynamic_cast<const RPCChamber*>(*it);
16  std::vector<const RPCRoll*> roles = (ch->rolls());
17  for (std::vector<const RPCRoll*>::const_iterator r = roles.begin(); r != roles.end(); ++r) {
18  RPCDetId rpcId = (*r)->id();
19  int region = rpcId.region();
20  if (region == 0) {
21  int wheel = rpcId.ring();
22  int sector = rpcId.sector();
23  int station = rpcId.station();
24  DTStationIndex ind(region, wheel, sector, station);
25  std::set<RPCDetId> myrolls;
26  if (rollstore.find(ind) != rollstore.end())
27  myrolls = rollstore[ind];
28  myrolls.insert(rpcId);
29  rollstore[ind] = myrolls;
30  }
31  }
32  }
33  }
34 }
35 
36 std::set<RPCDetId> const& DTObjectMap::getRolls(DTStationIndex index) const {
37  // FIXME
38  // the present inplementation allows for NOT finding the given index in the map;
39  // a muon expert should check that this is the intended behaviour.
40  static const std::set<RPCDetId> empty;
41  return (rollstore.find(index) == rollstore.end()) ? empty : rollstore.at(index);
42 }
43 
44 // register the class with the typelookup system used by the EventSetup
DTObjectMap(RPCGeometry const &rpcGeometry)
Definition: DTObjectMap.cc:12
std::set< RPCDetId > const & getRolls(DTStationIndex index) const
Definition: DTObjectMap.cc:36
int ring() const
Definition: RPCDetId.h:59
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:24
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
std::map< DTStationIndex, std::set< RPCDetId > > rollstore
Definition: DTObjectMap.h:18
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78