CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCObjectMap.cc
Go to the documentation of this file.
11 
14  record.get(rpcGeo);
15 
17  record.get(cscGeo);
18 
19  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
20  if(dynamic_cast< const RPCChamber* >( *it ) != 0 ){
21  auto ch = dynamic_cast< const RPCChamber* >( *it );
22  std::vector< const RPCRoll*> roles = (ch->rolls());
23  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
24  RPCDetId rpcId = (*r)->id();
25  int region=rpcId.region();
26  if(region!=0){
27  int station=rpcId.station();
28  int ring=rpcId.ring();
29  int cscring=ring;
30  int cscstation=station;
31  RPCGeomServ rpcsrv(rpcId);
32  int rpcsegment = rpcsrv.segment();
33  int cscchamber = rpcsegment; //FIX THIS ACCORDING TO RPCGeomServ::segment()Definition
34  if((station==2||station==3)&&ring==3){//Adding Ring 3 of RPC to the CSC Ring 2
35  cscring = 2;
36  }
37  CSCStationIndex ind(region,cscstation,cscring,cscchamber);
38  std::set<RPCDetId> myrolls;
39  if (rollstore.find(ind)!=rollstore.end()) myrolls=rollstore[ind];
40  myrolls.insert(rpcId);
41  rollstore[ind]=myrolls;
42  }
43  }
44  }
45  }
46 }
47 
48 std::set<RPCDetId> const& CSCObjectMap::getRolls(CSCStationIndex index) const
49 {
50  // FIXME
51  // the present inplementation allows for NOT finding the given index in the map;
52  // a muon expert should check that this is the intended behaviour.
53  static const std::set<RPCDetId> empty;
54  return (rollstore.find(index) == rollstore.end()) ? empty : rollstore.at(index);
55 }
56 
57 // register the class with the typelookup system used by the EventSetup
JetCorrectorParameters::Record record
Definition: classes.h:7
std::set< RPCDetId > const & getRolls(CSCStationIndex index) const
Definition: CSCObjectMap.cc:48
int ring() const
Definition: RPCDetId.h:72
void get(HolderT &iHolder) const
std::map< CSCStationIndex, std::set< RPCDetId > > rollstore
Definition: CSCObjectMap.h:19
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:96
virtual int segment()
Definition: RPCGeomServ.cc:467
CSCObjectMap(MuonGeometryRecord const &record)
Definition: CSCObjectMap.cc:12
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96