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 
12 
13 class RPCReadOutMapping;
14 namespace edm { class EventSetup; }
15 
16 namespace omtf {
17 
18  class RpcLinkMap;
19 
20 
21  typedef std::map<EleIndex, LinkBoardElectronicIndex> MapEleIndex2LBIndex;
22  MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap & omtfLnks, const RPCReadOutMapping* pactCabling);
23 
24  struct lessLinkBoardElectronicIndex { bool operator() (const LinkBoardElectronicIndex & o1, const LinkBoardElectronicIndex & o2) const; };
25  typedef std::map<LinkBoardElectronicIndex, std::pair<EleIndex,EleIndex>, lessLinkBoardElectronicIndex > MapLBIndex2EleIndex;
26  MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap & omtfLnks, const RPCReadOutMapping* pactCabling);
27 
28 class RpcLinkMap {
29 public:
30  RpcLinkMap() { }
31 
32  void init(const edm::EventSetup& es);
33 
34  void init( const std::string& fName);
35 
36  const std::string & lbName(const std::string& board, unsigned int link) const { return link2lbName.at(board).at(link); }
37 
38  unsigned int link(const std::string& board, const std::string& lbName) const { return lbName2link.at(board).at(lbName); }
39 
40  std::vector<EleIndex> omtfEleIndex ( const std::string& lbName) const;
41 
42 private:
43  std::map<std::string, std::map<unsigned int, std::string> > link2lbName; //[processorName][rpcRxNum] - lbName
44  std::map<std::string, std::map<std::string, unsigned int> > lbName2link; //[processorName][lbName] - rpcRxNum
45  std::map<std::string, std::vector<EleIndex> > lbName2OmtfIndex; //[lbName] - vector of {board,rpcRxNum}
46 
47 };
48 
49 } // namespace omtf
50 #endif
unsigned int link(const std::string &board, 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)
int init
Definition: HydjetWrapper.h:67
std::map< EleIndex, LinkBoardElectronicIndex > MapEleIndex2LBIndex
std::map< std::string, std::map< std::string, unsigned int > > lbName2link
std::map< LinkBoardElectronicIndex, std::pair< EleIndex, EleIndex >, lessLinkBoardElectronicIndex > MapLBIndex2EleIndex
const std::string & lbName(const std::string &board, unsigned int link) const
HLT enums.
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)