CMS 3D CMS Logo

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