CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Attributes

ObjectMapCSC Class Reference

#include <CSCSegtoRPC.h>

List of all members.

Public Member Functions

std::set< RPCDetIdGetRolls (CSCStationIndex cscstationindex)
 ObjectMapCSC (const edm::EventSetup &iSetup)

Static Public Member Functions

static ObjectMapCSCGetInstance (const edm::EventSetup &iSetup)

Public Attributes

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

Static Private Attributes

static ObjectMapCSCmapInstance = NULL

Detailed Description

Definition at line 55 of file CSCSegtoRPC.h.


Constructor & Destructor Documentation

ObjectMapCSC::ObjectMapCSC ( const edm::EventSetup iSetup)

Definition at line 23 of file CSCSegtoRPC.cc.

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

Referenced by GetInstance().

                                                     {
  edm::ESHandle<RPCGeometry> rpcGeo;
  edm::ESHandle<CSCGeometry> cscGeo;
  
  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
  iSetup.get<MuonGeometryRecord>().get(cscGeo);
  
  for (TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
    if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
      RPCChamber* ch = dynamic_cast< RPCChamber* >( *it ); 
      std::vector< const RPCRoll*> roles = (ch->rolls());
      for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
        RPCDetId rpcId = (*r)->id();
        int region=rpcId.region();
        if(region!=0){
          int station=rpcId.station();
          int ring=rpcId.ring();
          int cscring=ring;
          int cscstation=station;
          RPCGeomServ rpcsrv(rpcId);
          int rpcsegment = rpcsrv.segment();
          int cscchamber = rpcsegment; //FIX THIS ACCORDING TO RPCGeomServ::segment()Definition
          if((station==2||station==3)&&ring==3){//Adding Ring 3 of RPC to the CSC Ring 2
            cscring = 2;
          }
          CSCStationIndex ind(region,cscstation,cscring,cscchamber);
          std::set<RPCDetId> myrolls;
          if (rollstoreCSC.find(ind)!=rollstoreCSC.end()) myrolls=rollstoreCSC[ind];
          myrolls.insert(rpcId);
          rollstoreCSC[ind]=myrolls;
        }
      }
    }
  }
}

Member Function Documentation

ObjectMapCSC * ObjectMapCSC::GetInstance ( const edm::EventSetup iSetup) [static]

Definition at line 16 of file CSCSegtoRPC.cc.

References mapInstance, NULL, and ObjectMapCSC().

Referenced by CSCSegtoRPC::CSCSegtoRPC().

                                                                  {
  if (mapInstance == NULL){
    mapInstance = new ObjectMapCSC(iSetup);
  }
  return mapInstance;
}
std::set<RPCDetId> ObjectMapCSC::GetRolls ( CSCStationIndex  cscstationindex) [inline]

Definition at line 58 of file CSCSegtoRPC.h.

References mapInstance, and rollstoreCSC.

Referenced by CSCSegtoRPC::CSCSegtoRPC().

{return mapInstance->rollstoreCSC[cscstationindex];}

Member Data Documentation

ObjectMapCSC * ObjectMapCSC::mapInstance = NULL [static, private]

Definition at line 63 of file CSCSegtoRPC.h.

Referenced by GetInstance(), and GetRolls().

Definition at line 60 of file CSCSegtoRPC.h.

Referenced by GetRolls(), and ObjectMapCSC().