Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:22

0001 /**
0002  * \class L1GtParameters
0003  *
0004  *
0005  * Description: L1 GT parameters.
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/L1GtParameters.h"
0019 
0020 // system include files
0021 #include <iomanip>
0022 
0023 // user include files
0024 //   base class
0025 
0026 // forward declarations
0027 
0028 // constructor
0029 L1GtParameters::L1GtParameters() {
0030   // empty
0031 }
0032 
0033 // destructor
0034 L1GtParameters::~L1GtParameters() {
0035   // empty
0036 }
0037 
0038 // set the total Bx's in the event
0039 void L1GtParameters::setGtTotalBxInEvent(const int& totalBxInEventValue) { m_totalBxInEvent = totalBxInEventValue; }
0040 
0041 // set active boards for L1 GT DAQ record
0042 void L1GtParameters::setGtDaqActiveBoards(const uint16_t& activeBoardsValue) { m_daqActiveBoards = activeBoardsValue; }
0043 
0044 // set active boards for L1 GT EVM record
0045 void L1GtParameters::setGtEvmActiveBoards(const uint16_t& activeBoardsValue) { m_evmActiveBoards = activeBoardsValue; }
0046 
0047 // set number of Bx for L1 GT DAQ record
0048 void L1GtParameters::setGtDaqNrBxBoard(const std::vector<int>& nrBxBoardValue) { m_daqNrBxBoard = nrBxBoardValue; }
0049 
0050 // set number of Bx for L1 GT EVM record
0051 void L1GtParameters::setGtEvmNrBxBoard(const std::vector<int>& nrBxBoardValue) { m_evmNrBxBoard = nrBxBoardValue; }
0052 
0053 void L1GtParameters::setGtBstLengthBytes(const unsigned int& bstLengthBytesValue) {
0054   m_bstLengthBytes = bstLengthBytesValue;
0055 }
0056 
0057 // print all the L1 GT parameters
0058 void L1GtParameters::print(std::ostream& myCout) const {
0059   myCout << "\nL1 GT Parameters" << std::endl;
0060 
0061   myCout << "\n  Total Bx's in the event             = " << m_totalBxInEvent << std::endl;
0062 
0063   myCout << "\n  Active boards in L1 GT DAQ record (hex format) = " << std::hex
0064          << std::setw(sizeof(m_daqActiveBoards) * 2) << std::setfill('0') << m_daqActiveBoards << std::dec
0065          << std::setfill(' ') << std::endl;
0066 
0067   myCout << "\n  Active boards in L1 GT EVM record (hex format) = " << std::hex
0068          << std::setw(sizeof(m_evmActiveBoards) * 2) << std::setfill('0') << m_evmActiveBoards << std::dec
0069          << std::setfill(' ') << std::endl;
0070 
0071   myCout << "\n"
0072          << "  Number of bunch crosses per board in L1 GT DAQ record\n"
0073          << "  Board bit gives the position of the board in the \"active boards\" word.\n"
0074          << std::endl;
0075 
0076   int iBit = 0;
0077   for (std::vector<int>::const_iterator cIt = m_daqNrBxBoard.begin(); cIt != m_daqNrBxBoard.end(); ++cIt) {
0078     myCout << "    Board active bit " << iBit << ": " << (*cIt) << " BXs" << std::endl;
0079     iBit++;
0080   }
0081 
0082   myCout << "\n"
0083          << "  Number of bunch crosses per board in L1 GT EVM record\n"
0084          << "  Board bit gives the position of the board in the \"active boards\" word.\n"
0085          << std::endl;
0086 
0087   iBit = 0;
0088   for (std::vector<int>::const_iterator cIt = m_evmNrBxBoard.begin(); cIt != m_evmNrBxBoard.end(); ++cIt) {
0089     myCout << "    Board active bit " << iBit << ": " << (*cIt) << " BXs" << std::endl;
0090     iBit++;
0091   }
0092 
0093   myCout << "\n  Length of the BST message = " << m_bstLengthBytes << std::endl;
0094 
0095   myCout << "\n" << std::endl;
0096 }
0097 
0098 // output stream operator
0099 std::ostream& operator<<(std::ostream& os, const L1GtParameters& result) {
0100   result.print(os);
0101   return os;
0102 }