CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/CondFormats/L1TObjects/src/L1GtBoardMaps.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "CondFormats/L1TObjects/interface/L1GtBoardMaps.h"
00019 
00020 // system include files
00021 #include <iostream>
00022 #include <iomanip>
00023 
00024 // user include files
00025 
00026 // forward declarations
00027 
00028 // constructor
00029 L1GtBoardMaps::L1GtBoardMaps()
00030 {
00031     // empty
00032 }
00033 
00034 // destructor
00035 L1GtBoardMaps::~L1GtBoardMaps()
00036 {
00037     // empty
00038 }
00039 
00040 
00041 
00042 // set / print the L1 GT board map
00043 void L1GtBoardMaps::setGtBoardMaps(const std::vector<L1GtBoard>& gtBoardMapsValue)
00044 {
00045 
00046     m_gtBoardMaps = gtBoardMapsValue;
00047 
00048 }
00049 
00050 void L1GtBoardMaps::print(std::ostream& myCout) const
00051 {
00052     myCout <<  "\nL1 GT board map" << std::endl;
00053 
00054     myCout <<  "  Size: " << m_gtBoardMaps.size() << " boards in L1 GT." << std::endl;
00055 
00056     for (std::vector<L1GtBoard>::const_iterator
00057             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00058 
00059         cIt->print(myCout);
00060         myCout << std::endl;
00061     }
00062 
00063     myCout << std::endl;
00064 
00065 }
00066 
00067 // print L1 GT DAQ record map
00068 void L1GtBoardMaps::printGtDaqRecordMap(std::ostream& myCout) const
00069 {
00070     myCout << "\nL1 GT DAQ record map" << std::endl;
00071 
00072     int nrBoards = 0;
00073     int posRec = -1;
00074     boost::uint16_t boardId = 0;
00075     std::string boardName;
00076 
00077     for (std::vector<L1GtBoard>::const_iterator
00078             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00079 
00080         posRec = cIt->gtPositionDaqRecord();
00081         boardId = cIt->gtBoardId();
00082         boardName = cIt->gtBoardName();
00083 
00084         if (posRec >=0) {
00085             myCout
00086             << "  " << boardName << "  " << std::hex << boardId << std::dec
00087             << " at position " << posRec << std::endl;
00088 
00089             nrBoards++;
00090         }
00091     }
00092 
00093     myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
00094     myCout << "  Header and trailer are automatically added to the hardware record.\n"
00095     << std::endl;
00096 
00097 
00098     myCout << std::endl;
00099 
00100 }
00101 
00102 // print L1 GT EVM record map
00103 void L1GtBoardMaps::printGtEvmRecordMap(std::ostream& myCout) const
00104 {
00105     myCout << "\nL1 GT EVM record map" << std::endl;
00106 
00107     int nrBoards = 0;
00108     int posRec = -1;
00109     boost::uint16_t boardId = 0;
00110     std::string boardName;
00111 
00112     for (std::vector<L1GtBoard>::const_iterator
00113             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00114 
00115         posRec = cIt->gtPositionEvmRecord();
00116         boardId = cIt->gtBoardId();
00117         boardName = cIt->gtBoardName();
00118 
00119         if (posRec >=0) {
00120             myCout
00121             << "  " << boardName << "  " << std::hex << boardId << std::dec
00122             << " at position " << posRec << std::endl;
00123 
00124             nrBoards++;
00125         }
00126     }
00127 
00128     myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
00129     myCout << "  Header and trailer are automatically added to the hardware record.\n"
00130     << std::endl;
00131 
00132 
00133     myCout << std::endl;
00134 
00135 }
00136 
00137 // print L1 GT active boards map for DAQ record
00138 void L1GtBoardMaps::printGtDaqActiveBoardsMap(std::ostream& myCout) const
00139 {
00140     myCout << "\nL1 GT DAQ \"active boards\" record map" << std::endl;
00141 
00142     int nrBoards = 0;
00143     int posRec = -1;
00144     boost::uint16_t boardId = 0;
00145     std::string boardName;
00146 
00147     for (std::vector<L1GtBoard>::const_iterator
00148             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00149 
00150         posRec = cIt->gtBitDaqActiveBoards();
00151         boardId = cIt->gtBoardId();
00152         boardName = cIt->gtBoardName();
00153 
00154         if (posRec >=0) {
00155             myCout
00156             << "  " << boardName << "  " << std::hex << boardId << std::dec
00157             << " at bit " << posRec << std::endl;
00158 
00159             nrBoards++;
00160         }
00161     }
00162 
00163     myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
00164     myCout << std::endl;
00165 
00166 
00167     myCout << std::endl;
00168 
00169 }
00170 
00171 // print L1 GT active boards map for EVM record
00172 void L1GtBoardMaps::printGtEvmActiveBoardsMap(std::ostream& myCout) const
00173 {
00174     myCout << "\nL1 GT EVM \"active boards\" record map" << std::endl;
00175 
00176     int nrBoards = 0;
00177     int posRec = -1;
00178     boost::uint16_t boardId = 0;
00179     std::string boardName;
00180 
00181     for (std::vector<L1GtBoard>::const_iterator
00182             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00183 
00184         posRec = cIt->gtBitEvmActiveBoards();
00185         boardId = cIt->gtBoardId();
00186         boardName = cIt->gtBoardName();
00187 
00188         if (posRec >=0) {
00189             myCout
00190             << "  " << boardName << "  " << std::hex << boardId << std::dec
00191             << " at bit " << posRec << std::endl;
00192 
00193             nrBoards++;
00194         }
00195     }
00196 
00197     myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
00198     myCout << std::endl;
00199 
00200 
00201     myCout << std::endl;
00202 
00203 }
00204 
00205 
00206 // print L1 GT board - slot map
00207 void L1GtBoardMaps::printGtBoardSlotMap(std::ostream& myCout) const
00208 {
00209     myCout << "\nL1 GT board - slot map" << std::endl;
00210 
00211     int nrBoards = 0;
00212     int posRec = -1;
00213     boost::uint16_t boardId = 0;
00214     std::string boardName;
00215 
00216     for (std::vector<L1GtBoard>::const_iterator
00217             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00218 
00219         posRec = cIt->gtBoardSlot();
00220         boardId = cIt->gtBoardId();
00221         boardName = cIt->gtBoardName();
00222 
00223         if (posRec >=0) {
00224             myCout
00225             << "  " << boardName << "  " << std::hex << boardId << std::dec
00226             << " in slot " << posRec << std::endl;
00227 
00228             nrBoards++;
00229         }
00230     }
00231 
00232     myCout << "\n  Size: " << nrBoards << " boards in the slot map" << std::endl;
00233     myCout << std::endl;
00234 
00235 
00236     myCout << std::endl;
00237 
00238 }
00239 
00240 // print L1 GT board name in hw record map
00241 void L1GtBoardMaps::printGtBoardHexNameMap(std::ostream& myCout) const
00242 {
00243     myCout << "\nL1 GT board names in hw record map" << std::endl;
00244 
00245     int nrBoards = 0;
00246     int posRec = -1;
00247     boost::uint16_t boardId = 0;
00248     std::string boardName;
00249 
00250     for (std::vector<L1GtBoard>::const_iterator
00251             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00252 
00253         posRec = cIt->gtBoardHexName();
00254         boardId = cIt->gtBoardId();
00255         boardName = cIt->gtBoardName();
00256 
00257         if (posRec >=0) {
00258             myCout
00259             << "  " << boardName << "  " << std::hex << boardId << std::dec
00260             << " has HexName " << std::hex << posRec << std::dec << std::endl;
00261 
00262             nrBoards++;
00263         }
00264     }
00265 
00266     myCout << "\n  Size: " << nrBoards << " boards in the record" << std::endl;
00267     myCout << std::endl;
00268 
00269 
00270     myCout << std::endl;
00271 
00272 }
00273 
00274 // print L1 quadruplet (4x16 bits)(cable) to PSB input map
00275 void L1GtBoardMaps::printGtQuadToPsbMap(std::ostream& myCout) const
00276 {
00277 
00278     myCout << "\nL1 GT \"cables to PSB\" input map (4x16 bits per cable) - DEPRECATED" << std::endl;
00279 
00280     int nrBoards = 0;
00281     int nrCable = 0;
00282 
00283     for (std::vector<L1GtBoard>::const_iterator
00284             cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
00285 
00286         if (cIt->gtBoardType() == PSB) {
00287 
00288             myCout << "\n  PSB_" << cIt->gtBoardIndex() << "\n      ";
00289 
00290             nrBoards++;
00291 
00292             std::vector<L1GtPsbQuad> quadInPsb = cIt->gtQuadInPsb();
00293             std::string objType;
00294 
00295             for (std::vector<L1GtPsbQuad>::const_iterator
00296                     cItQuad = quadInPsb.begin(); cItQuad != quadInPsb.end(); ++cItQuad) {
00297 
00298                 nrCable++;
00299 
00300                 if ( *cItQuad == TechTr ) {
00301                     objType = "TechTr";
00302                 } else if ( *cItQuad == IsoEGQ ) {
00303                     objType = "IsoEGQ";
00304                 } else if ( *cItQuad == NoIsoEGQ ) {
00305                     objType = "NoIsoEGQ";
00306                 } else if ( *cItQuad == CenJetQ ) {
00307                     objType = "CenJetQ";
00308                 } else if ( *cItQuad == ForJetQ ) {
00309                     objType = "ForJetQ";
00310                 } else if ( *cItQuad == TauJetQ ) {
00311                     objType = "TauJetQ";
00312                 } else if ( *cItQuad == ESumsQ ) {
00313                     objType = "ESumsQ";
00314                 } else if ( *cItQuad == JetCountsQ ) {
00315                     objType = "JetCountsQ";
00316                 } else if ( *cItQuad == MQB1 ) {
00317                     objType = "MQB1";
00318                 } else if ( *cItQuad == MQB2 ) {
00319                     objType = "MQB2";
00320                 } else if ( *cItQuad == MQF3 ) {
00321                     objType = "MQF3";
00322                 } else if ( *cItQuad == MQF4 ) {
00323                     objType = "MQF4";
00324                 } else if ( *cItQuad == MQB5 ) {
00325                     objType = "MQB5";
00326                 } else if ( *cItQuad == MQB6 ) {
00327                     objType = "MQB6";
00328                 } else if ( *cItQuad == MQF7 ) {
00329                     objType = "MQF7";
00330                 } else if ( *cItQuad == MQF8 ) {
00331                     objType = "MQF8";
00332                 } else if ( *cItQuad == MQB9 ) {
00333                     objType = "MQB9";
00334                 } else if ( *cItQuad == MQB10 ) {
00335                     objType = "MQB10";
00336                 } else if ( *cItQuad == MQF11 ) {
00337                     objType = "MQF11";
00338                 } else if ( *cItQuad == MQF12 ) {
00339                     objType = "MQF12";
00340                 } else if ( *cItQuad == Free ) {
00341                     objType = "Free";
00342                 } else if ( *cItQuad == HfQ ) {
00343                     objType = "HfQ";
00344                 } else {
00345                     myCout << "\n\nError: no such member " <<  (*cItQuad)
00346                     << " in enum L1GtPsbQuad\n\n" << std::endl;
00347                     objType = "ERROR";
00348                 }
00349 
00350                 myCout << objType << " ";
00351             }
00352 
00353 
00354         }
00355     }
00356 
00357 
00358     myCout << "\n\n  Size: " << nrCable << " cables for " << nrBoards << " PSB boards"
00359     << std::endl;
00360 
00361     myCout << std::endl;
00362 
00363 }
00364 
00365 // output stream operator
00366 std::ostream& operator<<(std::ostream& os, const L1GtBoardMaps& result)
00367 {
00368     result.print(os);
00369     return os;
00370 
00371 }
00372 
00373