34 std::vector<const DccSpec*> dccs = pactCabling->
dccList();
35 for (
auto it1 : dccs) {
36 const std::vector<TriggerBoardSpec> & rmbs = it1->triggerBoards();
37 for (
auto const & it2 : rmbs) {
38 const std::vector<LinkConnSpec> & links = it2.linkConns();
39 for (
auto const & it3 : links) {
40 const std::vector<LinkBoardSpec> & lbs = it3.linkBoards();
41 for (std::vector<LinkBoardSpec>::const_iterator it4=lbs.begin(); it4 != lbs.end(); ++it4) {
45 std::string lbName = lbNameCH.substr(0,lbNameCH.size()-4);
46 const std::vector<EleIndex> & omtfEles = omtfLink2Ele.
omtfEleIndex(lbName);
49 for (
const auto & omtfEle : omtfEles ) omtf2rpc[omtfEle]= rpcEle;
56 LogTrace(
" ") <<
" SIZE OF OMTF to RPC map TRANSLATION is: " << omtf2rpc.size() << std::endl;
63 for (
const auto & omtf2rpc : omtf2rpcs) {
64 std::pair<EleIndex,EleIndex> & omtfs = pact2omtfs[omtf2rpc.second];
65 if (omtfs.first.fed()==0) omtfs.first = omtf2rpc.first;
66 else if (omtfs.second.fed()==0) omtfs.second = omtf2rpc.first;
67 else edm::LogError(
" translatePact2Omtf ") <<
" PROBLEM LinkBoardElectronicIndex already USED!!!! ";
78 for (
const auto & item : amcMap ) {
79 unsigned int fedId = item.first.getFED();
80 unsigned int amcSlot = item.first.getAMCNumber();
81 unsigned int link = item.first.getAMCInput();
85 if (fedId==1380) processorNameStr =
"OMTFn";
else processorNameStr =
"OMTFp";
86 processorNameStr += std::to_string(amcSlot/2+1);
89 std::map< unsigned int, std::string > & li2lb = link2lbName[processorName];
90 std::map< std::string, unsigned int > & lb2li = lbName2link[processorName];
94 lbName2OmtfIndex[lbName].push_back(ele);
102 LogTrace(
"")<<
" reading OmtfRpcLinksMap from: "<<fName;
104 LogTrace(
"")<<
" Unable to open file "<<fName;
106 throw std::runtime_error(
"Unable to open OmtfRpcLinksMap file " + fName);
110 while (std::getline(inFile, line)) {
111 line.erase(0, line.find_first_not_of(
" \t\r\n"));
112 if (line.empty() || !line.compare(0,2,
"--"))
continue;
113 std::stringstream ss(line);
115 unsigned int link, dbId;
116 if (ss >> processorName >> link >> lbName >> dbId) {
117 std::map< unsigned int, std::string > & li2lb = link2lbName[processorName];
118 std::map< std::string, unsigned int > & lb2li = lbName2link[processorName];
119 li2lb[link] = lbName;
120 lb2li[lbName] = link;
122 lbName2OmtfIndex[lbName].push_back(ele);
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
std::vector< const DccSpec * > dccList() const
all FEDs in map
bool operator()(const LinkBoardElectronicIndex &o1, const LinkBoardElectronicIndex &o2)
std::map< EleIndex, LinkBoardElectronicIndex > MapEleIndex2LBIndex
std::map< LinkBoardElectronicIndex, std::pair< EleIndex, EleIndex >, lessLinkBoardElectronicIndex > MapLBIndex2EleIndex
std::map< RPCAMCLink, RPCLBLink > map_type
const std::vector< EleIndex > & omtfEleIndex(const std::string &lbName) const
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void init(const edm::EventSetup &es)