CMS 3D CMS Logo

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