CMS 3D CMS Logo

DccSpec.cc
Go to the documentation of this file.
2 #include <sstream>
3 #include <iostream>
4 
5 DccSpec::DccSpec(int id) : theId(id) {}
6 
8  std::ostringstream str;
9  str << "DccSpec:id=" << id() << std::endl;
10  depth--;
11  if (depth >= 0) {
12  typedef std::vector<TriggerBoardSpec>::const_iterator ITTB;
13  for (ITTB it = theTBs.begin(); it != theTBs.end(); it++)
14  str << it->print(depth);
15  }
16  return str.str();
17 }
18 
19 const TriggerBoardSpec* DccSpec::triggerBoard(int channelNumber) const {
20  // return (theId >=0) ? &theTBs[channelNumber-MIN_CHANNEL_NUMBER] : 0;
21 
22  //FIXME - temporary implementaion, to be replace by LUT (in preparation)
23  typedef std::vector<TriggerBoardSpec>::const_iterator IT;
24  for (IT it = theTBs.begin(); it != theTBs.end(); it++) {
25  if (channelNumber == it->dccInputChannelNum())
26  return &(*it);
27  }
28  return nullptr;
29 }
30 
31 void DccSpec::add(const TriggerBoardSpec& tb) {
32  // if (theTBs.empty()) theTBs.resize(NUMBER_OF_CHANNELS);
33  // int channel = tb.dccInputChannelNum();
34  // if ( channel >= MIN_CHANNEL_NUMBER
35  // && channel <= NUMBER_OF_CHANNELS+MIN_CHANNEL_NUMBER-1) {
36  // theTBs[channel-MIN_CHANNEL_NUMBER] = tb;
37  // } else {
38  // edm::LogInfo(" incorrect tb, skipp adding.")<<"\t id="<<channel;
39  // }
40  theTBs.push_back(tb);
41 }
std::string print(int depth=0) const
debud printaout, call its components with depth dectreased by one
Definition: DccSpec.cc:7
std::vector< TriggerBoardSpec > theTBs
Definition: DccSpec.h:36
DccSpec(int id=-1)
ctor with ID only
Definition: DccSpec.cc:5
const TriggerBoardSpec * triggerBoard(int channelNumber) const
TB attached to channel.
Definition: DccSpec.cc:19
void add(const TriggerBoardSpec &tb)
attach TB to DCC. The channel is defined by TB
Definition: DccSpec.cc:31
std::vector< LinkConnSpec >::const_iterator IT
#define str(s)
int id() const
id of FED
Definition: DccSpec.h:22