CMS 3D CMS Logo

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