CMS 3D CMS Logo

CSCObjectMap.cc
Go to the documentation of this file.
8 #include "CSCObjectMap.h"
9 #include "CSCStationIndex.h"
10 
12  for (TrackingGeometry::DetContainer::const_iterator it = rpcGeo.dets().begin(); it < rpcGeo.dets().end(); it++) {
13  if (dynamic_cast<const RPCChamber*>(*it) != nullptr) {
14  auto ch = dynamic_cast<const RPCChamber*>(*it);
15  std::vector<const RPCRoll*> roles = (ch->rolls());
16  for (std::vector<const RPCRoll*>::const_iterator r = roles.begin(); r != roles.end(); ++r) {
17  RPCDetId rpcId = (*r)->id();
18  int region = rpcId.region();
19  if (region != 0) {
20  int station = rpcId.station();
21  int ring = rpcId.ring();
22  int cscring = ring;
23  int cscstation = station;
24  RPCGeomServ rpcsrv(rpcId);
25  int rpcsegment = rpcsrv.segment();
26  int cscchamber = rpcsegment; //FIX THIS ACCORDING TO RPCGeomServ::segment()Definition
27  if ((station == 2 || station == 3 || station == 4) && ring == 3) { //Adding Ring 3 of RPC to the CSC Ring 2
28  cscring = 2;
29  }
30  CSCStationIndex ind(region, cscstation, cscring, cscchamber);
31  std::set<RPCDetId> myrolls;
32  if (rollstore.find(ind) != rollstore.end())
33  myrolls = rollstore[ind];
34  myrolls.insert(rpcId);
35  rollstore[ind] = myrolls;
36  }
37  }
38  }
39  }
40 }
41 
42 std::set<RPCDetId> const& CSCObjectMap::getRolls(CSCStationIndex index) const {
43  // FIXME
44  // the present inplementation allows for NOT finding the given index in the map;
45  // a muon expert should check that this is the intended behaviour.
46  static const std::set<RPCDetId> empty;
47  return (rollstore.find(index) == rollstore.end()) ? empty : rollstore.at(index);
48 }
49 
50 // register the class with the typelookup system used by the EventSetup
int ring() const
Definition: RPCDetId.h:59
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:24
virtual int segment()
Definition: RPCGeomServ.cc:361
CSCObjectMap(RPCGeometry const &rpcGeom)
Definition: CSCObjectMap.cc:11
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
std::map< CSCStationIndex, std::set< RPCDetId > > rollstore
Definition: CSCObjectMap.h:18
std::set< RPCDetId > const & getRolls(CSCStationIndex index) const
Definition: CSCObjectMap.cc:42