CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtBoardMaps.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 
26 // forward declarations
27 
28 // constructor
30 {
31  // empty
32 }
33 
34 // destructor
36 {
37  // empty
38 }
39 
40 
41 
42 // set / print the L1 GT board map
43 void L1GtBoardMaps::setGtBoardMaps(const std::vector<L1GtBoard>& gtBoardMapsValue)
44 {
45 
46  m_gtBoardMaps = gtBoardMapsValue;
47 
48 }
49 
50 void L1GtBoardMaps::print(std::ostream& myCout) const
51 {
52  myCout << "\nL1 GT board map" << std::endl;
53 
54  myCout << " Size: " << m_gtBoardMaps.size() << " boards in L1 GT." << std::endl;
55 
56  for (std::vector<L1GtBoard>::const_iterator
57  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
58 
59  cIt->print(myCout);
60  myCout << std::endl;
61  }
62 
63  myCout << std::endl;
64 
65 }
66 
67 // print L1 GT DAQ record map
68 void L1GtBoardMaps::printGtDaqRecordMap(std::ostream& myCout) const
69 {
70  myCout << "\nL1 GT DAQ record map" << std::endl;
71 
72  int nrBoards = 0;
73  int posRec = -1;
74  boost::uint16_t boardId = 0;
75  std::string boardName;
76 
77  for (std::vector<L1GtBoard>::const_iterator
78  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
79 
80  posRec = cIt->gtPositionDaqRecord();
81  boardId = cIt->gtBoardId();
82  boardName = cIt->gtBoardName();
83 
84  if (posRec >=0) {
85  myCout
86  << " " << boardName << " " << std::hex << boardId << std::dec
87  << " at position " << posRec << std::endl;
88 
89  nrBoards++;
90  }
91  }
92 
93  myCout << "\n Size: " << nrBoards << " boards in the record" << std::endl;
94  myCout << " Header and trailer are automatically added to the hardware record.\n"
95  << std::endl;
96 
97 
98  myCout << std::endl;
99 
100 }
101 
102 // print L1 GT EVM record map
103 void L1GtBoardMaps::printGtEvmRecordMap(std::ostream& myCout) const
104 {
105  myCout << "\nL1 GT EVM record map" << std::endl;
106 
107  int nrBoards = 0;
108  int posRec = -1;
109  boost::uint16_t boardId = 0;
110  std::string boardName;
111 
112  for (std::vector<L1GtBoard>::const_iterator
113  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
114 
115  posRec = cIt->gtPositionEvmRecord();
116  boardId = cIt->gtBoardId();
117  boardName = cIt->gtBoardName();
118 
119  if (posRec >=0) {
120  myCout
121  << " " << boardName << " " << std::hex << boardId << std::dec
122  << " at position " << posRec << std::endl;
123 
124  nrBoards++;
125  }
126  }
127 
128  myCout << "\n Size: " << nrBoards << " boards in the record" << std::endl;
129  myCout << " Header and trailer are automatically added to the hardware record.\n"
130  << std::endl;
131 
132 
133  myCout << std::endl;
134 
135 }
136 
137 // print L1 GT active boards map for DAQ record
138 void L1GtBoardMaps::printGtDaqActiveBoardsMap(std::ostream& myCout) const
139 {
140  myCout << "\nL1 GT DAQ \"active boards\" record map" << std::endl;
141 
142  int nrBoards = 0;
143  int posRec = -1;
144  boost::uint16_t boardId = 0;
145  std::string boardName;
146 
147  for (std::vector<L1GtBoard>::const_iterator
148  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
149 
150  posRec = cIt->gtBitDaqActiveBoards();
151  boardId = cIt->gtBoardId();
152  boardName = cIt->gtBoardName();
153 
154  if (posRec >=0) {
155  myCout
156  << " " << boardName << " " << std::hex << boardId << std::dec
157  << " at bit " << posRec << std::endl;
158 
159  nrBoards++;
160  }
161  }
162 
163  myCout << "\n Size: " << nrBoards << " boards in the record" << std::endl;
164  myCout << std::endl;
165 
166 
167  myCout << std::endl;
168 
169 }
170 
171 // print L1 GT active boards map for EVM record
172 void L1GtBoardMaps::printGtEvmActiveBoardsMap(std::ostream& myCout) const
173 {
174  myCout << "\nL1 GT EVM \"active boards\" record map" << std::endl;
175 
176  int nrBoards = 0;
177  int posRec = -1;
178  boost::uint16_t boardId = 0;
179  std::string boardName;
180 
181  for (std::vector<L1GtBoard>::const_iterator
182  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
183 
184  posRec = cIt->gtBitEvmActiveBoards();
185  boardId = cIt->gtBoardId();
186  boardName = cIt->gtBoardName();
187 
188  if (posRec >=0) {
189  myCout
190  << " " << boardName << " " << std::hex << boardId << std::dec
191  << " at bit " << posRec << std::endl;
192 
193  nrBoards++;
194  }
195  }
196 
197  myCout << "\n Size: " << nrBoards << " boards in the record" << std::endl;
198  myCout << std::endl;
199 
200 
201  myCout << std::endl;
202 
203 }
204 
205 
206 // print L1 GT board - slot map
207 void L1GtBoardMaps::printGtBoardSlotMap(std::ostream& myCout) const
208 {
209  myCout << "\nL1 GT board - slot map" << std::endl;
210 
211  int nrBoards = 0;
212  int posRec = -1;
213  boost::uint16_t boardId = 0;
214  std::string boardName;
215 
216  for (std::vector<L1GtBoard>::const_iterator
217  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
218 
219  posRec = cIt->gtBoardSlot();
220  boardId = cIt->gtBoardId();
221  boardName = cIt->gtBoardName();
222 
223  if (posRec >=0) {
224  myCout
225  << " " << boardName << " " << std::hex << boardId << std::dec
226  << " in slot " << posRec << std::endl;
227 
228  nrBoards++;
229  }
230  }
231 
232  myCout << "\n Size: " << nrBoards << " boards in the slot map" << std::endl;
233  myCout << std::endl;
234 
235 
236  myCout << std::endl;
237 
238 }
239 
240 // print L1 GT board name in hw record map
241 void L1GtBoardMaps::printGtBoardHexNameMap(std::ostream& myCout) const
242 {
243  myCout << "\nL1 GT board names in hw record map" << std::endl;
244 
245  int nrBoards = 0;
246  int posRec = -1;
247  boost::uint16_t boardId = 0;
248  std::string boardName;
249 
250  for (std::vector<L1GtBoard>::const_iterator
251  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
252 
253  posRec = cIt->gtBoardHexName();
254  boardId = cIt->gtBoardId();
255  boardName = cIt->gtBoardName();
256 
257  if (posRec >=0) {
258  myCout
259  << " " << boardName << " " << std::hex << boardId << std::dec
260  << " has HexName " << std::hex << posRec << std::dec << std::endl;
261 
262  nrBoards++;
263  }
264  }
265 
266  myCout << "\n Size: " << nrBoards << " boards in the record" << std::endl;
267  myCout << std::endl;
268 
269 
270  myCout << std::endl;
271 
272 }
273 
274 // print L1 quadruplet (4x16 bits)(cable) to PSB input map
275 void L1GtBoardMaps::printGtQuadToPsbMap(std::ostream& myCout) const
276 {
277 
278  myCout << "\nL1 GT \"cables to PSB\" input map (4x16 bits per cable) - DEPRECATED" << std::endl;
279 
280  int nrBoards = 0;
281  int nrCable = 0;
282 
283  for (std::vector<L1GtBoard>::const_iterator
284  cIt = m_gtBoardMaps.begin(); cIt != m_gtBoardMaps.end(); ++cIt) {
285 
286  if (cIt->gtBoardType() == PSB) {
287 
288  myCout << "\n PSB_" << cIt->gtBoardIndex() << "\n ";
289 
290  nrBoards++;
291 
292  std::vector<L1GtPsbQuad> quadInPsb = cIt->gtQuadInPsb();
293  std::string objType;
294 
295  for (std::vector<L1GtPsbQuad>::const_iterator
296  cItQuad = quadInPsb.begin(); cItQuad != quadInPsb.end(); ++cItQuad) {
297 
298  nrCable++;
299 
300  if ( *cItQuad == TechTr ) {
301  objType = "TechTr";
302  } else if ( *cItQuad == IsoEGQ ) {
303  objType = "IsoEGQ";
304  } else if ( *cItQuad == NoIsoEGQ ) {
305  objType = "NoIsoEGQ";
306  } else if ( *cItQuad == CenJetQ ) {
307  objType = "CenJetQ";
308  } else if ( *cItQuad == ForJetQ ) {
309  objType = "ForJetQ";
310  } else if ( *cItQuad == TauJetQ ) {
311  objType = "TauJetQ";
312  } else if ( *cItQuad == ESumsQ ) {
313  objType = "ESumsQ";
314  } else if ( *cItQuad == JetCountsQ ) {
315  objType = "JetCountsQ";
316  } else if ( *cItQuad == MQB1 ) {
317  objType = "MQB1";
318  } else if ( *cItQuad == MQB2 ) {
319  objType = "MQB2";
320  } else if ( *cItQuad == MQF3 ) {
321  objType = "MQF3";
322  } else if ( *cItQuad == MQF4 ) {
323  objType = "MQF4";
324  } else if ( *cItQuad == MQB5 ) {
325  objType = "MQB5";
326  } else if ( *cItQuad == MQB6 ) {
327  objType = "MQB6";
328  } else if ( *cItQuad == MQF7 ) {
329  objType = "MQF7";
330  } else if ( *cItQuad == MQF8 ) {
331  objType = "MQF8";
332  } else if ( *cItQuad == MQB9 ) {
333  objType = "MQB9";
334  } else if ( *cItQuad == MQB10 ) {
335  objType = "MQB10";
336  } else if ( *cItQuad == MQF11 ) {
337  objType = "MQF11";
338  } else if ( *cItQuad == MQF12 ) {
339  objType = "MQF12";
340  } else if ( *cItQuad == Free ) {
341  objType = "Free";
342  } else if ( *cItQuad == HfQ ) {
343  objType = "HfQ";
344  } else {
345  myCout << "\n\nError: no such member " << (*cItQuad)
346  << " in enum L1GtPsbQuad\n\n" << std::endl;
347  objType = "ERROR";
348  }
349 
350  myCout << objType << " ";
351  }
352 
353 
354  }
355  }
356 
357 
358  myCout << "\n\n Size: " << nrCable << " cables for " << nrBoards << " PSB boards"
359  << std::endl;
360 
361  myCout << std::endl;
362 
363 }
364 
365 // output stream operator
366 std::ostream& operator<<(std::ostream& os, const L1GtBoardMaps& result)
367 {
368  result.print(os);
369  return os;
370 
371 }
372 
373 
void printGtBoardSlotMap(std::ostream &myCout) const
print L1 GT board - slot map
void setGtBoardMaps(const std::vector< L1GtBoard > &)
std::vector< L1GtBoard > m_gtBoardMaps
L1 GT boards and their mapping.
Definition: L1GtBoardMaps.h:85
void printGtEvmRecordMap(std::ostream &myCout) const
print L1 GT EVM record map
virtual ~L1GtBoardMaps()
void printGtEvmActiveBoardsMap(std::ostream &myCout) const
print L1 GT active boards map for EVM record
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
tuple result
Definition: mps_fire.py:95
void printGtBoardHexNameMap(std::ostream &myCout) const
print L1 GT board name in hw record map
void print(std::ostream &) const
void printGtDaqRecordMap(std::ostream &myCout) const
print L1 GT DAQ record map
void printGtDaqActiveBoardsMap(std::ostream &myCout) const
print L1 GT active boards map for DAQ record
void printGtQuadToPsbMap(std::ostream &myCout) const
print L1 quadruplet (4x16 bits)(cable) to PSB input map