CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CondFormats/RPCObjects/src/DccSpec.cc

Go to the documentation of this file.
00001 #include "CondFormats/RPCObjects/interface/DccSpec.h"
00002 #include <sstream>
00003 #include <iostream>
00004 
00005 DccSpec::DccSpec(int id) : theId(id) 
00006 { }
00007 
00008 std::string DccSpec::print(int depth) const
00009 {
00010   
00011   std::ostringstream str;
00012   str << "DccSpec:id=" << id() << std::endl;
00013   depth--;
00014   if (depth >= 0) {
00015     typedef std::vector<TriggerBoardSpec>::const_iterator ITTB;
00016     for (ITTB it = theTBs.begin(); it != theTBs.end(); it++) str << it->print(depth);
00017   }
00018   return str.str();
00019 }
00020 
00021 const TriggerBoardSpec * DccSpec::triggerBoard(int channelNumber) const
00022 {
00023 //  return (theId >=0) ? &theTBs[channelNumber-MIN_CHANNEL_NUMBER] : 0;
00024 
00025   //FIXME - temporary implementaion, to be replace by LUT (in preparation)
00026   typedef std::vector<TriggerBoardSpec>::const_iterator IT;
00027   for (IT it=theTBs.begin(); it != theTBs.end(); it++) {
00028     if(channelNumber ==it->dccInputChannelNum()) return &(*it);
00029   }
00030   return 0;
00031 
00032 }
00033 
00034 void DccSpec::add(const TriggerBoardSpec & tb) 
00035 {
00036 //  if (theTBs.empty()) theTBs.resize(NUMBER_OF_CHANNELS);
00037 //  int channel = tb.dccInputChannelNum();
00038 //  if (    channel >= MIN_CHANNEL_NUMBER  
00039 //       && channel <= NUMBER_OF_CHANNELS+MIN_CHANNEL_NUMBER-1) {
00040 //    theTBs[channel-MIN_CHANNEL_NUMBER] = tb;
00041 //  } else {
00042 //     edm::LogInfo(" incorrect tb, skipp adding.")<<"\t id="<<channel; 
00043 //  }
00044   theTBs.push_back(tb);
00045 }