CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCObjectMap Class Reference

#include <CSCObjectMap.h>

Public Member Functions

 CSCObjectMap (MuonGeometryRecord const &record)
 
std::set< RPCDetId > const & getRolls (CSCStationIndex index) const
 

Private Attributes

std::map< CSCStationIndex, std::set< RPCDetId > > rollstore
 

Detailed Description

Definition at line 12 of file CSCObjectMap.h.

Constructor & Destructor Documentation

CSCObjectMap::CSCObjectMap ( MuonGeometryRecord const &  record)

Definition at line 12 of file CSCObjectMap.cc.

References RPCGeometry::dets(), edm::eventsetup::EventSetupRecord::get(), nullptr, alignCSCRings::r, RPCDetId::region(), relativeConstraints::ring, RPCDetId::ring(), rollstore, RPCGeomServ::segment(), relativeConstraints::station, and RPCDetId::station().

12  {
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 ) != nullptr ){
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 }
JetCorrectorParameters::Record record
Definition: classes.h:7
#define nullptr
int ring() const
Definition: RPCDetId.h:72
std::map< CSCStationIndex, std::set< RPCDetId > > rollstore
Definition: CSCObjectMap.h:19
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: RPCGeometry.cc:33
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96

Member Function Documentation

std::set< RPCDetId > const & CSCObjectMap::getRolls ( CSCStationIndex  index) const

Definition at line 48 of file CSCObjectMap.cc.

References relativeConstraints::empty, and rollstore.

Referenced by CSCSegtoRPC::CSCSegtoRPC(), and TracktoRPC::TracktoRPC().

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 }
std::map< CSCStationIndex, std::set< RPCDetId > > rollstore
Definition: CSCObjectMap.h:19

Member Data Documentation

std::map<CSCStationIndex,std::set<RPCDetId> > CSCObjectMap::rollstore
private

Definition at line 19 of file CSCObjectMap.h.

Referenced by CSCObjectMap(), and getRolls().