CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TriggerBoardSpec.cc
Go to the documentation of this file.
2 #include <sstream>
3 #include <iostream>
4 
5 typedef std::vector<LinkConnSpec>::const_iterator IT;
6 
7 TriggerBoardSpec::TriggerBoardSpec(int num, uint32_t aMask) : theNum(num), theMaskedLinks(aMask) {}
8 
9 const LinkConnSpec* TriggerBoardSpec::linkConn(int tbInputNumber) const {
10  //FIXME - temporary implementaion, to be replace by LUT (in preparation)
11  for (IT it = theLinks.begin(); it != theLinks.end(); it++) {
12  if (tbInputNumber == it->triggerBoardInputNumber())
13  return &(*it);
14  }
15  return nullptr;
16 }
17 
18 std::vector<const LinkConnSpec*> TriggerBoardSpec::enabledLinkConns() const {
19  std::vector<const LinkConnSpec*> result;
20  for (IT it = theLinks.begin(); it != theLinks.end(); it++) {
21  //
22  // check that link is not masked!
23  // std::cout <<"masked links:"<<theMaskedLinks<<std::endl;
24  //
25  result.push_back(&(*it));
26  }
27  return result;
28 }
29 
31  std::ostringstream str;
32  str << "TriggerBoardSpec: num=" << dccInputChannelNum() << std::endl;
33  depth--;
34  if (depth >= 0) {
35  for (IT ic = theLinks.begin(); ic != theLinks.end(); ic++)
36  str << (*ic).print(depth);
37  }
38  return str.str();
39 }
40 
41 void TriggerBoardSpec::add(const LinkConnSpec& lc) { theLinks.push_back(lc); }
std::vector< const LinkConnSpec * > enabledLinkConns() const
not masked links belonging to this TB
void add(const LinkConnSpec &lc)
attach connection to TB
tuple result
Definition: mps_fire.py:311
const LinkConnSpec * linkConn(int tbInputNumber) const
link attached to this TB with given input number
std::vector< LinkConnSpec >::const_iterator IT
std::string print(int depth=0) const
debud printaout, call its components with depth dectreased by one
int dccInputChannelNum() const
input channel number to DCC
TriggerBoardSpec(int num=-1, uint32_t aMask=0)
ctor with ID only
#define str(s)
std::vector< LinkConnSpec > theLinks