CMS 3D CMS Logo

LinkBoardSpec.cc

Go to the documentation of this file.
00001 
00002 #include "CondFormats/RPCObjects/interface/LinkBoardSpec.h"
00003 #include <sstream>
00004 
00005 LinkBoardSpec::LinkBoardSpec(bool m, int l)
00006     : theMaster(m), theLinkBoardNumInLink(l) { }
00007 
00008 void LinkBoardSpec::add(const FebConnectorSpec & feb)
00009 {
00010   theFebs.push_back(feb);
00011 }
00012 
00013 const FebConnectorSpec * LinkBoardSpec::feb(int febInputNum) const
00014 {
00015   //FIXME - temporary implementaion, to be replace by LUT (in preparation)
00016   typedef std::vector<FebConnectorSpec>::const_iterator IT;
00017   for (IT it=theFebs.begin(); it != theFebs.end(); it++) {
00018     if(febInputNum==it->linkBoardInputNum()) return &(*it);
00019   }
00020   return 0;
00021 }
00022 
00023 std::string LinkBoardSpec::print(int depth ) const 
00024 {
00025   std::ostringstream str;
00026   std::string type = (theMaster) ? "master" : "slave";
00027   str <<" LinkBoardSpec: " << std::endl
00028             <<" --->" <<type<<" linkBoardNumInLink: " << theLinkBoardNumInLink 
00029             << std::endl;
00030   depth--;
00031   if (depth >=0) {
00032     typedef std::vector<FebConnectorSpec>::const_iterator IT;
00033     for (IT it=theFebs.begin(); it != theFebs.end(); it++) str << (*it).print(depth);
00034   }
00035   return str.str();
00036 }
00037 

Generated on Tue Jun 9 17:26:45 2009 for CMSSW by  doxygen 1.5.4