CMS 3D CMS Logo

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