Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:34

0001 // Include files
0002 
0003 // local
0004 #include "L1Trigger/RPCTechnicalTrigger/interface/TTUBasicConfig.h"
0005 
0006 //-----------------------------------------------------------------------------
0007 // Implementation file for class : TTUBasicConfig
0008 //
0009 // 2008-10-31 : Andres Osorio
0010 //-----------------------------------------------------------------------------
0011 
0012 //=============================================================================
0013 // Standard constructor, initializes variables
0014 //=============================================================================
0015 TTUBasicConfig::TTUBasicConfig(const TTUBoardSpecs* ttuspecs) : TTUConfiguration(ttuspecs), m_debug{false} {}
0016 
0017 TTUBasicConfig::TTUBasicConfig(const char* logic) : TTUConfiguration(logic), m_debug{false} {}
0018 
0019 //=============================================================================
0020 // Destructor
0021 //=============================================================================
0022 TTUBasicConfig::~TTUBasicConfig() {}
0023 
0024 //=============================================================================
0025 bool TTUBasicConfig::initialise(int line, int ttuid) {
0026   bool status(false);
0027 
0028   //.  read specifications and set it to the corresponding TTU board
0029 
0030   std::vector<TTUBoardSpecs::TTUBoardConfig>::const_iterator itr;
0031   itr = m_ttuboardspecs->m_boardspecs.begin();
0032 
0033   int pos(0);
0034   int maxboards = m_ttuboardspecs->m_boardspecs.size();
0035 
0036   for (pos = 0; pos < maxboards; ++pos) {
0037     if (m_debug)
0038       std::cout << "TTUBasicConfig::initialise> " << m_ttuboardspecs->m_boardspecs[pos].m_Wheel1Id << std::endl;
0039     if (m_ttuboardspecs->m_boardspecs[pos].m_runId == ttuid)
0040       break;
0041   }
0042 
0043   // initialise logic unit
0044 
0045   if (line == 2) {
0046     ttulogic()->setlogic("WedgeORLogic");
0047   } else {
0048     ttulogic()->setlogic((*itr).m_LogicType.c_str());
0049   }
0050 
0051   status = ttulogic()->initialise();
0052 
0053   //itr = m_ttuboardspecs->m_boardspecs.begin();
0054 
0055   ttulogic()->setBoardSpecs(m_ttuboardspecs->m_boardspecs[pos]);
0056 
0057   // get mask and force vectors
0058 
0059   m_vecmask.assign((*itr).m_MaskedSectors.begin(), (*itr).m_MaskedSectors.end());
0060 
0061   m_vecforce.assign((*itr).m_ForcedSectors.begin(), (*itr).m_ForcedSectors.end());
0062 
0063   if (!status) {
0064     if (m_debug)
0065       std::cout << "TTUConfiguration> Problem initialising the logic unit\n";
0066     return false;
0067   };
0068 
0069   return status;
0070 }
0071 
0072 void TTUBasicConfig::preprocess(TTUInput& input) {
0073   if (m_debug)
0074     std::cout << "TTUBasicConfig::preprocess> starts here" << std::endl;
0075 
0076   input.mask(m_vecmask);
0077   //input.force( m_vecforce );
0078 
0079   if (m_debug)
0080     std::cout << "TTUBasicConfig::preprocess> done" << std::endl;
0081 }