CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Attributes
ObjectMap2CSC Class Reference

#include <TracktoRPC.h>

Public Member Functions

std::set< RPCDetIdGetRolls (CSCStationIndex2 cscstationindex)
 
 ObjectMap2CSC (const edm::EventSetup &iSetup)
 

Static Public Member Functions

static ObjectMap2CSCGetInstance (const edm::EventSetup &iSetup)
 

Public Attributes

std::map< CSCStationIndex2,
std::set< RPCDetId > > 
rollstoreCSC
 

Static Private Attributes

static ObjectMap2CSCmapInstance = NULL
 

Detailed Description

Definition at line 154 of file TracktoRPC.h.

Constructor & Destructor Documentation

ObjectMap2CSC::ObjectMap2CSC ( const edm::EventSetup iSetup)

Definition at line 82 of file TracktoRPC.cc.

References edm::EventSetup::get(), csvReporter::r, RPCDetId::region(), relativeConstraints::ring, RPCDetId::ring(), RPCChamber::rolls(), rollstoreCSC, RPCGeomServ::segment(), relativeConstraints::station, and RPCDetId::station().

Referenced by GetInstance().

82  {
85 
86  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
87  iSetup.get<MuonGeometryRecord>().get(cscGeo);
88 
89  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
90  if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
91  RPCChamber* ch = dynamic_cast< RPCChamber* >( *it );
92  std::vector< const RPCRoll*> roles = (ch->rolls());
93  for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
94  RPCDetId rpcId = (*r)->id();
95  int region=rpcId.region();
96  if(region!=0){
97  int station=rpcId.station();
98  int ring=rpcId.ring();
99  int cscring=ring;
100  int cscstation=station;
101  RPCGeomServ rpcsrv(rpcId);
102  int rpcsegment = rpcsrv.segment();
103  int cscchamber = rpcsegment; //FIX THIS ACCORDING TO RPCGeomServ::segment()Definition
104  if((station==2||station==3)&&ring==3){//Adding Ring 3 of RPC to the CSC Ring 2
105  cscring = 2;
106  }
107  CSCStationIndex2 ind(region,cscstation,cscring,cscchamber);
108  std::set<RPCDetId> myrolls;
109  if (rollstoreCSC.find(ind)!=rollstoreCSC.end()) myrolls=rollstoreCSC[ind];
110  myrolls.insert(rpcId);
111  rollstoreCSC[ind]=myrolls;
112  }
113  }
114  }
115  }
116 }
int ring() const
Definition: RPCDetId.h:74
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:70
const T & get() const
Definition: EventSetup.h:55
std::map< CSCStationIndex2, std::set< RPCDetId > > rollstoreCSC
Definition: TracktoRPC.h:159
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
int station() const
Definition: RPCDetId.h:98

Member Function Documentation

ObjectMap2CSC * ObjectMap2CSC::GetInstance ( const edm::EventSetup iSetup)
static

Definition at line 75 of file TracktoRPC.cc.

References mapInstance, NULL, and ObjectMap2CSC().

Referenced by TracktoRPC::TracktoRPC().

75  {
76  if (mapInstance == NULL){
77  mapInstance = new ObjectMap2CSC(iSetup);
78  }
79  return mapInstance;
80 }
ObjectMap2CSC(const edm::EventSetup &iSetup)
Definition: TracktoRPC.cc:82
#define NULL
Definition: scimark2.h:8
static ObjectMap2CSC * mapInstance
Definition: TracktoRPC.h:162
std::set<RPCDetId> ObjectMap2CSC::GetRolls ( CSCStationIndex2  cscstationindex)
inline

Definition at line 157 of file TracktoRPC.h.

References mapInstance, and rollstoreCSC.

Referenced by TracktoRPC::TracktoRPC().

157 {return mapInstance->rollstoreCSC[cscstationindex];}
static ObjectMap2CSC * mapInstance
Definition: TracktoRPC.h:162
std::map< CSCStationIndex2, std::set< RPCDetId > > rollstoreCSC
Definition: TracktoRPC.h:159

Member Data Documentation

ObjectMap2CSC * ObjectMap2CSC::mapInstance = NULL
staticprivate

Definition at line 162 of file TracktoRPC.h.

Referenced by GetInstance(), and GetRolls().

std::map<CSCStationIndex2,std::set<RPCDetId> > ObjectMap2CSC::rollstoreCSC

Definition at line 159 of file TracktoRPC.h.

Referenced by GetRolls(), and ObjectMap2CSC().