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 }
str
#define str(s)
Definition: TestProcessor.cc:52
DccSpec::id
int id() const
id of FED
Definition: DccSpec.h:22
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DccSpec::theTBs
std::vector< TriggerBoardSpec > theTBs
Definition: DccSpec.h:36
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
DccSpec::DccSpec
DccSpec(int id=-1)
ctor with ID only
Definition: DccSpec.cc:5
DccSpec::print
std::string print(int depth=0) const
debud printaout, call its components with depth dectreased by one
Definition: DccSpec.cc:7
TriggerBoardSpec
Definition: TriggerBoardSpec.h:14
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
DccSpec::triggerBoard
const TriggerBoardSpec * triggerBoard(int channelNumber) const
TB attached to channel.
Definition: DccSpec.cc:19
DccSpec::add
void add(const TriggerBoardSpec &tb)
attach TB to DCC. The channel is defined by TB
Definition: DccSpec.cc:31
DccSpec.h