CMS 3D CMS Logo

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

#include <CSCObjectMap.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 11 of file CSCObjectMap.h.

Constructor & Destructor Documentation

◆ CSCObjectMap()

CSCObjectMap::CSCObjectMap ( RPCGeometry const &  rpcGeom)

Definition at line 11 of file CSCObjectMap.cc.

References RPCGeometry::dets(), alignCSCRings::r, RPCDetId::region(), HLT_2022v12_cff::region, RPCDetId::ring(), relativeConstraints::ring, rollstore, RPCGeomServ::segment(), relativeConstraints::station, and RPCDetId::station().

11  {
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 }
int ring() const
Definition: RPCDetId.h:59
int station() const
Definition: RPCDetId.h:78
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
std::map< CSCStationIndex, std::set< RPCDetId > > rollstore
Definition: CSCObjectMap.h:18

Member Function Documentation

◆ getRolls()

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

Definition at line 42 of file CSCObjectMap.cc.

References relativeConstraints::empty, and rollstore.

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

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

Member Data Documentation

◆ rollstore

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

Definition at line 18 of file CSCObjectMap.h.

Referenced by CSCObjectMap(), and getRolls().