Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:19

0001 /**
0002  * \class L1GtBoardMaps
0003  *
0004  *
0005  * Description: map of the L1 GT boards.
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  *
0012  * $Date$
0013  * $Revision$
0014  *
0015  */
0016 
0017 // this class header
0018 #include "CondFormats/L1TObjects/interface/L1GtBoardMaps.h"
0019 
0020 // system include files
0021 #include <iostream>
0022 #include <iomanip>
0023 
0024 // user include files
0025 
0026 // forward declarations
0027 
0028 // constructor
0029 L1GtBoardMaps::L1GtBoardMaps() {
0030   // empty
0031 }
0032 
0033 // destructor
0034 L1GtBoardMaps::~L1GtBoardMaps() {
0035   // empty
0036 }
0037 
0038 // set / print the L1 GT board map
0039 void L1GtBoardMaps::setGtBoardMaps(const std::vector<L1GtBoard>& gtBoardMapsValue) { m_gtBoardMaps = gtBoardMapsValue; }
0040 
0041 void L1GtBoardMaps::print(std::ostream& myCout) const {
0042   myCout << "\nL1 GT board map" << std::endl;
0043 
0044   myCout << "  Size: " << m_gtBoardMaps.size() << " boards in L1 GT." << std::endl;
0045 
0046   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0047     cIt->print(myCout);
0048     myCout << std::endl;
0049   }
0050 
0051   myCout << std::endl;
0052 }
0053 
0054 // print L1 GT DAQ record map
0055 void L1GtBoardMaps::printGtDaqRecordMap(std::ostream& myCout) const {
0056   myCout << "\nL1 GT DAQ record map" << std::endl;
0057 
0058   int nrBoards = 0;
0059   int posRec = -1;
0060   uint16_t boardId = 0;
0061   std::string boardName;
0062 
0063   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0064     posRec = cIt->gtPositionDaqRecord();
0065     boardId = cIt->gtBoardId();
0066     boardName = cIt->gtBoardName();
0067 
0068     if (posRec >= 0) {
0069       myCout << "  " << boardName << "  " << std::hex << boardId << std::dec << " at position " << posRec << std::endl;
0070 
0071       nrBoards++;
0072     }
0073   }
0074 
0075   myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
0076   myCout << "  Header and trailer are automatically added to the hardware record.\n" << std::endl;
0077 
0078   myCout << std::endl;
0079 }
0080 
0081 // print L1 GT EVM record map
0082 void L1GtBoardMaps::printGtEvmRecordMap(std::ostream& myCout) const {
0083   myCout << "\nL1 GT EVM record map" << std::endl;
0084 
0085   int nrBoards = 0;
0086   int posRec = -1;
0087   uint16_t boardId = 0;
0088   std::string boardName;
0089 
0090   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0091     posRec = cIt->gtPositionEvmRecord();
0092     boardId = cIt->gtBoardId();
0093     boardName = cIt->gtBoardName();
0094 
0095     if (posRec >= 0) {
0096       myCout << "  " << boardName << "  " << std::hex << boardId << std::dec << " at position " << posRec << std::endl;
0097 
0098       nrBoards++;
0099     }
0100   }
0101 
0102   myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
0103   myCout << "  Header and trailer are automatically added to the hardware record.\n" << std::endl;
0104 
0105   myCout << std::endl;
0106 }
0107 
0108 // print L1 GT active boards map for DAQ record
0109 void L1GtBoardMaps::printGtDaqActiveBoardsMap(std::ostream& myCout) const {
0110   myCout << "\nL1 GT DAQ \"active boards\" record map" << std::endl;
0111 
0112   int nrBoards = 0;
0113   int posRec = -1;
0114   uint16_t boardId = 0;
0115   std::string boardName;
0116 
0117   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0118     posRec = cIt->gtBitDaqActiveBoards();
0119     boardId = cIt->gtBoardId();
0120     boardName = cIt->gtBoardName();
0121 
0122     if (posRec >= 0) {
0123       myCout << "  " << boardName << "  " << std::hex << boardId << std::dec << " at bit " << posRec << std::endl;
0124 
0125       nrBoards++;
0126     }
0127   }
0128 
0129   myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
0130   myCout << std::endl;
0131 
0132   myCout << std::endl;
0133 }
0134 
0135 // print L1 GT active boards map for EVM record
0136 void L1GtBoardMaps::printGtEvmActiveBoardsMap(std::ostream& myCout) const {
0137   myCout << "\nL1 GT EVM \"active boards\" record map" << std::endl;
0138 
0139   int nrBoards = 0;
0140   int posRec = -1;
0141   uint16_t boardId = 0;
0142   std::string boardName;
0143 
0144   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0145     posRec = cIt->gtBitEvmActiveBoards();
0146     boardId = cIt->gtBoardId();
0147     boardName = cIt->gtBoardName();
0148 
0149     if (posRec >= 0) {
0150       myCout << "  " << boardName << "  " << std::hex << boardId << std::dec << " at bit " << posRec << std::endl;
0151 
0152       nrBoards++;
0153     }
0154   }
0155 
0156   myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
0157   myCout << std::endl;
0158 
0159   myCout << std::endl;
0160 }
0161 
0162 // print L1 GT board - slot map
0163 void L1GtBoardMaps::printGtBoardSlotMap(std::ostream& myCout) const {
0164   myCout << "\nL1 GT board - slot map" << std::endl;
0165 
0166   int nrBoards = 0;
0167   int posRec = -1;
0168   uint16_t boardId = 0;
0169   std::string boardName;
0170 
0171   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0172     posRec = cIt->gtBoardSlot();
0173     boardId = cIt->gtBoardId();
0174     boardName = cIt->gtBoardName();
0175 
0176     if (posRec >= 0) {
0177       myCout << "  " << boardName << "  " << std::hex << boardId << std::dec << " in slot " << posRec << std::endl;
0178 
0179       nrBoards++;
0180     }
0181   }
0182 
0183   myCout << "\n  Size: " << nrBoards << " boards in the slot map" << std::endl;
0184   myCout << std::endl;
0185 
0186   myCout << std::endl;
0187 }
0188 
0189 // print L1 GT board name in hw record map
0190 void L1GtBoardMaps::printGtBoardHexNameMap(std::ostream& myCout) const {
0191   myCout << "\nL1 GT board names in hw record map" << std::endl;
0192 
0193   int nrBoards = 0;
0194   int posRec = -1;
0195   uint16_t boardId = 0;
0196   std::string boardName;
0197 
0198   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0199     posRec = cIt->gtBoardHexName();
0200     boardId = cIt->gtBoardId();
0201     boardName = cIt->gtBoardName();
0202 
0203     if (posRec >= 0) {
0204       myCout << "  " << boardName << "  " << std::hex << boardId << std::dec << " has HexName " << std::hex << posRec
0205              << std::dec << std::endl;
0206 
0207       nrBoards++;
0208     }
0209   }
0210 
0211   myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
0212   myCout << std::endl;
0213 
0214   myCout << std::endl;
0215 }
0216 
0217 // print L1 quadruplet (4x16 bits)(cable) to PSB input map
0218 void L1GtBoardMaps::printGtQuadToPsbMap(std::ostream& myCout) const {
0219   myCout << "\nL1 GT \"cables to PSB\" input map (4x16 bits per cable) - DEPRECATED" << std::endl;
0220 
0221   int nrBoards = 0;
0222   int nrCable = 0;
0223 
0224   for (std::vector<L1GtBoard>::const_iterator cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
0225     if (cIt->gtBoardType() == PSB) {
0226       myCout << "\n  PSB_" << cIt->gtBoardIndex() << "\n      ";
0227 
0228       nrBoards++;
0229 
0230       std::vector<L1GtPsbQuad> quadInPsb = cIt->gtQuadInPsb();
0231       std::string objType;
0232 
0233       for (std::vector<L1GtPsbQuad>::const_iterator cItQuad = quadInPsb.begin(); cItQuad != quadInPsb.end();
0234            ++cItQuad) {
0235         nrCable++;
0236 
0237         if (*cItQuad == TechTr) {
0238           objType = "TechTr";
0239         } else if (*cItQuad == IsoEGQ) {
0240           objType = "IsoEGQ";
0241         } else if (*cItQuad == NoIsoEGQ) {
0242           objType = "NoIsoEGQ";
0243         } else if (*cItQuad == CenJetQ) {
0244           objType = "CenJetQ";
0245         } else if (*cItQuad == ForJetQ) {
0246           objType = "ForJetQ";
0247         } else if (*cItQuad == TauJetQ) {
0248           objType = "TauJetQ";
0249         } else if (*cItQuad == ESumsQ) {
0250           objType = "ESumsQ";
0251         } else if (*cItQuad == JetCountsQ) {
0252           objType = "JetCountsQ";
0253         } else if (*cItQuad == MQB1) {
0254           objType = "MQB1";
0255         } else if (*cItQuad == MQB2) {
0256           objType = "MQB2";
0257         } else if (*cItQuad == MQF3) {
0258           objType = "MQF3";
0259         } else if (*cItQuad == MQF4) {
0260           objType = "MQF4";
0261         } else if (*cItQuad == MQB5) {
0262           objType = "MQB5";
0263         } else if (*cItQuad == MQB6) {
0264           objType = "MQB6";
0265         } else if (*cItQuad == MQF7) {
0266           objType = "MQF7";
0267         } else if (*cItQuad == MQF8) {
0268           objType = "MQF8";
0269         } else if (*cItQuad == MQB9) {
0270           objType = "MQB9";
0271         } else if (*cItQuad == MQB10) {
0272           objType = "MQB10";
0273         } else if (*cItQuad == MQF11) {
0274           objType = "MQF11";
0275         } else if (*cItQuad == MQF12) {
0276           objType = "MQF12";
0277         } else if (*cItQuad == Free) {
0278           objType = "Free";
0279         } else if (*cItQuad == HfQ) {
0280           objType = "HfQ";
0281         } else {
0282           myCout << "\n\nError: no such member " << (*cItQuad) << " in enum L1GtPsbQuad\n\n" << std::endl;
0283           objType = "ERROR";
0284         }
0285 
0286         myCout << objType << " ";
0287       }
0288     }
0289   }
0290 
0291   myCout << "\n\n  Size: " << nrCable << " cables for " << nrBoards << " PSB boards" << std::endl;
0292 
0293   myCout << std::endl;
0294 }
0295 
0296 // output stream operator
0297 std::ostream& operator<<(std::ostream& os, const L1GtBoardMaps& result) {
0298   result.print(os);
0299   return os;
0300 }