Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "CondFormats/RPCObjects/interface/TriggerBoardSpec.h"
0002 #include <sstream>
0003 #include <iostream>
0004 
0005 typedef std::vector<LinkConnSpec>::const_iterator IT;
0006 
0007 TriggerBoardSpec::TriggerBoardSpec(int num, uint32_t aMask) : theNum(num), theMaskedLinks(aMask) {}
0008 
0009 const LinkConnSpec* TriggerBoardSpec::linkConn(int tbInputNumber) const {
0010   //FIXME - temporary implementaion, to be replace by LUT (in preparation)
0011   for (IT it = theLinks.begin(); it != theLinks.end(); it++) {
0012     if (tbInputNumber == it->triggerBoardInputNumber())
0013       return &(*it);
0014   }
0015   return nullptr;
0016 }
0017 
0018 std::vector<const LinkConnSpec*> TriggerBoardSpec::enabledLinkConns() const {
0019   std::vector<const LinkConnSpec*> result;
0020   for (IT it = theLinks.begin(); it != theLinks.end(); it++) {
0021     //
0022     // check that link is not masked!
0023     // std::cout <<"masked links:"<<theMaskedLinks<<std::endl;
0024     //
0025     result.push_back(&(*it));
0026   }
0027   return result;
0028 }
0029 
0030 std::string TriggerBoardSpec::print(int depth) const {
0031   std::ostringstream str;
0032   str << "TriggerBoardSpec: num=" << dccInputChannelNum() << std::endl;
0033   depth--;
0034   if (depth >= 0) {
0035     for (IT ic = theLinks.begin(); ic != theLinks.end(); ic++)
0036       str << (*ic).print(depth);
0037   }
0038   return str.str();
0039 }
0040 
0041 void TriggerBoardSpec::add(const LinkConnSpec& lc) { theLinks.push_back(lc); }