Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:55

0001 #include <CondFormats/CSCObjects/interface/CSCChamberMap.h>
0002 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
0003 
0004 CSCChamberMap::CSCChamberMap() {}
0005 
0006 CSCChamberMap::~CSCChamberMap() {}
0007 
0008 const CSCMapItem::MapItem& CSCChamberMap::item(int key) const { return (ch_map.find(key))->second; }
0009 
0010 int CSCChamberMap::dbIndex(const CSCDetId& id) const {
0011   int ie = id.endcap();
0012   int is = id.station();
0013   int ir = id.ring();
0014   int ic = id.chamber();
0015   //  int il = id.layer(); // zero for parent chamber
0016 
0017   // ME1a must be reset to ME11
0018   if ((is == 1) && (ir == 4))
0019     ir = 1;
0020 
0021   return ie * 100000 + is * 10000 + ir * 1000 + ic * 10;
0022 }
0023 
0024 int CSCChamberMap::crate(const CSCDetId& id) const {
0025   int igor = dbIndex(id);
0026   CSCMapItem::MapItem mitem = this->item(igor);
0027   return mitem.crateid;
0028 }
0029 
0030 int CSCChamberMap::dmb(const CSCDetId& id) const {
0031   int igor = dbIndex(id);
0032   CSCMapItem::MapItem mitem = this->item(igor);
0033   return mitem.dmb;
0034 }
0035 
0036 int CSCChamberMap::ddu(const CSCDetId& id) const {
0037   int igor = dbIndex(id);
0038   CSCMapItem::MapItem mitem = this->item(igor);
0039   return mitem.ddu;
0040 }
0041 
0042 int CSCChamberMap::slink(const CSCDetId& id) const {
0043   int igor = dbIndex(id);
0044   CSCMapItem::MapItem mitem = this->item(igor);
0045   return mitem.slink;
0046 }
0047 
0048 int CSCChamberMap::dduSlot(const CSCDetId& id) const {
0049   int igor = dbIndex(id);
0050   CSCMapItem::MapItem mitem = this->item(igor);
0051   return mitem.ddu_slot;
0052 }
0053 
0054 int CSCChamberMap::dduInput(const CSCDetId& id) const {
0055   int igor = dbIndex(id);
0056   CSCMapItem::MapItem mitem = this->item(igor);
0057   return mitem.ddu_input;
0058 }