CMS 3D CMS Logo

L1GlobaTriggerRawToDigi.cc
Go to the documentation of this file.
1 
16 // this class header
18 
19 // system include files
20 #include <iostream>
21 #include <iomanip>
22 #include <algorithm>
23 
24 // user include files
27 
32 
36 
40 
45 
48 
51 
56 
59 
62 
63 // constructor(s)
65  :
66 
67  // input tag for DAQ GT record
68  m_daqGtInputTag(pSet.getParameter<edm::InputTag>("DaqGtInputTag")),
69 
70  // FED Id for GT DAQ record
71  // default value defined in DataFormats/FEDRawData/src/FEDNumbering.cc
72  // default value: assume the DAQ record is the last GT record
73  m_daqGtFedId(pSet.getUntrackedParameter<int>("DaqGtFedId", FEDNumbering::MAXTriggerGTPFEDID)),
74 
75  // mask for active boards
76  m_activeBoardsMaskGt(pSet.getParameter<unsigned int>("ActiveBoardsMask")),
77 
78  // number of bunch crossing to be unpacked
79  m_unpackBxInEvent(pSet.getParameter<int>("UnpackBxInEvent")),
80 
81  // create GTFE, FDL, PSB cards once per producer
82  // content will be reset whenever needed
83 
84  m_lowSkipBxInEvent(0),
85  m_uppSkipBxInEvent(0),
86 
87  m_recordLength0(0),
88  m_recordLength1(0),
89 
90  m_totalBxInEvent(0),
91  m_verbosity(pSet.getUntrackedParameter<int>("Verbosity", 0)),
92 
93  m_isDebugEnabled(edm::isDebugEnabled())
94 
95 {
96  produces<L1GlobalTriggerReadoutRecord>();
97  produces<L1MuGMTReadoutCollection>();
98 
99  produces<std::vector<L1MuRegionalCand> >("DT");
100  produces<std::vector<L1MuRegionalCand> >("CSC");
101  produces<std::vector<L1MuRegionalCand> >("RPCb");
102  produces<std::vector<L1MuRegionalCand> >("RPCf");
103  produces<std::vector<L1MuGMTCand> >();
104  consumes<FEDRawDataCollection>(m_daqGtInputTag);
105 
106  // create GTFE, FDL, PSB cards once per producer
107  // content will be reset whenever needed
108  m_gtfeWord = new L1GtfeWord();
109  m_gtFdlWord = new L1GtFdlWord();
110  m_gtPsbWord = new L1GtPsbWord();
111 
112  if (m_verbosity && m_isDebugEnabled) {
113  LogDebug("L1GlobalTriggerRawToDigi") << "\nInput tag for DAQ GT record: " << m_daqGtInputTag
114  << "\nFED Id for DAQ GT record: " << m_daqGtFedId
115  << "\nMask for active boards (hex format): " << std::hex
116  << std::setw(sizeof(m_activeBoardsMaskGt) * 2) << std::setfill('0')
117  << m_activeBoardsMaskGt << std::dec << std::setfill(' ')
118  << "\nNumber of bunch crossing to be unpacked: " << m_unpackBxInEvent << "\n"
119  << std::endl;
120  }
121 
122  if ((m_unpackBxInEvent > 0) && ((m_unpackBxInEvent % 2) == 0)) {
124 
125  if (m_verbosity) {
126  edm::LogInfo("L1GlobalTriggerRawToDigi")
127  << "\nWARNING: Number of bunch crossing to be unpacked rounded to: " << m_unpackBxInEvent
128  << "\n The number must be an odd number!\n"
129  << std::endl;
130  }
131  }
132 }
133 
134 // destructor
136  delete m_gtfeWord;
137  delete m_gtFdlWord;
138  delete m_gtPsbWord;
139 }
140 
143  static const char* const kComm1 =
144  "# input tag for GT readout collection: \n"
145  "# source = hardware record, \n"
146  "# l1GtPack = GT packer (DigiToRaw)";
147  desc.add<edm::InputTag>("DaqGtInputTag", edm::InputTag("l1GtPack"))->setComment(kComm1);
148  static const char* const kComm2 =
149  "# FED Id for GT DAQ record \n"
150  "# default value defined in DataFormats/FEDRawData/src/FEDNumbering.cc";
151  desc.addUntracked<int>("DaqGtFedId", FEDNumbering::MAXTriggerGTPFEDID)->setComment(kComm2);
152  static const char* const kComm3 =
153  "# mask for active boards (actually 16 bits) \n"
154  "# if bit is zero, the corresponding board will not be unpacked \n"
155  "# default: no board masked";
156  desc.add<unsigned int>("ActiveBoardsMask", 0xFFFF)->setComment(kComm3);
157  static const char* const kComm4 =
158  "# number of 'bunch crossing in the event' (bxInEvent) to be unpacked \n"
159  "# symmetric around L1Accept (bxInEvent = 0): \n"
160  "# 1 (bxInEvent = 0); 3 (F 0 1) (standard record); 5 (E F 0 1 2) (debug record) \n"
161  "# even numbers (except 0) 'rounded' to the nearest lower odd number \n"
162  "# negative value: unpack all available bxInEvent \n"
163  "# if more bxInEvent than available are required, unpack what exists and write a warning";
164  desc.add<int>("UnpackBxInEvent", -1)->setComment(kComm4);
165  desc.addUntracked<int>("Verbosity", 0);
166  descriptions.add("l1GlobalTriggerRawToDigi", desc);
167 }
168 
169 // member functions
170 
171 // method called to produce the data
173  // get records from EventSetup
174 
175  // muon trigger scales
177  evSetup.get<L1MuTriggerScalesRcd>().get(trigscales_h);
178  m_TriggerScales = trigscales_h.product();
179 
180  edm::ESHandle<L1MuTriggerPtScale> trigptscale_h;
181  evSetup.get<L1MuTriggerPtScaleRcd>().get(trigptscale_h);
182  m_TriggerPtScale = trigptscale_h.product();
183 
184  // board maps
186  evSetup.get<L1GtBoardMapsRcd>().get(l1GtBM);
187 
188  const std::vector<L1GtBoard> boardMaps = l1GtBM->gtBoardMaps();
189  int boardMapsSize = boardMaps.size();
190 
191  typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
192 
193  // create an ordered vector for the GT DAQ record
194  // header (pos 0 in record) and trailer (last position in record)
195  // not included, as they are not in board list
196  std::vector<L1GtBoard> gtRecordMap;
197  gtRecordMap.reserve(boardMapsSize);
198 
199  for (int iPos = 0; iPos < boardMapsSize; ++iPos) {
200  for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
201  if (itBoard->gtPositionDaqRecord() == iPos) {
202  gtRecordMap.push_back(*itBoard);
203  break;
204  }
205  }
206  }
207 
208  // raw collection
209 
211  iEvent.getByLabel(m_daqGtInputTag, fedHandle);
212 
213  if (!fedHandle.isValid()) {
214  if (m_verbosity) {
215  edm::LogWarning("L1GlobalTriggerRawToDigi")
216  << "\nWarning: FEDRawDataCollection with input tag " << m_daqGtInputTag
217  << "\nrequested in configuration, but not found in the event."
218  << "\nQuit unpacking this event" << std::endl;
219  }
220 
222 
223  return;
224  }
225 
226  // retrieve data for Global Trigger FED (GT + GMT)
227  const FEDRawData& raw = (fedHandle.product())->FEDData(m_daqGtFedId);
228 
229  int gtSize = raw.size();
230 
231  // get a const pointer to the beginning of the data buffer
232  const unsigned char* ptrGt = raw.data();
233 
234  // get a const pointer to the end of the data buffer
235  const unsigned char* endPtrGt = ptrGt + gtSize;
236 
237  //
238  if (m_verbosity && m_isDebugEnabled) {
239  LogTrace("L1GlobalTriggerRawToDigi") << "\n Size of raw data: " << gtSize << "\n" << std::endl;
240 
241  std::ostringstream myCoutStream;
242  dumpFedRawData(ptrGt, gtSize, myCoutStream);
243 
244  LogTrace("L1GlobalTriggerRawToDigi") << "\n Dump FEDRawData\n" << myCoutStream.str() << "\n" << std::endl;
245  }
246 
247  // unpack header (we have one header only)
248  int headerSize = 8;
249 
250  if ((ptrGt + headerSize) > endPtrGt) {
251  // a common error - no need to print an error anymore
253 
254  return;
255  }
256 
257  FEDHeader cmsHeader(ptrGt);
258  FEDTrailer cmsTrailer(ptrGt + gtSize - headerSize);
259 
260  unpackHeader(ptrGt, cmsHeader);
261  ptrGt += headerSize; // advance with header size
262 
263  // unpack first GTFE to find the length of the record and the active boards
264  // here GTFE assumed immediately after the header
265 
266  // if pointer after GTFE payload is greater than pointer at
267  // the end of GT payload, produce empty products and quit unpacking
268  if ((ptrGt + m_gtfeWord->getSize()) > endPtrGt) {
269  edm::LogError("L1GlobalTriggerRawToDigi") << "\nError: Pointer after GTFE greater than end pointer."
270  << "\n Put empty products in the event!"
271  << "\n Quit unpacking this event." << std::endl;
272 
274 
275  return;
276  }
277 
278  bool gtfeUnpacked = false;
279 
280  for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
281  if (itBoard->gtBoardType() == GTFE) {
282  // unpack GTFE
283  if (itBoard->gtPositionDaqRecord() == 1) {
284  m_gtfeWord->unpack(ptrGt);
285  ptrGt += m_gtfeWord->getSize(); // advance with GTFE block size
286  gtfeUnpacked = true;
287 
288  if (m_verbosity && m_isDebugEnabled) {
289  std::ostringstream myCoutStream;
290  m_gtfeWord->print(myCoutStream);
291  LogTrace("L1GlobalTriggerRawToDigi") << myCoutStream.str() << "\n" << std::endl;
292  }
293 
294  // break the loop - GTFE was found
295  break;
296 
297  } else {
298  if (m_verbosity) {
299  edm::LogWarning("L1GlobalTriggerRawToDigi")
300  << "\nWarning: GTFE block found in raw data does not follow header."
301  << "\nAssumed start position of the block is wrong!"
302  << "\nQuit unpacking this event" << std::endl;
303  }
304 
306 
307  return;
308  }
309  }
310  }
311 
312  // quit if no GTFE found
313  if (!gtfeUnpacked) {
314  if (m_verbosity) {
315  edm::LogWarning("L1GlobalTriggerRawToDigi")
316  << "\nWarning: no GTFE block found in raw data."
317  << "\nCan not find the record length (BxInEvent) and the active boards!"
318  << "\nQuit unpacking this event" << std::endl;
319  }
320 
322 
323  return;
324  }
325 
326  // life normal here, GTFE found
327 
328  // get list of active blocks
329  // blocks not active are not written to the record
330  cms_uint16_t activeBoardsGtInitial = m_gtfeWord->activeBoards();
331  cms_uint16_t altNrBxBoardInitial = m_gtfeWord->altNrBxBoard();
332 
333  // mask some boards, if needed
334  cms_uint16_t activeBoardsGt = activeBoardsGtInitial & m_activeBoardsMaskGt;
335  m_gtfeWord->setActiveBoards(activeBoardsGt);
336 
337  if (m_verbosity) {
338  LogDebug("L1GlobalTriggerRawToDigi") << "\nActive boards before masking: 0x" << std::hex
339  << std::setw(sizeof(activeBoardsGtInitial) * 2) << std::setfill('0')
340  << activeBoardsGtInitial << std::dec << std::setfill(' ')
341  << "\nActive boards after masking: 0x" << std::hex
342  << std::setw(sizeof(activeBoardsGt) * 2) << std::setfill('0') << activeBoardsGt
343  << std::dec << std::setfill(' ') << " \n"
344  << std::endl;
345  }
346 
347  // loop over other blocks in the raw record, count them if they are active
348 
349  int numberGtfeBoards = 0;
350  int numberFdlBoards = 0;
351  int numberPsbBoards = 0;
352  int numberGmtBoards = 0;
353  int numberTcsBoards = 0;
354  int numberTimBoards = 0;
355 
356  for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
357  int iActiveBit = itBoard->gtBitDaqActiveBoards();
358  bool activeBoardToUnpack = false;
359 
360  if (iActiveBit >= 0) {
361  activeBoardToUnpack = activeBoardsGt & (1 << iActiveBit);
362  } else {
363  // board not in the ActiveBoards for the record
364  continue;
365  }
366 
367  if (activeBoardToUnpack) {
368  switch (itBoard->gtBoardType()) {
369  case GTFE: {
370  numberGtfeBoards++;
371  }
372 
373  break;
374  case FDL: {
375  numberFdlBoards++;
376  }
377 
378  break;
379  case PSB: {
380  numberPsbBoards++;
381  }
382 
383  break;
384  case GMT: {
385  numberGmtBoards++;
386  }
387 
388  break;
389  case TCS: {
390  numberTcsBoards++;
391  }
392 
393  break;
394  case TIM: {
395  numberTimBoards++;
396  }
397 
398  break;
399  default: {
400  // do nothing, all blocks are given in GtBoardType enum
401  if (m_verbosity) {
402  LogDebug("L1GlobalTriggerRawToDigi")
403  << "\nBoard of type " << itBoard->gtBoardType() << " not expected in record.\n"
404  << std::endl;
405  }
406  }
407 
408  break;
409  }
410  }
411  }
412 
413  // produce the L1GlobalTriggerReadoutRecord now, after we found the maximum number of
414  // BxInEvent the record has and how many boards are active (it is just reserving space
415  // for vectors)
416  //LogDebug("L1GlobalTriggerRawToDigi")
417  //<< "\nL1GlobalTriggerRawToDigi: producing L1GlobalTriggerReadoutRecord\n"
418  //<< "\nL1GlobalTriggerRawToDigi: producing L1MuGMTReadoutCollection;\n"
419  //<< std::endl;
420 
421  // get number of Bx in the event from GTFE block corresponding to alternative 0 and 1 in
424 
425  int maxBxInEvent = std::max(m_recordLength0, m_recordLength1);
426 
427  std::unique_ptr<L1GlobalTriggerReadoutRecord> gtReadoutRecord(
428  new L1GlobalTriggerReadoutRecord(maxBxInEvent, numberFdlBoards, numberPsbBoards));
429 
430  // produce also the GMT readout collection and set the reference in GT record
431  std::unique_ptr<L1MuGMTReadoutCollection> gmtrc(new L1MuGMTReadoutCollection(maxBxInEvent));
432 
433  //edm::RefProd<L1MuGMTReadoutCollection> refProdMuGMT = iEvent.getRefBeforePut<
434  // L1MuGMTReadoutCollection> ();
435 
436  //if (m_verbosity) {
437  // LogDebug("L1GlobalTriggerRawToDigi")
438  // << "\nL1GlobalTriggerRawToDigi: set L1MuGMTReadoutCollection RefProd"
439  // << " in L1GlobalTriggerReadoutRecord.\n" << std::endl;
440  //}
441  //gtReadoutRecord->setMuCollectionRefProd(refProdMuGMT);
442 
443  // ... then unpack modules other than GTFE, if requested
444 
445  for (CItBoardMaps itBoard = gtRecordMap.begin(); itBoard != gtRecordMap.end(); ++itBoard) {
446  int iActiveBit = itBoard->gtBitDaqActiveBoards();
447 
448  bool activeBoardToUnpack = false;
449  bool activeBoardInitial = false;
450 
451  int altNrBxBoardVal = -1;
452 
453  if (iActiveBit >= 0) {
454  activeBoardInitial = activeBoardsGtInitial & (1 << iActiveBit);
455  activeBoardToUnpack = activeBoardsGt & (1 << iActiveBit);
456 
457  altNrBxBoardVal = (altNrBxBoardInitial & (1 << iActiveBit)) >> iActiveBit;
458 
459  if (altNrBxBoardVal == 1) {
461  } else if (altNrBxBoardVal == 0) {
463  } else {
464  if (m_verbosity) {
465  edm::LogWarning("L1GlobalTriggerRawToDigi")
466  << "\n\nWARNING: Wrong value altNrBxBoardVal = " << altNrBxBoardVal << " for board " << std::hex
467  << (itBoard->gtBoardId()) << std::dec << "\n iActiveBit = " << iActiveBit
468  << "\n altNrBxBoardInitial = 0x" << std::hex << altNrBxBoardInitial << std::dec
469  << "\n activeBoardsGt = 0x" << std::hex << activeBoardsGt << std::dec
470  << "\n activeBoardInitial = " << activeBoardInitial
471  << "\n activeBoardToUnpack = " << activeBoardToUnpack << "\n Set altNrBxBoardVal tentatively to "
472  << m_recordLength0 << "\n Job may crash or produce wrong results!\n\n"
473  << std::endl;
474  }
475 
477  }
478 
479  // number of BX required to be unpacked
480 
482  if (m_verbosity) {
483  LogDebug("L1GlobalTriggerRawToDigi")
484  << "\nWARNING: Number of available bunch crosses for board" << (itBoard->gtBoardId())
485  << " in the record ( " << m_totalBxInEvent
486  << " ) \n is smaller than the number of bunch crosses requested to be unpacked (" << m_unpackBxInEvent
487  << " )!!! \n Unpacking only " << m_totalBxInEvent << " bunch crosses.\n"
488  << std::endl;
489  }
490 
491  m_lowSkipBxInEvent = 0;
493 
494  } else if (m_unpackBxInEvent < 0) {
495  m_lowSkipBxInEvent = 0;
497 
498  if (m_verbosity) {
499  LogDebug("L1GlobalTriggerRawToDigi") << "\nUnpacking all " << m_totalBxInEvent << " bunch crosses available."
500  << "\n"
501  << std::endl;
502  }
503 
504  } else if (m_unpackBxInEvent == 0) {
507 
508  if (m_verbosity) {
509  LogDebug("L1GlobalTriggerRawToDigi")
510  << "\nNo bxInEvent required to be unpacked from " << m_totalBxInEvent << " bunch crosses available."
511  << "\n"
512  << std::endl;
513  }
514 
515  // change RecordLength
516  // cast int to cms_uint16_t (there are normally 3 or 5 BxInEvent)
517  m_gtfeWord->setRecordLength(static_cast<cms_uint16_t>(m_unpackBxInEvent));
518  m_gtfeWord->setRecordLength1(static_cast<cms_uint16_t>(m_unpackBxInEvent));
519 
520  } else {
523 
524  if (m_verbosity) {
525  LogDebug("L1GlobalTriggerRawToDigi") << "\nUnpacking " << m_unpackBxInEvent << " bunch crosses from "
526  << m_totalBxInEvent << " bunch crosses available."
527  << "\n"
528  << std::endl;
529  }
530 
531  // change RecordLength
532  // cast int to cms_uint16_t (there are normally 3 or 5 BxInEvent)
533  m_gtfeWord->setRecordLength(static_cast<cms_uint16_t>(m_unpackBxInEvent));
534  m_gtfeWord->setRecordLength1(static_cast<cms_uint16_t>(m_unpackBxInEvent));
535  }
536 
537  } else {
538  // board not in the ActiveBoards for the record
539  continue;
540  }
541 
542  if (!activeBoardInitial) {
543  if (m_verbosity) {
544  LogDebug("L1GlobalTriggerRawToDigi") << "\nBoard of type " << itBoard->gtBoardName() << " with index "
545  << itBoard->gtBoardIndex() << " not active initially in raw data.\n"
546  << std::endl;
547  }
548  continue;
549  }
550 
551  // active board initially, could unpack it
552  switch (itBoard->gtBoardType()) {
553  case FDL: {
554  for (int iFdl = 0; iFdl < m_totalBxInEvent; ++iFdl) {
555  // if pointer after FDL payload is greater than pointer at
556  // the end of GT payload, produce empty products and quit unpacking
557  if ((ptrGt + m_gtFdlWord->getSize()) > endPtrGt) {
558  edm::LogError("L1GlobalTriggerRawToDigi")
559  << "\nError: Pointer after FDL " << iFdl << " greater than end pointer."
560  << "\n Put empty products in the event!"
561  << "\n Quit unpacking this event." << std::endl;
562 
564 
565  return;
566  }
567 
568  // unpack only if requested, otherwise skip it
569  if (activeBoardToUnpack) {
570  // unpack only bxInEvent requested, otherwise skip it
571  if ((iFdl >= m_lowSkipBxInEvent) && (iFdl < m_uppSkipBxInEvent)) {
572  m_gtFdlWord->unpack(ptrGt);
573 
574  // add 1 to the GT luminosity number to use the same convention as
575  // offline, where LS number starts with 1;
576  // in GT hardware, LS starts with 0
577  cms_uint16_t lsNr = m_gtFdlWord->lumiSegmentNr() + 1;
579 
580  // add FDL block to GT readout record
581  gtReadoutRecord->setGtFdlWord(*m_gtFdlWord);
582 
583  if (m_verbosity && m_isDebugEnabled) {
584  std::ostringstream myCoutStream;
585  m_gtFdlWord->print(myCoutStream);
586  LogTrace("L1GlobalTriggerRawToDigi") << myCoutStream.str() << "\n" << std::endl;
587  }
588 
589  // ... and reset it
590  m_gtFdlWord->reset();
591  }
592  }
593 
594  ptrGt += m_gtFdlWord->getSize(); // advance with FDL block size
595  }
596  }
597 
598  break;
599  case PSB: {
600  for (int iPsb = 0; iPsb < m_totalBxInEvent; ++iPsb) {
601  // if pointer after PSB payload is greater than pointer at
602  // the end of GT payload, produce empty products and quit unpacking
603  if ((ptrGt + m_gtPsbWord->getSize()) > endPtrGt) {
604  edm::LogError("L1GlobalTriggerRawToDigi")
605  << "\nError: Pointer after PSB " << iPsb << " greater than end pointer."
606  << "\n Put empty products in the event!"
607  << "\n Quit unpacking this event." << std::endl;
608 
610 
611  return;
612  }
613 
614  // unpack only if requested, otherwise skip it
615  if (activeBoardToUnpack) {
616  // unpack only bxInEvent requested, otherwise skip it
617  if ((iPsb >= m_lowSkipBxInEvent) && (iPsb < m_uppSkipBxInEvent)) {
618  unpackPSB(evSetup, ptrGt, *m_gtPsbWord);
619 
620  // add PSB block to GT readout record
621  gtReadoutRecord->setGtPsbWord(*m_gtPsbWord);
622 
623  if (m_verbosity && m_isDebugEnabled) {
624  std::ostringstream myCoutStream;
625  m_gtPsbWord->print(myCoutStream);
626  LogTrace("L1GlobalTriggerRawToDigi") << myCoutStream.str() << "\n" << std::endl;
627  }
628 
629  // ... and reset it
630  m_gtPsbWord->reset();
631  }
632  }
633 
634  ptrGt += m_gtPsbWord->getSize(); // advance with PSB block size
635  }
636  } break;
637  case GMT: {
638  // 17*64/8 TODO FIXME ask Ivan for a getSize() function for GMT record
639  unsigned int gmtRecordSize = 136;
640  unsigned int gmtCollSize = m_totalBxInEvent * gmtRecordSize;
641 
642  // if pointer after GMT payload is greater than pointer at
643  // the end of GT payload, produce empty products and quit unpacking
644  if ((ptrGt + gmtCollSize) > endPtrGt) {
645  edm::LogError("L1GlobalTriggerRawToDigi") << "\nError: Pointer after GMT "
646  << " greater than end pointer."
647  << "\n Put empty products in the event!"
648  << "\n Quit unpacking this event." << std::endl;
649 
651 
652  return;
653  }
654 
655  // unpack only if requested, otherwise skip it
656  if (activeBoardToUnpack) {
657  unpackGMT(ptrGt, gmtrc, iEvent);
658  }
659 
660  ptrGt += gmtCollSize; // advance with GMT block size
661  } break;
662  default: {
663  // do nothing, all blocks are given in GtBoardType enum
664  if (m_verbosity) {
665  LogDebug("L1GlobalTriggerRawToDigi")
666  << "\nBoard of type " << itBoard->gtBoardType() << " not expected in record.\n"
667  << std::endl;
668  }
669  } break;
670  }
671  }
672 
673  // add GTFE block to GT readout record, after updating active boards and record length
674 
675  gtReadoutRecord->setGtfeWord(*m_gtfeWord);
676 
677  // ... and reset it
678  m_gtfeWord->reset();
679 
680  // unpack trailer
681 
682  int trailerSize = 8;
683 
684  // if pointer after trailer is greater than pointer at
685  // the end of GT payload, produce empty products and quit unpacking
686  if ((ptrGt + trailerSize) > endPtrGt) {
687  edm::LogError("L1GlobalTriggerRawToDigi") << "\nError: Pointer after trailer "
688  << " greater than end pointer."
689  << "\n Put empty products in the event!"
690  << "\n Quit unpacking this event." << std::endl;
691 
693 
694  return;
695  }
696 
697  unpackTrailer(ptrGt, cmsTrailer);
698 
699  //
700  if (m_verbosity && m_isDebugEnabled) {
701  std::ostringstream myCoutStream;
702  gtReadoutRecord->print(myCoutStream);
703  LogTrace("L1GlobalTriggerRawToDigi") << "\n The following L1 GT DAQ readout record was unpacked.\n"
704  << myCoutStream.str() << "\n"
705  << std::endl;
706  }
707 
708  // put records into event
709 
710  iEvent.put(std::move(gmtrc));
711  iEvent.put(std::move(gtReadoutRecord));
712 }
713 
714 // unpack header
715 void L1GlobalTriggerRawToDigi::unpackHeader(const unsigned char* gtPtr, FEDHeader& cmsHeader) {
716  // TODO if needed in another format
717 
718  // print the header info
719  if (m_verbosity && m_isDebugEnabled) {
720  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(gtPtr));
721 
722  std::ostringstream myCoutStream;
723 
724  // one word only
725  int iWord = 0;
726 
727  myCoutStream << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16) << payload[iWord]
728  << std::dec << std::setfill(' ') << "\n"
729  << std::endl;
730 
731  myCoutStream << " Event_type: " << std::hex << " hex: "
732  << " " << std::setw(1) << std::setfill('0') << cmsHeader.triggerType() << std::setfill(' ')
733  << std::dec << " dec: " << cmsHeader.triggerType() << std::endl;
734 
735  myCoutStream << " LVL1_Id: " << std::hex << " hex: "
736  << "" << std::setw(6) << std::setfill('0') << cmsHeader.lvl1ID() << std::setfill(' ') << std::dec
737  << " dec: " << cmsHeader.lvl1ID() << std::endl;
738 
739  myCoutStream << " BX_Id: " << std::hex << " hex: "
740  << " " << std::setw(3) << std::setfill('0') << cmsHeader.bxID() << std::setfill(' ') << std::dec
741  << " dec: " << cmsHeader.bxID() << std::endl;
742 
743  myCoutStream << " Source_Id: " << std::hex << " hex: "
744  << " " << std::setw(3) << std::setfill('0') << cmsHeader.sourceID() << std::setfill(' ') << std::dec
745  << " dec: " << cmsHeader.sourceID() << std::endl;
746 
747  myCoutStream << " FOV: " << std::hex << " hex: "
748  << " " << std::setw(1) << std::setfill('0') << cmsHeader.version() << std::setfill(' ') << std::dec
749  << " dec: " << cmsHeader.version() << std::endl;
750 
751  myCoutStream << " H: " << std::hex << " hex: "
752  << " " << std::setw(1) << std::setfill('0') << cmsHeader.moreHeaders() << std::setfill(' ')
753  << std::dec << " dec: " << cmsHeader.moreHeaders() << std::endl;
754 
755  LogDebug("L1GlobalTriggerRawToDigi") << "\n CMS Header \n" << myCoutStream.str() << "\n" << std::endl;
756  }
757 }
758 
759 // unpack PSB records
760 // psbPtr pointer to the beginning of the each PSB block obtained from gtPtr
762  const unsigned char* psbPtr,
763  L1GtPsbWord& psbWord) {
764  //LogDebug("L1GlobalTriggerRawToDigi")
765  //<< "\nUnpacking PSB block.\n"
766  //<< std::endl;
767 
769 
770  int psbSize = psbWord.getSize();
771  int psbWords = psbSize / uLength;
772 
773  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(psbPtr));
774 
775  for (int iWord = 0; iWord < psbWords; ++iWord) {
776  // fill PSB
777  // the second argument must match the word index defined in L1GtPsbWord class
778 
779  psbWord.setBoardId(payload[iWord], iWord);
780  psbWord.setBxInEvent(payload[iWord], iWord);
781  psbWord.setBxNr(payload[iWord], iWord);
782  psbWord.setEventNr(payload[iWord], iWord);
783 
784  psbWord.setAData(payload[iWord], iWord);
785  psbWord.setBData(payload[iWord], iWord);
786 
787  psbWord.setLocalBxNr(payload[iWord], iWord);
788 
789  LogTrace("L1GlobalTriggerRawToDigi") << std::setw(4) << iWord << " " << std::hex << std::setfill('0')
790  << std::setw(16) << payload[iWord] << std::dec << std::setfill(' ')
791  << std::endl;
792  }
793 }
794 
795 // unpack the GMT record
796 void L1GlobalTriggerRawToDigi::unpackGMT(const unsigned char* chp,
797  std::unique_ptr<L1MuGMTReadoutCollection>& gmtrc,
798  edm::Event& iEvent) {
799  //LogDebug("L1GlobalTriggerRawToDigi")
800  //<< "\nUnpacking GMT collection.\n"
801  //<< std::endl;
802 
803  // 17*64/2 TODO FIXME ask Ivan for a getSize() function for GMT record
804  const unsigned int gmtRecordSize32 = 34;
805 
806  std::unique_ptr<std::vector<L1MuRegionalCand> > DTCands(new std::vector<L1MuRegionalCand>);
807  std::unique_ptr<std::vector<L1MuRegionalCand> > CSCCands(new std::vector<L1MuRegionalCand>);
808  std::unique_ptr<std::vector<L1MuRegionalCand> > RPCbCands(new std::vector<L1MuRegionalCand>);
809  std::unique_ptr<std::vector<L1MuRegionalCand> > RPCfCands(new std::vector<L1MuRegionalCand>);
810  std::unique_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
811 
812  const unsigned* p = (const unsigned*)chp;
813 
814  // min Bx's in the event, computed after m_totalBxInEvent is obtained from GTFE block
815  // assume symmetrical number of BX around L1Accept
816  int iBxInEvent = (m_totalBxInEvent + 1) / 2 - m_totalBxInEvent;
817 
818  for (int iGmtRec = 0; iGmtRec < m_totalBxInEvent; ++iGmtRec) {
819  // unpack only bxInEvent requested, otherwise skip it
820  if ((iGmtRec >= m_lowSkipBxInEvent) && (iGmtRec < m_uppSkipBxInEvent)) {
821  // Dump the block
822  const cms_uint64_t* bp = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned*>(p));
823  for (int iWord = 0; iWord < 17; iWord++) {
824  LogTrace("L1GlobalTriggerRawToDigi") << std::setw(4) << iWord << " " << std::hex << std::setfill('0')
825  << std::setw(16) << *bp++ << std::dec << std::setfill(' ') << std::endl;
826  }
827 
828  L1MuGMTReadoutRecord gmtrr(iBxInEvent);
829 
830  gmtrr.setEvNr((*p) & 0xffffff);
831  gmtrr.setBCERR(((*p) >> 24) & 0xff);
832  p++;
833 
834  gmtrr.setBxNr((*p) & 0xfff);
835  if (((*p) >> 15) & 1) {
836  gmtrr.setBxInEvent((((*p) >> 12) & 7) - 8);
837  } else {
838  gmtrr.setBxInEvent((((*p) >> 12) & 7));
839  }
840  // to do: check here the block length and the board id
841  p++;
842 
843  for (int im = 0; im < 16; im++) {
844  // flip the pt and quality bits -- this should better be done by GMT input chips
845  unsigned waux = *p++;
846  waux = (waux & 0xffff00ff) | ((~waux) & 0x0000ff00);
847  L1MuRegionalCand cand(waux, iBxInEvent);
848  // fix the type assignment (csc=2, rpcb=1) -- should be done by GMT input chips
849  if (im >= 4 && im < 8)
850  cand.setType(1);
851  if (im >= 8 && im < 12)
852  cand.setType(2);
853  cand.setPhiValue(m_TriggerScales->getPhiScale()->getLowEdge(cand.phi_packed()));
854  cand.setEtaValue(m_TriggerScales->getRegionalEtaScale(cand.type_idx())->getCenter(cand.eta_packed()));
855  cand.setPtValue(m_TriggerPtScale->getPtScale()->getLowEdge(cand.pt_packed()));
856  gmtrr.setInputCand(im, cand);
857  if (!cand.empty()) {
858  if (im < 4)
859  DTCands->push_back(cand);
860  if (im >= 4 && im < 8)
861  RPCbCands->push_back(cand);
862  if (im >= 8 && im < 12)
863  CSCCands->push_back(cand);
864  if (im >= 12)
865  RPCfCands->push_back(cand);
866  }
867  }
868 
869  unsigned char* prank = (unsigned char*)(p + 12);
870 
871  for (int im = 0; im < 12; im++) {
872  unsigned waux = *p++;
873  unsigned raux = im < 8 ? *prank++ : 0; // only fwd and brl cands have valid rank
874  L1MuGMTExtendedCand cand(waux, raux, iBxInEvent);
875  cand.setPhiValue(m_TriggerScales->getPhiScale()->getLowEdge(cand.phiIndex()));
876  cand.setEtaValue(m_TriggerScales->getGMTEtaScale()->getCenter(cand.etaIndex()));
877  cand.setPtValue(m_TriggerPtScale->getPtScale()->getLowEdge(cand.ptIndex()));
878  if (im < 4)
879  gmtrr.setGMTBrlCand(im, cand);
880  else if (im < 8)
881  gmtrr.setGMTFwdCand(im - 4, cand);
882  else {
883  gmtrr.setGMTCand(im - 8, cand);
884  if (!cand.empty())
885  GMTCands->push_back(cand);
886  }
887  }
888 
889  // skip the two sort rank words and two chip BX words
890  p += 4;
891 
892  gmtrc->addRecord(gmtrr);
893 
894  } else {
895  // increase the pointer with the GMT record size
896  p += gmtRecordSize32;
897  }
898 
899  // increase the BxInEvent number
900  iBxInEvent++;
901  }
902 
903  iEvent.put(std::move(DTCands), "DT");
904  iEvent.put(std::move(CSCCands), "CSC");
905  iEvent.put(std::move(RPCbCands), "RPCb");
906  iEvent.put(std::move(RPCfCands), "RPCf");
907  iEvent.put(std::move(GMTCands));
908 }
909 
910 // unpack trailer word
911 // trPtr pointer to the beginning of trailer obtained from gtPtr
912 void L1GlobalTriggerRawToDigi::unpackTrailer(const unsigned char* trlPtr, FEDTrailer& cmsTrailer) {
913  // TODO if needed in another format
914 
915  // print the trailer info
916  if (m_verbosity && m_isDebugEnabled) {
917  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(trlPtr));
918 
919  std::ostringstream myCoutStream;
920 
921  // one word only
922  int iWord = 0;
923 
924  myCoutStream << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16) << payload[iWord]
925  << std::dec << std::setfill(' ') << "\n"
926  << std::endl;
927 
928  myCoutStream << " Event_length: " << std::hex << " hex: "
929  << "" << std::setw(6) << std::setfill('0') << cmsTrailer.fragmentLength() << std::setfill(' ')
930  << std::dec << " dec: " << cmsTrailer.fragmentLength() << std::endl;
931 
932  myCoutStream << " CRC: " << std::hex << " hex: "
933  << " " << std::setw(4) << std::setfill('0') << cmsTrailer.crc() << std::setfill(' ') << std::dec
934  << " dec: " << cmsTrailer.crc() << std::endl;
935 
936  myCoutStream << " Event_status: " << std::hex << " hex: "
937  << " " << std::setw(2) << std::setfill('0') << cmsTrailer.evtStatus() << std::setfill(' ')
938  << std::dec << " dec: " << cmsTrailer.evtStatus() << std::endl;
939 
940  myCoutStream << " TTS_bits: " << std::hex << " hex: "
941  << " " << std::setw(1) << std::setfill('0') << cmsTrailer.ttsBits() << std::setfill(' ')
942  << std::dec << " dec: " << cmsTrailer.ttsBits() << std::endl;
943 
944  myCoutStream << " More trailers: " << std::hex << " hex: "
945  << " " << std::setw(1) << std::setfill('0') << cmsTrailer.moreTrailers() << std::setfill(' ')
946  << std::dec << " dec: " << cmsTrailer.moreTrailers() << std::endl;
947 
948  LogDebug("L1GlobalTriggerRawToDigi") << "\n CMS Trailer \n" << myCoutStream.str() << "\n" << std::endl;
949  }
950 }
951 
952 // produce empty products in case of problems
954  std::unique_ptr<L1GlobalTriggerReadoutRecord> gtReadoutRecord(new L1GlobalTriggerReadoutRecord());
955 
956  std::unique_ptr<L1MuGMTReadoutCollection> gmtrc(new L1MuGMTReadoutCollection());
957 
958  std::unique_ptr<std::vector<L1MuRegionalCand> > DTCands(new std::vector<L1MuRegionalCand>);
959  std::unique_ptr<std::vector<L1MuRegionalCand> > CSCCands(new std::vector<L1MuRegionalCand>);
960  std::unique_ptr<std::vector<L1MuRegionalCand> > RPCbCands(new std::vector<L1MuRegionalCand>);
961  std::unique_ptr<std::vector<L1MuRegionalCand> > RPCfCands(new std::vector<L1MuRegionalCand>);
962  std::unique_ptr<std::vector<L1MuGMTCand> > GMTCands(new std::vector<L1MuGMTCand>);
963 
964  // put empty records into event
965 
966  iEvent.put(std::move(gmtrc));
967  iEvent.put(std::move(gtReadoutRecord));
968 
969  iEvent.put(std::move(DTCands), "DT");
970  iEvent.put(std::move(CSCCands), "CSC");
971  iEvent.put(std::move(RPCbCands), "RPCb");
972  iEvent.put(std::move(RPCfCands), "RPCf");
973  iEvent.put(std::move(GMTCands));
974 }
975 
976 // dump FED raw data
977 void L1GlobalTriggerRawToDigi::dumpFedRawData(const unsigned char* gtPtr, int gtSize, std::ostream& myCout) {
978  LogDebug("L1GlobalTriggerRawToDigi") << "\nDump FED raw data.\n" << std::endl;
979 
982 
983  int gtWords = gtSize / uLength;
984  LogTrace("L1GlobalTriggerRawToDigi") << "\nFED GT words (" << wLength << " bits):" << gtWords << "\n" << std::endl;
985 
986  const cms_uint64_t* payload = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(gtPtr));
987 
988  for (unsigned int i = 0; i < gtSize / sizeof(cms_uint64_t); i++) {
989  myCout << std::setw(4) << i << " " << std::hex << std::setfill('0') << std::setw(16) << payload[i] << std::dec
990  << std::setfill(' ') << std::endl;
991  }
992 }
993 
994 // static class members
ConfigurationDescriptions.h
L1GlobalTriggerRawToDigi::m_daqGtInputTag
edm::InputTag m_daqGtInputTag
input tags for GT DAQ record
Definition: L1GlobalTriggerRawToDigi.h:90
L1GlobalTriggerReadoutSetup::WordLength
static const int WordLength
GT DAQ record organized in words of WordLength bits.
Definition: L1GlobalTriggerReadoutSetup.h:53
FEDNumbering.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1GtfeWord::activeBoards
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:119
mps_fire.i
i
Definition: mps_fire.py:355
L1GlobalTriggerReadoutSetup::UnitLength
static const int UnitLength
one unit in the word is UnitLength bits
Definition: L1GlobalTriggerReadoutSetup.h:56
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
L1GlobalTriggerRawToDigi::m_recordLength1
int m_recordLength1
corresponding to alternative 1 in altNrBxBoard()
Definition: L1GlobalTriggerRawToDigi.h:116
L1GtPsbWord::setBData
void setBData(cms_uint16_t bDataVal, int iB)
Definition: L1GtPsbWord.cc:263
MessageLogger.h
L1MuGMTExtendedCand
Definition: L1MuGMTExtendedCand.h:46
L1MuTriggerScales::getGMTEtaScale
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
Definition: L1MuTriggerScales.h:169
FDL
Definition: L1GtDefinitions.h:27
edm::Handle::product
T const * product() const
Definition: Handle.h:70
PSB
Definition: L1GtDefinitions.h:27
FEDHeader::moreHeaders
bool moreHeaders() const
Definition: FEDHeader.cc:23
ESHandle.h
L1GtPsbWord::reset
void reset()
reset the content of a L1GtPsbWord
Definition: L1GtPsbWord.cc:330
L1MuGMTReadoutRecord::setInputCand
void setInputCand(int nr, unsigned data)
set Input muon
Definition: L1MuGMTReadoutRecord.cc:223
L1GlobalTriggerRawToDigi.h
L1MuTriggerPtScaleRcd.h
edm
HLT enums.
Definition: AlignableModifier.h:19
L1GlobalTriggerRawToDigi::m_gtPsbWord
L1GtPsbWord * m_gtPsbWord
Definition: L1GlobalTriggerRawToDigi.h:86
L1MuGMTReadoutRecord::setBxInEvent
void setBxInEvent(int bxie)
Definition: L1MuGMTReadoutRecord.h:105
L1MuGMTReadoutCollection.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FEDTrailer::crc
uint16_t crc() const
Cyclic Redundancy Code of the event fragment including header and trailer.
Definition: FEDTrailer.cc:15
L1GtfeWord::setRecordLength
void setRecordLength(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:84
L1MuGMTReadoutRecord::setGMTBrlCand
void setGMTBrlCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT barrel candidate
Definition: L1MuGMTReadoutRecord.cc:230
edm::LogInfo
Definition: MessageLogger.h:254
L1GtfeWord::print
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
Definition: L1GtfeWord.cc:253
L1GtPsbWord::getSize
const unsigned int getSize() const
get the size of the PSB block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtPsbWord.h:147
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
FEDHeader::version
uint8_t version() const
Version identifier of the FED data format.
Definition: FEDHeader.cc:21
GTFE
Definition: L1GtDefinitions.h:27
L1GtPsbWord.h
L1GtfeWord::setRecordLength1
void setRecordLength1(cms_uint16_t recordLengthValue)
Definition: L1GtfeWord.h:73
L1GtPsbWord::setEventNr
void setEventNr(cms_uint32_t eventNrValue)
Definition: L1GtPsbWord.h:99
FEDTrailer::evtStatus
uint8_t evtStatus() const
Event fragment status information.
Definition: FEDTrailer.cc:17
L1GtfeWord
Definition: L1GtfeWord.h:30
FEDHeader::lvl1ID
uint32_t lvl1ID() const
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:15
L1GlobalTriggerRawToDigi::m_totalBxInEvent
int m_totalBxInEvent
number of Bx for a board, obtained from GTFE block (record length & alternative)
Definition: L1GlobalTriggerRawToDigi.h:119
L1MuTriggerScalesRcd.h
L1MuGMTReadoutRecord::setGMTFwdCand
void setGMTFwdCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT forward candidate
Definition: L1MuGMTReadoutRecord.cc:244
L1GlobalTriggerRawToDigi::dumpFedRawData
void dumpFedRawData(const unsigned char *, int, std::ostream &)
dump FED raw data
Definition: L1GlobaTriggerRawToDigi.cc:977
L1GtPsbWord
Definition: L1GtPsbWord.h:29
L1MuGMTReadoutRecord::setBCERR
void setBCERR(int bcerr)
Definition: L1MuGMTReadoutRecord.h:107
L1GlobalTriggerRawToDigi::unpackTrailer
void unpackTrailer(const unsigned char *, FEDTrailer &)
unpack trailer word
Definition: L1GlobaTriggerRawToDigi.cc:912
edm::Handle
Definition: AssociativeIterator.h:50
L1GtFdlWord::unpack
void unpack(const unsigned char *fdlPtr)
Definition: L1GtFdlWord.cc:689
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
L1MuRegionalCand.h
FEDNumbering
Definition: FEDNumbering.h:17
L1GtfeWord::recordLength
const cms_uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:82
L1MuTriggerScales::getPhiScale
const L1MuScale * getPhiScale() const
get the phi scale
Definition: L1MuTriggerScales.h:175
L1GlobalTriggerRawToDigi::m_verbosity
int m_verbosity
verbosity level
Definition: L1GlobalTriggerRawToDigi.h:127
L1GtPsbWord::setBxNr
void setBxNr(cms_uint16_t bxNrValue)
Definition: L1GtPsbWord.h:86
L1GlobalTriggerRawToDigi::unpackPSB
void unpackPSB(const edm::EventSetup &, const unsigned char *, L1GtPsbWord &)
Definition: L1GlobaTriggerRawToDigi.cc:761
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
L1MuGMTReadoutRecord
Definition: L1MuGMTReadoutRecord.h:44
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
L1GtfeWord::reset
virtual void reset()
reset the content of a L1GtfeWord
Definition: L1GtfeWord.cc:240
L1MuTriggerScales::getRegionalEtaScale
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC)
Definition: L1MuTriggerScales.h:158
L1GlobalTriggerRawToDigi::produceEmptyProducts
void produceEmptyProducts(edm::Event &)
produce empty products in case of problems
Definition: L1GlobaTriggerRawToDigi.cc:953
L1GlobalTriggerRawToDigi::m_unpackBxInEvent
int m_unpackBxInEvent
Definition: L1GlobalTriggerRawToDigi.h:100
edm::ESHandle
Definition: DTSurvey.h:22
FEDNumbering::MAXTriggerGTPFEDID
Definition: FEDNumbering.h:62
GMT
Definition: L1GtDefinitions.h:27
L1MuRegionalCand
Definition: L1MuRegionalCand.h:26
L1GlobalTriggerRawToDigi::m_TriggerScales
const L1MuTriggerScales * m_TriggerScales
muon trigger scales to convert unpacked data into physical quantities
Definition: L1GlobalTriggerRawToDigi.h:122
L1GtfeWord::setActiveBoards
void setActiveBoards(cms_uint16_t activeBoardsValue)
Definition: L1GtfeWord.h:121
L1MuScale::getLowEdge
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
L1GtFdlWord.h
jets_cff.payload
payload
Definition: jets_cff.py:34
L1GtPsbWord::print
void print(std::ostream &myCout) const
pretty print
Definition: L1GtPsbWord.cc:348
ParameterSetDescription.h
L1GlobalTriggerRawToDigi::m_gtFdlWord
L1GtFdlWord * m_gtFdlWord
Definition: L1GlobalTriggerRawToDigi.h:87
L1GtPsbWord::setBoardId
void setBoardId(cms_uint16_t boardIdValue)
Definition: L1GtPsbWord.h:60
L1GtfeWord::getSize
const unsigned int getSize() const
get the size of the GTFE block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtfeWord.h:160
L1GlobalTriggerRawToDigi::m_uppSkipBxInEvent
int m_uppSkipBxInEvent
Definition: L1GlobalTriggerRawToDigi.h:108
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
L1GtFdlWord::setLumiSegmentNr
void setLumiSegmentNr(const cms_uint16_t &lumiSegmentNrValue)
Definition: L1GtFdlWord.h:249
edm::LogWarning
Definition: MessageLogger.h:141
L1GlobalTriggerRawToDigi::m_TriggerPtScale
const L1MuTriggerPtScale * m_TriggerPtScale
Definition: L1GlobalTriggerRawToDigi.h:123
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
L1GlobalTriggerRawToDigi::unpackHeader
void unpackHeader(const unsigned char *, FEDHeader &)
block unpackers
Definition: L1GlobaTriggerRawToDigi.cc:715
L1GtBoard.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:36
L1GtPsbWord::setBxInEvent
void setBxInEvent(int bxInEventValue)
Definition: L1GtPsbWord.h:73
L1GlobalTriggerRawToDigi::m_activeBoardsMaskGt
cms_uint16_t m_activeBoardsMaskGt
mask for active boards
Definition: L1GlobalTriggerRawToDigi.h:97
edm::LogError
Definition: MessageLogger.h:183
FEDTrailer
Definition: FEDTrailer.h:14
L1GlobalTriggerReadoutSetup.h
L1GtFdlWord::reset
void reset()
reset the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:567
FEDHeader::triggerType
uint8_t triggerType() const
Event Trigger type identifier.
Definition: FEDHeader.cc:13
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
L1MuTriggerPtScale::getPtScale
const L1MuScale * getPtScale() const
get the Pt scale
Definition: L1MuTriggerPtScale.h:59
L1GlobalTriggerRawToDigi::m_isDebugEnabled
bool m_isDebugEnabled
Definition: L1GlobalTriggerRawToDigi.h:128
L1MuTriggerPtScale.h
L1GtFdlWord
Definition: L1GtFdlWord.h:29
L1GlobalTriggerRawToDigi::~L1GlobalTriggerRawToDigi
~L1GlobalTriggerRawToDigi() override
destructor
Definition: L1GlobaTriggerRawToDigi.cc:135
cand
Definition: decayParser.h:34
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
FEDTrailer::moreTrailers
bool moreTrailers() const
Definition: FEDTrailer.cc:21
L1MuTriggerScales.h
L1GtFwd.h
FEDRawDataCollection.h
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
L1GlobalTriggerRawToDigi::m_recordLength0
int m_recordLength0
total Bx's in the event, obtained from GTFE block
Definition: L1GlobalTriggerRawToDigi.h:113
cms_uint16_t
unsigned short cms_uint16_t
Definition: typedefs.h:13
edm::EventSetup
Definition: EventSetup.h:57
L1MuTriggerPtScaleRcd
Definition: L1MuTriggerPtScaleRcd.h:12
L1GlobalTriggerRawToDigi::m_gtfeWord
L1GtfeWord * m_gtfeWord
Definition: L1GlobalTriggerRawToDigi.h:85
L1GtFdlWord::lumiSegmentNr
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
Definition: L1GtFdlWord.h:247
get
#define get
L1GlobalTriggerRawToDigi::L1GlobalTriggerRawToDigi
L1GlobalTriggerRawToDigi(const edm::ParameterSet &)
constructor(s)
Definition: L1GlobaTriggerRawToDigi.cc:64
L1GtBoardMaps.h
L1GtfeWord.h
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
L1MuTriggerScalesRcd
Definition: L1MuTriggerScalesRcd.h:12
FEDHeader::bxID
uint16_t bxID() const
The bunch crossing number.
Definition: FEDHeader.cc:17
InputTag.h
TCS
Definition: L1GtDefinitions.h:27
L1MuGMTReadoutCollection
Definition: L1MuGMTReadoutCollection.h:39
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1MuGMTReadoutRecord::setGMTCand
void setGMTCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT candidate (does not store rank)
Definition: L1MuGMTReadoutRecord.cc:258
L1GtfeWord::recordLength1
const cms_uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:71
L1GlobalTriggerRawToDigi::m_daqGtFedId
int m_daqGtFedId
Definition: L1GlobalTriggerRawToDigi.h:94
L1GlobalTriggerRawToDigi::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L1GlobaTriggerRawToDigi.cc:141
L1GlobalTriggerRawToDigi::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1GlobaTriggerRawToDigi.cc:172
L1MuGMTReadoutRecord::setEvNr
void setEvNr(int evnr)
Definition: L1MuGMTReadoutRecord.h:106
L1GtFdlWord::getSize
const unsigned int getSize() const
get the size of the FDL block in GT DAQ record (in multiple of 8 bits)
Definition: L1GtFdlWord.h:271
L1GtFdlWord::print
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:595
L1GtfeWord::unpack
virtual void unpack(const unsigned char *gtfePtr)
Definition: L1GtfeWord.cc:290
L1GlobalTriggerRawToDigi::m_lowSkipBxInEvent
int m_lowSkipBxInEvent
Definition: L1GlobalTriggerRawToDigi.h:104
EventSetup.h
FEDHeader::sourceID
uint16_t sourceID() const
Identifier of the FED.
Definition: FEDHeader.cc:19
L1GtBoardMaps::gtBoardMaps
const std::vector< L1GtBoard > & gtBoardMaps() const
get / set / print the L1 GT board map
Definition: L1GtBoardMaps.h:43
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:71
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
ParameterSet.h
L1GtBoardMapsRcd
Definition: L1GtBoardMapsRcd.h:39
FEDTrailer::ttsBits
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
Definition: FEDTrailer.cc:19
TIM
Definition: L1GtDefinitions.h:27
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
FEDHeader
Definition: FEDHeader.h:14
edm::Event
Definition: Event.h:73
L1MuGMTExtendedCand.h
FEDHeader.h
L1GtfeWord::altNrBxBoard
const cms_uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:134
L1GlobalTriggerRawToDigi::unpackGMT
void unpackGMT(const unsigned char *, std::unique_ptr< L1MuGMTReadoutCollection > &, edm::Event &)
unpack the GMT record
Definition: L1GlobaTriggerRawToDigi.cc:796
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
L1GtBoardMapsRcd.h
L1MuScale::getCenter
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
L1GtPsbWord::setAData
void setAData(cms_uint16_t aDataVal, int iA)
Definition: L1GtPsbWord.cc:191
L1MuGMTReadoutRecord::setBxNr
void setBxNr(int bxnr)
set counters
Definition: L1MuGMTReadoutRecord.h:103
FEDTrailer::fragmentLength
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:13
FEDTrailer.h
L1GtPsbWord::setLocalBxNr
void setLocalBxNr(cms_uint16_t localBxNrValue)
Definition: L1GtPsbWord.h:136