CMS 3D CMS Logo

OmtfLinkMappingRpc.h
Go to the documentation of this file.
1 #ifndef EventFilter_L1TRawToDigi_Omtf_LinkMappingRpc_H
2 #define EventFilter_L1TRawToDigi_Omtf_LinkMappingRpc_H
3 
4 #include <fstream>
5 #include <string>
6 #include <utility>
7 #include <vector>
8 #include <map>
9 
13 
14 class RPCReadOutMapping;
15 
16 namespace omtf {
17 
18  class RpcLinkMap;
19 
20  typedef std::map<EleIndex, LinkBoardElectronicIndex> MapEleIndex2LBIndex;
21  MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap& omtfLnks, const RPCReadOutMapping* pactCabling);
22 
24  bool operator()(const LinkBoardElectronicIndex& o1, const LinkBoardElectronicIndex& o2) const;
25  };
26  typedef std::map<LinkBoardElectronicIndex, std::pair<EleIndex, EleIndex>, lessLinkBoardElectronicIndex>
28  MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap& omtfLnks, const RPCReadOutMapping* pactCabling);
29 
30  class RpcLinkMap {
31  public:
33 
34  void init(const RPCAMCLinkMap& es);
35 
36  void init(const std::string& fName);
37 
38  const std::string& lbName(const std::string& board, unsigned int link) const {
39  return link2lbName.at(board).at(link);
40  }
41 
42  unsigned int link(const std::string& board, const std::string& lbName) const {
43  return lbName2link.at(board).at(lbName);
44  }
45 
46  std::vector<EleIndex> omtfEleIndex(const std::string& lbName) const;
47 
48  private:
49  std::map<std::string, std::map<unsigned int, std::string> > link2lbName; //[processorName][rpcRxNum] - lbName
50  std::map<std::string, std::map<std::string, unsigned int> > lbName2link; //[processorName][lbName] - rpcRxNum
51  std::map<std::string, std::vector<EleIndex> > lbName2OmtfIndex; //[lbName] - vector of {board,rpcRxNum}
52  };
53 
54 } // namespace omtf
55 #endif
std::vector< EleIndex > omtfEleIndex(const std::string &lbName) const
std::map< std::string, std::map< unsigned int, std::string > > link2lbName
std::map< std::string, std::vector< EleIndex > > lbName2OmtfIndex
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
std::map< LinkBoardElectronicIndex, std::pair< EleIndex, EleIndex >, lessLinkBoardElectronicIndex > MapLBIndex2EleIndex
std::map< EleIndex, LinkBoardElectronicIndex > MapEleIndex2LBIndex
std::map< std::string, std::map< std::string, unsigned int > > lbName2link
unsigned int link(const std::string &board, const std::string &lbName) const
bool operator()(const LinkBoardElectronicIndex &o1, const LinkBoardElectronicIndex &o2) const
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
const std::string & lbName(const std::string &board, unsigned int link) const
void init(const RPCAMCLinkMap &es)