test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
10 const LinkConnSpec * TriggerBoardSpec::linkConn(int tbInputNumber) const
11 {
12  //FIXME - temporary implementaion, to be replace by LUT (in preparation)
13  for (IT it=theLinks.begin(); it != theLinks.end(); it++) {
14  if(tbInputNumber==it->triggerBoardInputNumber()) return &(*it);
15  }
16  return 0;
17 }
18 
19 std::vector<const LinkConnSpec* > TriggerBoardSpec::enabledLinkConns() const
20 {
21  std::vector<const LinkConnSpec* > result;
22  for (IT it=theLinks.begin(); it != theLinks.end(); it++) {
23  //
24  // check that link is not masked!
25  // std::cout <<"masked links:"<<theMaskedLinks<<std::endl;
26  //
27  result.push_back( &(*it) );
28  }
29  return result;
30 }
31 
33 {
34  std::ostringstream str;
35  str << "TriggerBoardSpec: num=" << dccInputChannelNum() << std::endl;
36  depth--;
37  if (depth >= 0) {
38  for (IT ic = theLinks.begin(); ic != theLinks.end(); ic++) str << (*ic).print(depth);
39  }
40  return str.str();
41 }
42 
44 {
45  theLinks.push_back(lc);
46 }
std::vector< const LinkConnSpec * > enabledLinkConns() const
not masked links belonging to this TB
void add(const LinkConnSpec &lc)
attach connection to TB
const LinkConnSpec * linkConn(int tbInputNumber) const
link attached to this TB with given input number
tuple result
Definition: query.py:137
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
std::vector< LinkConnSpec > theLinks