File indexing completed on 2024-04-06 12:02:30
0001 #include "CondFormats/RPCObjects/interface/DccSpec.h"
0002 #include <sstream>
0003 #include <iostream>
0004
0005 DccSpec::DccSpec(int id) : theId(id) {}
0006
0007 std::string DccSpec::print(int depth) const {
0008 std::ostringstream str;
0009 str << "DccSpec:id=" << id() << std::endl;
0010 depth--;
0011 if (depth >= 0) {
0012 typedef std::vector<TriggerBoardSpec>::const_iterator ITTB;
0013 for (ITTB it = theTBs.begin(); it != theTBs.end(); it++)
0014 str << it->print(depth);
0015 }
0016 return str.str();
0017 }
0018
0019 const TriggerBoardSpec* DccSpec::triggerBoard(int channelNumber) const {
0020
0021
0022
0023 typedef std::vector<TriggerBoardSpec>::const_iterator IT;
0024 for (IT it = theTBs.begin(); it != theTBs.end(); it++) {
0025 if (channelNumber == it->dccInputChannelNum())
0026 return &(*it);
0027 }
0028 return nullptr;
0029 }
0030
0031 void DccSpec::add(const TriggerBoardSpec& tb) {
0032
0033
0034
0035
0036
0037
0038
0039
0040 theTBs.push_back(tb);
0041 }