CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/CondFormats/RPCObjects/src/TriggerBoardSpec.cc

Go to the documentation of this file.
00001 #include "CondFormats/RPCObjects/interface/TriggerBoardSpec.h"
00002 #include <sstream>
00003 #include <iostream>
00004 
00005 typedef std::vector<LinkConnSpec>::const_iterator IT;
00006 
00007 TriggerBoardSpec::TriggerBoardSpec(int num, uint32_t aMask) : theNum(num), theMaskedLinks(aMask)
00008 { }
00009 
00010 const LinkConnSpec * TriggerBoardSpec::linkConn(int tbInputNumber) const
00011 {
00012   //FIXME - temporary implementaion, to be replace by LUT (in preparation)
00013   for (IT it=theLinks.begin(); it != theLinks.end(); it++) {
00014     if(tbInputNumber==it->triggerBoardInputNumber()) return &(*it);
00015   }
00016   return 0;
00017 }
00018 
00019 std::vector<const LinkConnSpec* > TriggerBoardSpec::enabledLinkConns() const
00020 {
00021   std::vector<const LinkConnSpec* > result;
00022   for (IT it=theLinks.begin(); it != theLinks.end(); it++) {
00023     //
00024     // check that link is not masked!
00025     // std::cout <<"masked links:"<<theMaskedLinks<<std::endl;  
00026     //
00027     result.push_back( &(*it) ); 
00028   }
00029   return result;
00030 }
00031 
00032 std::string TriggerBoardSpec::print(int depth) const
00033 {
00034   std::ostringstream str;
00035   str << "TriggerBoardSpec: num=" << dccInputChannelNum() << std::endl;
00036   depth--;
00037   if (depth >= 0) {
00038     for (IT ic = theLinks.begin(); ic != theLinks.end(); ic++) str << (*ic).print(depth);
00039   }
00040   return str.str();
00041 }
00042 
00043 void TriggerBoardSpec::add(const LinkConnSpec & lc)
00044 {
00045   theLinks.push_back(lc);
00046 }