CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 {
32 
33  m_gtBoardSlot = -1;
34 
35  m_gtPsbCh0SendLvds = false;
36  m_gtPsbCh1SendLvds = false;
37 
40 
41 }
42 
43 // constructor using board slot
44 L1GtPsbConfig::L1GtPsbConfig(const int& psbSlot) :
45  m_gtBoardSlot(psbSlot)
46 {
47 
48  m_gtPsbCh0SendLvds = false;
49  m_gtPsbCh1SendLvds = false;
50 
53 
54 }
55 
56 // destructor
58 {
59  // empty
60 }
61 
62 // copy constructor
64 {
65 
67 
70 
73 
74 }
75 
76 // assignment operator
78 {
79 
80  if (this != &gtb) {
81 
83 
86 
89  }
90 
91  return *this;
92 
93 }
94 
95 // equal operator
97 {
98 
99  if (m_gtBoardSlot != gtb.m_gtBoardSlot) {
100  return false;
101  }
102 
104  return false;
105  }
106 
108  return false;
109  }
110 
112  return false;
113  }
114 
116  return false;
117  }
118 
119  // all members identical
120  return true;
121 
122 }
123 
124 // unequal operator
126 {
127 
128  return !(result == *this);
129 
130 }
131 
132 // less than operator
134 {
135  if (m_gtBoardSlot < gtb.m_gtBoardSlot) {
136  return true;
137  }
138  else {
139  return false;
140  }
141 
142  return false;
143 }
144 
145 // set board slot
146 void L1GtPsbConfig::setGtBoardSlot(const int& gtBoardSlotValue)
147 {
148  m_gtBoardSlot = gtBoardSlotValue;
149 }
150 
151 // set CH0_SEND_LVDS_NOT_DS92LV16
152 void L1GtPsbConfig::setGtPsbCh0SendLvds(const bool& gtPsbCh0SendLvdsValue)
153 {
154  m_gtPsbCh0SendLvds = gtPsbCh0SendLvdsValue;
155 }
156 
157 // set CH1_SEND_LVDS_NOT_DS92LV16
158 void L1GtPsbConfig::setGtPsbCh1SendLvds(const bool& gtPsbCh1SendLvdsValue)
159 {
160  m_gtPsbCh1SendLvds = gtPsbCh1SendLvdsValue;
161 }
162 
163 // set enable LVDS
165  const std::vector<bool>& gtPsbEnableRecLvdsValue)
166 {
167 
168  m_gtPsbEnableRecLvds = gtPsbEnableRecLvdsValue;
169 }
170 
171 // set enable channels for receiving signal via serial links
173  const std::vector<bool>& gtPsbEnableRecSerLinkValue)
174 {
175  m_gtPsbEnableRecSerLink = gtPsbEnableRecSerLinkValue;
176 }
177 
178 // print board
179 void L1GtPsbConfig::print(std::ostream& myCout) const
180 {
181 
182  myCout << "PSB Board slot " << m_gtBoardSlot << " ( 0x" << std::hex
183  << m_gtBoardSlot << std::dec << " ):" << std::endl;
184 
185  myCout << " CH0_SEND_LVDS_NOT_DS92LV16 = "
186  << (m_gtPsbCh0SendLvds ? "True" : "False") << std::endl;
187  myCout << " CH1_SEND_LVDS_NOT_DS92LV16 = "
188  << (m_gtPsbCh1SendLvds ? "True" : "False") << std::endl;
189  myCout << std::endl;
190 
191  int iLvds = -1;
192  for (std::vector<bool>::const_iterator cIt = m_gtPsbEnableRecLvds.begin(); cIt
193  != m_gtPsbEnableRecLvds.end(); ++cIt) {
194 
195  iLvds++;
196  myCout << "\n Enable_Rec_LVDS [" << iLvds << "] = "
197  << ((*cIt) ? "True" : "False");
198  }
199  myCout << std::endl;
200 
201  int iCh = -1;
202  for (std::vector<bool>::const_iterator cIt =
203  m_gtPsbEnableRecSerLink.begin(); cIt
204  != m_gtPsbEnableRecSerLink.end(); ++cIt) {
205 
206  iCh++;
207  myCout << "\n SerLink_Ch" << iCh << "_Rec_Enable = "
208  << ((*cIt) ? "True" : "False");
209  }
210  myCout << std::endl;
211 }
212 
213 // output stream operator
214 std::ostream& operator<<(std::ostream& os, const L1GtPsbConfig& result)
215 {
216  result.print(os);
217  return os;
218 
219 }
220 
221 // number of LVDS groups per board
223 
224 // 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:67
int m_gtBoardSlot
the slot of board (part of Board_Id)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const int PsbNumberLvdsGroups
number of LVDS groups per board
Definition: L1GtPsbConfig.h:64
void print(std::ostream &myCout) const
print board
bool m_gtPsbCh0SendLvds
CH0_SEND_LVDS_NOT_DS92LV16.
void setGtPsbEnableRecSerLink(const std::vector< bool > &)
tuple result
Definition: query.py:137
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