CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtBoard.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 
25 
26 // user include files
27 // base class
28 
29 // forward declarations
30 
31 // constructors
33 {
34 
35  // empty
36 
37 }
38 
39 L1GtBoard::L1GtBoard(const L1GtBoardType& gtBoardTypeValue) :
40  m_gtBoardType(gtBoardTypeValue)
41 {
42 
43  m_gtBoardIndex = -1;
44 
47 
50 
51  m_gtBoardSlot = -1;
52  m_gtBoardHexName = 0;
53 
55 
56 }
57 
58 L1GtBoard::L1GtBoard(const L1GtBoardType& gtBoardTypeValue,
59  const int& gtBoardIndexValue) :
60  m_gtBoardType(gtBoardTypeValue), m_gtBoardIndex(gtBoardIndexValue)
61 {
62 
65 
68 
69  m_gtBoardSlot = -1;
70  m_gtBoardHexName = 0;
71 
73 
74 }
75 
76 // destructor
78 {
79  // empty
80 }
81 
82 // copy constructor
84 {
85 
88 
91 
94 
97 
99 
101 
102 }
103 
104 // assignment operator
106 {
107 
108  if ( this != &gtb ) {
109 
112 
115 
118 
121 
124 
125  }
126 
127  return *this;
128 
129 }
130 
131 // equal operator
132 bool L1GtBoard::operator==(const L1GtBoard& gtb) const
133 {
134 
135  if (m_gtBoardType != gtb.m_gtBoardType) {
136  return false;
137  }
138 
139  if (m_gtBoardIndex != gtb.m_gtBoardIndex) {
140  return false;
141  }
142 
144  return false;
145  }
146 
148  return false;
149  }
150 
152  return false;
153  }
154 
156  return false;
157  }
158 
159  if (m_gtBoardSlot != gtb.m_gtBoardSlot) {
160  return false;
161  }
162 
163  if (m_gtBoardHexName != gtb.m_gtBoardHexName) {
164  return false;
165  }
166 
167  if (m_gtQuadInPsb != gtb.m_gtQuadInPsb) {
168  return false;
169  }
170 
172  return false;
173  }
174 
175  // all members identical
176  return true;
177 
178 }
179 
180 
181 
182 // unequal operator
184 {
185 
186  return !( result == *this);
187 
188 }
189 
190 // less than operator
191 bool L1GtBoard::operator< (const L1GtBoard& gtb) const
192 {
193  if (m_gtBoardType < gtb.gtBoardType()) {
194  return true;
195  } else {
196  if (m_gtBoardType == gtb.gtBoardType()) {
197 
198  if (m_gtBoardIndex < gtb.gtBoardIndex()) {
199  return true;
200  }
201  }
202  }
203 
204  return false;
205 }
206 
207 // set board type
208 void L1GtBoard::setGtBoardType(const L1GtBoardType& gtBoardTypeValue)
209 {
210  m_gtBoardType = gtBoardTypeValue;
211 }
212 
213 // set board index
214 void L1GtBoard::setGtBoardIndex(const int& gtBoardIndexValue)
215 {
216  m_gtBoardIndex = gtBoardIndexValue;
217 }
218 
219 // set the position of board data block
220 // in the GT DAQ readout record
221 void L1GtBoard::setGtPositionDaqRecord(const int& gtPositionDaqRecordValue)
222 {
223  m_gtPositionDaqRecord = gtPositionDaqRecordValue;
224 }
225 
226 // set the position of board data block
227 // in the GT EVM readout record
228 void L1GtBoard::setGtPositionEvmRecord(const int& gtPositionEvmRecordValue)
229 {
230  m_gtPositionEvmRecord = gtPositionEvmRecordValue;
231 }
232 
233 // set the bit of board in the GTFE ACTIVE_BOARDS
234 // for the GT DAQ readout record
235 void L1GtBoard::setGtBitDaqActiveBoards(const int& gtBitDaqActiveBoardsValue)
236 {
237  m_gtBitDaqActiveBoards = gtBitDaqActiveBoardsValue;
238 }
239 
240 
241 // set the bit of board in the GTFE ACTIVE_BOARDS
242 // for the GT EVM readout record
243 void L1GtBoard::setGtBitEvmActiveBoards(const int& gtBitEvmActiveBoardsValue)
244 {
245  m_gtBitEvmActiveBoards = gtBitEvmActiveBoardsValue;
246 }
247 
248 // set board slot
249 void L1GtBoard::setGtBoardSlot(const int& gtBoardSlotValue)
250 {
251  m_gtBoardSlot = gtBoardSlotValue;
252 }
253 
254 // set board hex fragment name in hw record
255 void L1GtBoard::setGtBoardHexName(const int& gtBoardHexNameValue)
256 {
257  m_gtBoardHexName = gtBoardHexNameValue;
258 }
259 
260 
261 // set L1 quadruplet (4x16 bits)(cable) in the PSB input
262 // valid for PSB only
263 void L1GtBoard::setGtQuadInPsb(const std::vector<L1GtPsbQuad>& gtQuadInPsbValue)
264 {
265  m_gtQuadInPsb = gtQuadInPsbValue;
266 }
267 
268 // set detailed input configuration for PSB (objects pro channel)
269 // int: channel number
270 void L1GtBoard::setGtInputPsbChannels(const std::map<int, std::vector<L1GtObject> >& gtInputPsbChannelsValue) {
271  m_gtInputPsbChannels = gtInputPsbChannelsValue;
272 }
273 
274 // get the board ID
275 const boost::uint16_t L1GtBoard::gtBoardId() const
276 {
277 
278  boost::uint16_t boardIdValue = 0;
279 
280  if (m_gtBoardType == GTFE) {
281  boardIdValue = boardIdValue | m_gtBoardSlot;
282  } else {
283  boardIdValue = boardIdValue | (m_gtBoardHexName << 8) | m_gtBoardSlot;
284  }
285 
286  return boardIdValue;
287 }
288 
289 // return board name - it depends on L1GtBoardType enum!!!
291 {
292 
293  std::string gtBoardNameValue;
294 
295  // active board, add its size
296  switch (m_gtBoardType) {
297 
298  case GTFE: {
299  gtBoardNameValue = "GTFE";
300  }
301  break;
302  case FDL: {
303  gtBoardNameValue = "FDL";
304  }
305  break;
306  case PSB: {
307  gtBoardNameValue = "PSB";
308  }
309  break;
310  case GMT: {
311  gtBoardNameValue = "GMT";
312  }
313  break;
314  case TCS: {
315  gtBoardNameValue = "TCS";
316  }
317  break;
318  case TIM: {
319  gtBoardNameValue = "TIM";
320  }
321  break;
322  default: {
323  //edm::LogWarning("L1GtBoard") << "\n\nError: no such board type" << m_gtBoardType
324  //<< " in enum L1GtBoardType from L1GtFwd\n\n" << std::endl;
325  gtBoardNameValue = "ERROR";
326  }
327  break;
328  }
329 
330 
331  return gtBoardNameValue;
332 
333 }
334 
336 void L1GtBoard::print(std::ostream& myCout) const
337 {
338 
339  boost::uint16_t boardId = gtBoardId();
340  std::string boardName = gtBoardName();
341 
342  myCout
343  << "Board ID: " << std::hex << boardId << std::dec << std::endl
344  << "Board Name: " << boardName << "_" << m_gtBoardIndex << std::endl
345  << "Position in DAQ Record: " << m_gtPositionDaqRecord << std::endl
346  << "Position in EVM Record: " << m_gtPositionEvmRecord << std::endl
347  << "Active_Boards bit in DAQ Record: " << m_gtBitDaqActiveBoards << std::endl
348  << "Active_Boards bit in EVM Record: " << m_gtBitEvmActiveBoards << std::endl
349  << "Board HexName: " << std::hex << m_gtBoardHexName << std::dec
350  << std::endl;
351 
352  if (m_gtBoardType == PSB) {
353  myCout
354  << "PSB Input per Cable: DEPRECATED"
355  << std::endl;
356  }
357 
358 
359  for (std::vector<L1GtPsbQuad>::const_iterator
360  cIt = m_gtQuadInPsb.begin(); cIt != m_gtQuadInPsb.end(); ++cIt) {
361 
362  std::string objType;
363 
364  if ( *cIt == TechTr ) {
365  objType = "TechTr";
366  } else if ( *cIt == IsoEGQ ) {
367  objType = "IsoEGQ";
368  } else if ( *cIt == NoIsoEGQ ) {
369  objType = "NoIsoEGQ";
370  } else if ( *cIt == CenJetQ ) {
371  objType = "CenJetQ";
372  } else if ( *cIt == ForJetQ ) {
373  objType = "ForJetQ";
374  } else if ( *cIt == TauJetQ ) {
375  objType = "TauJetQ";
376  } else if ( *cIt == ESumsQ ) {
377  objType = "ESumsQ";
378  } else if ( *cIt == JetCountsQ ) {
379  objType = "JetCountsQ";
380  } else if ( *cIt == MQB1 ) {
381  objType = "MQB1";
382  } else if ( *cIt == MQB2 ) {
383  objType = "MQB2";
384  } else if ( *cIt == MQF3 ) {
385  objType = "MQF3";
386  } else if ( *cIt == MQF4 ) {
387  objType = "MQF4";
388  } else if ( *cIt == MQB5 ) {
389  objType = "MQB5";
390  } else if ( *cIt == MQB6 ) {
391  objType = "MQB6";
392  } else if ( *cIt == MQF7 ) {
393  objType = "MQF7";
394  } else if ( *cIt == MQF8 ) {
395  objType = "MQF8";
396  } else if ( *cIt == MQB9 ) {
397  objType = "MQB9";
398  } else if ( *cIt == MQB10 ) {
399  objType = "MQB10";
400  } else if ( *cIt == MQF11 ) {
401  objType = "MQF11";
402  } else if ( *cIt == MQF12 ) {
403  objType = "MQF12";
404  } else if ( *cIt == Free ) {
405  objType = "Free";
406  } else if ( *cIt == HfQ ) {
407  objType = "HfQ";
408  } else {
409  myCout << "\n\nError: no such member " << (*cIt)
410  << " in enum L1GtPsbQuad\n\n" << std::endl;
411  objType = "ERROR";
412  }
413 
414 
415  myCout << " " << objType << " ";
416  }
417  myCout << std::endl;
418 
419  if (m_gtBoardType == PSB) {
420  myCout
421  << "Input objects pro channel:";
422  }
423 
424  for (std::map<int, std::vector<L1GtObject> >::const_iterator cIt =
425  m_gtInputPsbChannels.begin(); cIt != m_gtInputPsbChannels.end(); ++cIt) {
426 
427  myCout << "\n Channel " << cIt->first << " (" << (cIt->second).size() << " objects): ";
428 
429  for (std::vector<L1GtObject>::const_iterator itObj =
430  (cIt->second).begin(); itObj != (cIt->second).end(); ++itObj) {
431 
432  switch (*itObj) {
433  case Mu: {
434  myCout << " Mu ";
435  }
436 
437  break;
438  case NoIsoEG: {
439  myCout << " NoIsoEG ";
440  }
441 
442  break;
443  case IsoEG: {
444  myCout << " IsoEG ";
445  }
446 
447  break;
448  case CenJet: {
449  myCout << " CenJet ";
450  }
451 
452  break;
453  case ForJet: {
454  myCout << " ForJet ";
455  }
456 
457  break;
458  case TauJet: {
459  myCout << " TauJet ";
460  }
461 
462  break;
463  case ETM: {
464  myCout << " ETM ";
465  }
466 
467  break;
468  case ETT: {
469  myCout << " ETT ";
470  }
471 
472  break;
473  case HTT: {
474  myCout << " HTT ";
475  }
476 
477  break;
478  case HTM: {
479  myCout << " HTM ";
480  }
481 
482  break;
483  case JetCounts: {
484  myCout << " JetCounts ";
485  }
486 
487  break;
488  case HfBitCounts: {
489  myCout << " HfBitCounts ";
490  }
491 
492  break;
493  case HfRingEtSums: {
494  myCout << " HfRingEtSums ";
495  }
496 
497  break;
498  case TechTrig: {
499  myCout << " TechTrig ";
500  }
501 
502  break;
503  case Castor: {
504  myCout << " Castor ";
505  }
506 
507  break;
508  case BPTX: {
509  myCout << " BPTX ";
510  }
511 
512  break;
513  case GtExternal: {
514  myCout << " GtExternal ";
515  }
516 
517  break;
518  default: {
519  myCout << " ERROR: Unknown type " << (*itObj);
520  }
521  break;
522  }
523  }
524 
525  }
526 
527 
528  myCout << std::endl;
529 }
530 
531 // output stream operator
532 std::ostream& operator<<(std::ostream& os, const L1GtBoard& result)
533 {
534  result.print(os);
535  return os;
536 
537 }
538 
539 // number of InfiniCables per board
540 const int L1GtBoard::NumberCablesBoard = 4;
const L1GtBoardType gtBoardType() const
get / set board type
Definition: L1GtBoard.h:72
int m_gtPositionEvmRecord
the position of board data block in the GT EVM readout record
Definition: L1GtBoard.h:182
Definition: L1GtObject.h:41
std::map< int, std::vector< L1GtObject > > m_gtInputPsbChannels
Definition: L1GtBoard.h:206
bool operator==(const L1GtBoard &) const
equal operator
Definition: L1GtBoard.cc:132
void setGtBoardSlot(const int &)
Definition: L1GtBoard.cc:249
void setGtBoardHexName(const int &)
Definition: L1GtBoard.cc:255
Definition: L1GtObject.h:38
void setGtBitEvmActiveBoards(const int &)
Definition: L1GtBoard.cc:243
int m_gtBoardHexName
Definition: L1GtBoard.h:197
void print(std::ostream &myCout) const
print board
Definition: L1GtBoard.cc:336
void setGtPositionEvmRecord(const int &)
Definition: L1GtBoard.cc:228
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
int m_gtBoardIndex
board index
Definition: L1GtBoard.h:176
const boost::uint16_t gtBoardId() const
get the board ID
Definition: L1GtBoard.cc:275
int m_gtPositionDaqRecord
the position of board data block in the GT DAQ readout record
Definition: L1GtBoard.h:179
dictionary map
Definition: Association.py:205
int m_gtBoardSlot
the slot of board (part of Board_Id)
Definition: L1GtBoard.h:193
std::string gtBoardName() const
return board name - it depends on L1GtBoardType enum!!!
Definition: L1GtBoard.cc:290
Definition: L1GtObject.h:40
L1GtBoard()
constructors
Definition: L1GtBoard.cc:32
tuple result
Definition: query.py:137
L1GtBoardType
board types in GT
L1GtBoard & operator=(const L1GtBoard &)
assignment operator
Definition: L1GtBoard.cc:105
void setGtInputPsbChannels(const std::map< int, std::vector< L1GtObject > > &)
Definition: L1GtBoard.cc:270
#define end
Definition: vmac.h:38
const int gtBoardIndex() const
get / set board index
Definition: L1GtBoard.h:80
L1GtBoardType m_gtBoardType
board type (from L1GtBoardType enum)
Definition: L1GtBoard.h:173
void setGtBitDaqActiveBoards(const int &)
Definition: L1GtBoard.cc:235
void setGtPositionDaqRecord(const int &)
Definition: L1GtBoard.cc:221
Definition: L1GtObject.h:32
int m_gtBitDaqActiveBoards
Definition: L1GtBoard.h:186
bool operator<(const L1GtBoard &) const
less than operator
Definition: L1GtBoard.cc:191
bool operator!=(const L1GtBoard &) const
unequal operator
Definition: L1GtBoard.cc:183
Definition: L1GtObject.h:39
std::vector< L1GtPsbQuad > m_gtQuadInPsb
Definition: L1GtBoard.h:201
void setGtBoardIndex(const int &)
Definition: L1GtBoard.cc:214
int m_gtBitEvmActiveBoards
Definition: L1GtBoard.h:190
virtual ~L1GtBoard()
destructor
Definition: L1GtBoard.cc:77
static const int NumberCablesBoard
number of InfiniCables per board
Definition: L1GtBoard.h:67
tuple size
Write out results.
void setGtBoardType(const L1GtBoardType &)
Definition: L1GtBoard.cc:208
void setGtQuadInPsb(const std::vector< L1GtPsbQuad > &)
Definition: L1GtBoard.cc:263