CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GtPsbConfig.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <iostream>
22 #include <iomanip>
23 
24 // user include files
25 // base class
26 
27 // forward declarations
28 
29 // constructors
31  m_gtBoardSlot = -1;
32 
33  m_gtPsbCh0SendLvds = false;
34  m_gtPsbCh1SendLvds = false;
35 
38 }
39 
40 // constructor using board slot
41 L1GtPsbConfig::L1GtPsbConfig(const int& psbSlot) : m_gtBoardSlot(psbSlot) {
42  m_gtPsbCh0SendLvds = false;
43  m_gtPsbCh1SendLvds = false;
44 
47 }
48 
49 // destructor
51  // empty
52 }
53 
54 // copy constructor
57 
60 
63 }
64 
65 // assignment operator
67  if (this != &gtb) {
69 
72 
75  }
76 
77  return *this;
78 }
79 
80 // equal operator
81 bool L1GtPsbConfig::operator==(const L1GtPsbConfig& gtb) const {
82  if (m_gtBoardSlot != gtb.m_gtBoardSlot) {
83  return false;
84  }
85 
87  return false;
88  }
89 
91  return false;
92  }
93 
95  return false;
96  }
97 
99  return false;
100  }
101 
102  // all members identical
103  return true;
104 }
105 
106 // unequal operator
107 bool L1GtPsbConfig::operator!=(const L1GtPsbConfig& result) const { return !(result == *this); }
108 
109 // less than operator
110 bool L1GtPsbConfig::operator<(const L1GtPsbConfig& gtb) const {
111  if (m_gtBoardSlot < gtb.m_gtBoardSlot) {
112  return true;
113  } else {
114  return false;
115  }
116 
117  return false;
118 }
119 
120 // set board slot
121 void L1GtPsbConfig::setGtBoardSlot(const int& gtBoardSlotValue) { m_gtBoardSlot = gtBoardSlotValue; }
122 
123 // set CH0_SEND_LVDS_NOT_DS92LV16
124 void L1GtPsbConfig::setGtPsbCh0SendLvds(const bool& gtPsbCh0SendLvdsValue) {
125  m_gtPsbCh0SendLvds = gtPsbCh0SendLvdsValue;
126 }
127 
128 // set CH1_SEND_LVDS_NOT_DS92LV16
129 void L1GtPsbConfig::setGtPsbCh1SendLvds(const bool& gtPsbCh1SendLvdsValue) {
130  m_gtPsbCh1SendLvds = gtPsbCh1SendLvdsValue;
131 }
132 
133 // set enable LVDS
134 void L1GtPsbConfig::setGtPsbEnableRecLvds(const std::vector<bool>& gtPsbEnableRecLvdsValue) {
135  m_gtPsbEnableRecLvds = gtPsbEnableRecLvdsValue;
136 }
137 
138 // set enable channels for receiving signal via serial links
139 void L1GtPsbConfig::setGtPsbEnableRecSerLink(const std::vector<bool>& gtPsbEnableRecSerLinkValue) {
140  m_gtPsbEnableRecSerLink = gtPsbEnableRecSerLinkValue;
141 }
142 
143 // print board
144 void L1GtPsbConfig::print(std::ostream& myCout) const {
145  myCout << "PSB Board slot " << m_gtBoardSlot << " ( 0x" << std::hex << m_gtBoardSlot << std::dec
146  << " ):" << std::endl;
147 
148  myCout << " CH0_SEND_LVDS_NOT_DS92LV16 = " << (m_gtPsbCh0SendLvds ? "True" : "False") << std::endl;
149  myCout << " CH1_SEND_LVDS_NOT_DS92LV16 = " << (m_gtPsbCh1SendLvds ? "True" : "False") << std::endl;
150  myCout << std::endl;
151 
152  int iLvds = -1;
153  for (std::vector<bool>::const_iterator cIt = m_gtPsbEnableRecLvds.begin(); cIt != m_gtPsbEnableRecLvds.end(); ++cIt) {
154  iLvds++;
155  myCout << "\n Enable_Rec_LVDS [" << iLvds << "] = " << ((*cIt) ? "True" : "False");
156  }
157  myCout << std::endl;
158 
159  int iCh = -1;
160  for (std::vector<bool>::const_iterator cIt = m_gtPsbEnableRecSerLink.begin(); cIt != m_gtPsbEnableRecSerLink.end();
161  ++cIt) {
162  iCh++;
163  myCout << "\n SerLink_Ch" << iCh << "_Rec_Enable = " << ((*cIt) ? "True" : "False");
164  }
165  myCout << std::endl;
166 }
167 
168 // output stream operator
169 std::ostream& operator<<(std::ostream& os, const L1GtPsbConfig& result) {
170  result.print(os);
171  return os;
172 }
173 
174 // number of LVDS groups per board
176 
177 // number of channels per board
bool operator!=(const L1GtPsbConfig &) const
unequal operator
bool operator==(const L1GtPsbConfig &) const
equal operator
L1GtPsbConfig & operator=(const L1GtPsbConfig &)
assignment operator
void setGtPsbEnableRecLvds(const std::vector< bool > &)
void setGtPsbCh0SendLvds(const bool &)
bool m_gtPsbCh1SendLvds
CH1_SEND_LVDS_NOT_DS92LV16.
static const int PsbSerLinkNumberChannels
number of channels per board
Definition: L1GtPsbConfig.h:63
int m_gtBoardSlot
the slot of board (part of Board_Id)
Definition: L1GtPsbConfig.h:99
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
static const int PsbNumberLvdsGroups
number of LVDS groups per board
Definition: L1GtPsbConfig.h:60
tuple result
Definition: mps_fire.py:311
void print(std::ostream &myCout) const
print board
bool m_gtPsbCh0SendLvds
CH0_SEND_LVDS_NOT_DS92LV16.
void setGtPsbEnableRecSerLink(const std::vector< bool > &)
L1GtPsbConfig()
constructors
bool operator<(const L1GtPsbConfig &) const
less than operator
std::vector< bool > m_gtPsbEnableRecLvds
void setGtBoardSlot(const int &)
void setGtPsbCh1SendLvds(const bool &)
virtual ~L1GtPsbConfig()
destructor
std::vector< bool > m_gtPsbEnableRecSerLink
enable channels for receiving signal via serial links