CMS 3D CMS Logo

L1GTEvmDigiToRaw.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <vector>
20 #include <iostream>
21 #include <iomanip>
22 
23 // user include files
26 
30 
33 
38 
41 
44 
47 
50 
51 // constructor(s)
53  : m_evmGtFedId(pSet.getUntrackedParameter<int>("EvmGtFedId", FEDNumbering::MINTriggerGTPFEDID)),
54  m_evmGtInputToken(consumes<L1GlobalTriggerEvmReadoutRecord>(pSet.getParameter<edm::InputTag>("EvmGtInputTag"))),
55  m_evmGtInputTag(pSet.getParameter<edm::InputTag>("EvmGtInputTag")),
56  m_l1GtBMToken(esConsumes<L1GtBoardMaps, L1GtBoardMapsRcd>()),
57  m_activeBoardsMaskGt(pSet.getParameter<unsigned int>("ActiveBoardsMask")),
58  m_totalBxInEvent(0),
59  m_minBxInEvent(0),
60  m_maxBxInEvent(),
61  m_verbosity(pSet.getUntrackedParameter<int>("Verbosity", 0)),
62  m_isDebugEnabled(edm::isDebugEnabled())
63 
64 {
65  LogDebug("L1GTEvmDigiToRaw") << "\nMask for active boards (hex format): " << std::hex
66  << std::setw(sizeof(m_activeBoardsMaskGt) * 2) << std::setfill('0')
67  << m_activeBoardsMaskGt << std::dec << std::setfill(' ')
68  << "\nInput tag for EVM GT record: " << m_evmGtInputTag
69  << "\nFED Id for EVM GT record: " << m_evmGtFedId << " \n"
70  << std::endl;
71 
72  //
73  produces<FEDRawDataCollection>();
74 }
75 
76 // member functions
77 
78 // method called to produce the data
80  // define new FEDRawDataCollection
81  // it contains ALL FEDs in an event
82  std::unique_ptr<FEDRawDataCollection> allFedRawData(new FEDRawDataCollection);
83 
84  FEDRawData& gtRawData = allFedRawData->FEDData(m_evmGtFedId);
85 
86  // get records from EventSetup
87 
88  // board maps
90 
91  const std::vector<L1GtBoard> boardMaps = l1GtBM->gtBoardMaps();
92  int boardMapsSize = boardMaps.size();
93 
94  typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
95 
96  // create an ordered vector for the GT EVM record
97  // header (pos 0 in record) and trailer (last position in record)
98  // not included, as they are not in board list
99  std::vector<L1GtBoard> gtRecordMap;
100  gtRecordMap.reserve(boardMapsSize);
101 
102  for (int iPos = 0; iPos < boardMapsSize; ++iPos) {
103  for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
104  if (itBoard->gtPositionEvmRecord() == iPos) {
105  gtRecordMap.push_back(*itBoard);
106  break;
107  }
108  }
109  }
110 
111  // get L1GlobalTriggerEvmReadoutRecord
113  iEvent.getByToken(m_evmGtInputToken, gtReadoutRecord);
114 
115  if (!gtReadoutRecord.isValid()) {
116  edm::LogWarning("L1GTEvmDigiToRaw") << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag "
117  << m_evmGtInputTag
118  << "\nrequested in configuration, but not found in the event."
119  << "\nQuit packing this event" << std::endl;
120 
121  // put the raw data in the event
122  iEvent.put(std::move(allFedRawData));
123 
124  return;
125  }
126 
127  if (m_verbosity && m_isDebugEnabled) {
128  std::ostringstream myCoutStream;
129  gtReadoutRecord->print(myCoutStream);
130  LogTrace("L1GTEvmDigiToRaw") << "\n The following L1 GT EVM readout record will be packed.\n"
131  << " Some boards could be disabled before packing,"
132  << " see detailed board packing.\n"
133  << myCoutStream.str() << "\n"
134  << std::endl;
135  }
136 
137  // get GTFE block
138  L1GtfeExtWord gtfeBlock = gtReadoutRecord->gtfeWord();
139 
140  // get the number of Bx in the event for alternative 0 and alternative 1
141  cms_uint16_t recordLength0 = gtfeBlock.recordLength();
142  cms_uint16_t recordLength1 = gtfeBlock.recordLength1();
143 
144  // length of BST record (in bytes)
145  m_bstLengthBytes = static_cast<int>(gtfeBlock.bstLengthBytes());
146 
147  // get list of active blocks from the GTFE block
148  // and mask some blocks, if required
149  // blocks not active are not written to the record
150 
151  cms_uint16_t activeBoardsGtInitial = gtfeBlock.activeBoards();
152  cms_uint16_t altNrBxBoardInitial = gtfeBlock.altNrBxBoard();
153 
154  // mask some boards, if needed
155 
156  cms_uint16_t activeBoardsGt = activeBoardsGtInitial & m_activeBoardsMaskGt;
157 
158  if (m_verbosity && m_isDebugEnabled) {
159  LogDebug("L1GTEvmDigiToRaw") << "\nActive boards before masking(hex format): " << std::hex
160  << std::setw(sizeof(activeBoardsGtInitial) * 2) << std::setfill('0')
161  << activeBoardsGtInitial << std::dec << std::setfill(' ')
162  << "\nActive boards after masking(hex format): " << std::hex
163  << std::setw(sizeof(activeBoardsGt) * 2) << std::setfill('0') << activeBoardsGt
164  << std::dec << std::setfill(' ') << " \n"
165  << std::endl;
166  }
167 
168  // get the size of the record
169 
170  unsigned int gtDataSize = 0;
171 
172  unsigned int headerSize = 8;
173  gtDataSize += headerSize;
174 
175  for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
176  if (itBoard->gtBoardType() == GTFE) {
177  gtDataSize += gtfeBlock.getSize();
178  continue;
179  }
180 
181  int iActiveBit = itBoard->gtBitEvmActiveBoards();
182  bool activeBoardToPack = false;
183 
184  int altNrBxBoardVal = -1;
185 
186  if (iActiveBit >= 0) {
187  activeBoardToPack = activeBoardsGt & (1 << iActiveBit);
188 
189  altNrBxBoardVal = (altNrBxBoardInitial & (1 << iActiveBit)) >> iActiveBit;
190 
191  if (altNrBxBoardVal == 1) {
192  m_totalBxInEvent = recordLength1;
193  } else if (altNrBxBoardVal == 0) {
194  m_totalBxInEvent = recordLength0;
195  } else {
196  if (m_verbosity) {
197  edm::LogWarning("L1GTEvmDigiToRaw")
198  << "\n\nWARNING: Wrong value altNrBxBoardVal = " << altNrBxBoardVal << " for board " << std::hex
199  << (itBoard->gtBoardId()) << std::dec << "\n iActiveBit = " << iActiveBit
200  << "\n altNrBxBoardInitial = 0x" << std::hex << altNrBxBoardInitial << std::dec
201  << "\n activeBoardsGt = 0x" << std::hex << activeBoardsGt << std::dec
202  << "\n activeBoardToPack = " << activeBoardToPack << "\n Set altNrBxBoardVal tentatively to "
203  << recordLength0 << "\n Job may crash or produce wrong results!\n\n"
204  << std::endl;
205  }
206 
207  m_totalBxInEvent = recordLength0;
208  }
209  } else {
210  // board not in the ActiveBoards for the record
211  continue;
212  }
213 
214  if (activeBoardToPack) {
215  switch (itBoard->gtBoardType()) {
216  case GTFE: {
217  // size already added;
218  }
219 
220  break;
221  case FDL: {
222  L1GtFdlWord fdlBlock;
223  gtDataSize += m_totalBxInEvent * fdlBlock.getSize();
224  }
225 
226  break;
227  case TCS: {
228  L1TcsWord tcsBlock;
229  gtDataSize += tcsBlock.getSize();
230  }
231 
232  break;
233  case TIM: {
234  // not considered
235  }
236 
237  break;
238  default: {
239  // do nothing, all blocks are given in GtBoardType enum
240  }
241 
242  break;
243  }
244  }
245  }
246 
247  unsigned int trailerSize = 8;
248  gtDataSize += trailerSize;
249 
250  // resize, GT raw data record has variable length,
251  // depending on active boards (read in GTFE)
252  gtRawData.resize(gtDataSize);
253 
254  // ptrGt: pointer to the beginning of GT record in the raw data
255 
256  unsigned char* ptrGt = gtRawData.data();
257  unsigned char* ptrGtBegin = gtRawData.data();
258 
259  if (m_verbosity && m_isDebugEnabled) {
260  LogDebug("L1GTEvmDigiToRaw") << "\n Size of raw data: " << gtRawData.size() << "\n" << std::endl;
261  }
262 
263  // ------- pack boards -------
264 
265  // pack header
266  packHeader(ptrGt, iEvent);
267  ptrGt += headerSize; // advance with header size
268 
269  // loop over other blocks in the raw record, if they are active
270 
271  for (CItBoardMaps itBoard = gtRecordMap.begin(); itBoard != gtRecordMap.end(); ++itBoard) {
272  if (itBoard->gtBoardType() == GTFE) {
273  packGTFE(evSetup, ptrGt, gtfeBlock, activeBoardsGt);
274 
275  if (m_verbosity && m_isDebugEnabled) {
276  std::ostringstream myCoutStream;
277  gtfeBlock.print(myCoutStream);
278  LogTrace("L1GTEvmDigiToRaw") << myCoutStream.str() << "\n" << std::endl;
279  }
280 
281  ptrGt += gtfeBlock.getSize(); // advance with GTFE block size
282 
283  continue;
284  }
285 
286  // pack modules other than GTFE if they are active
287 
288  int iActiveBit = itBoard->gtBitEvmActiveBoards();
289  bool activeBoardToPack = false;
290 
291  int altNrBxBoardVal = -1;
292 
293  if (iActiveBit >= 0) {
294  activeBoardToPack = activeBoardsGt & (1 << iActiveBit);
295 
296  altNrBxBoardVal = (altNrBxBoardInitial & (1 << iActiveBit)) >> iActiveBit;
297 
298  if (altNrBxBoardVal == 1) {
299  m_totalBxInEvent = recordLength1;
300  } else if (altNrBxBoardVal == 0) {
301  m_totalBxInEvent = recordLength0;
302  } else {
303  if (m_verbosity) {
304  edm::LogWarning("L1GTEvmDigiToRaw")
305  << "\n\nWARNING: Wrong value altNrBxBoardVal = " << altNrBxBoardVal << " for board " << std::hex
306  << (itBoard->gtBoardId()) << std::dec << "\n iActiveBit = " << iActiveBit
307  << "\n altNrBxBoardInitial = 0x" << std::hex << altNrBxBoardInitial << std::dec
308  << "\n activeBoardsGt = 0x" << std::hex << activeBoardsGt << std::dec
309  << "\n activeBoardToPack = " << activeBoardToPack << "\n Set altNrBxBoardVal tentatively to "
310  << recordLength0 << "\n Job may crash or produce wrong results!\n\n"
311  << std::endl;
312  }
313 
314  m_totalBxInEvent = recordLength0;
315  }
316 
318  m_maxBxInEvent = (m_totalBxInEvent + 1) / 2 - 1;
319 
320  } else {
321  // board not in the ActiveBoards for the record
322  continue;
323  }
324 
325  if (activeBoardToPack) {
326  if (m_verbosity && m_isDebugEnabled) {
327  LogDebug("L1GTEvmDigiToRaw") << "\nBoard " << std::hex << "0x" << (itBoard->gtBoardId()) << std::dec
328  << "\n Number of bunch crosses in the record: " << m_totalBxInEvent << " = "
329  << "[" << m_minBxInEvent << ", " << m_maxBxInEvent << "] BX\n"
330  << std::endl;
331  }
332 
333  // active board, pack it
334  switch (itBoard->gtBoardType()) {
335  case TCS: {
336  L1TcsWord tcsBlock = gtReadoutRecord->tcsWord();
337  packTCS(evSetup, ptrGt, tcsBlock);
338 
339  if (m_verbosity && m_isDebugEnabled) {
340  std::ostringstream myCoutStream;
341  tcsBlock.print(myCoutStream);
342  LogTrace("L1GTEvmDigiToRaw") << myCoutStream.str() << "\n" << std::endl;
343  }
344 
345  ptrGt += tcsBlock.getSize(); // advance with TCS block size
346 
347  } break;
348  case FDL: {
349  for (int iBxInEvent = m_minBxInEvent; iBxInEvent <= m_maxBxInEvent; ++iBxInEvent) {
350  L1GtFdlWord fdlBlock = gtReadoutRecord->gtFdlWord(iBxInEvent);
351  packFDL(evSetup, ptrGt, fdlBlock);
352 
353  if (m_verbosity && m_isDebugEnabled) {
354  std::ostringstream myCoutStream;
355  fdlBlock.print(myCoutStream);
356  LogTrace("L1GTEvmDigiToRaw") << myCoutStream.str() << "\n" << std::endl;
357  }
358 
359  ptrGt += fdlBlock.getSize(); // advance with FDL block size
360  }
361 
362  } break;
363  default: {
364  // do nothing, all blocks are given in GtBoardType enum
365  break;
366  }
367  }
368  }
369  }
370 
371  // pack trailer
372  packTrailer(ptrGt, ptrGtBegin, gtDataSize);
373 
374  // put the raw data in the event
375 
376  iEvent.put(std::move(allFedRawData));
377 }
378 
379 // pack header
380 void L1GTEvmDigiToRaw::packHeader(unsigned char* ptrGt, edm::Event& iEvent) {
381  // TODO FIXME where from to get all numbers?
382 
383  // Event Trigger type identifier
384  int triggerTypeVal = 0;
385 
386  // Level-1 event number generated by the TTC system
387  int lvl1IdVal = iEvent.id().event();
388 
389  // The bunch crossing number
390  int bxCross = iEvent.bunchCrossing();
391  cms_uint16_t bxCrossHw = 0;
392  if ((bxCross & 0xFFF) == bxCross) {
393  bxCrossHw = static_cast<cms_uint16_t>(bxCross);
394  } else {
395  bxCrossHw = 0; // Bx number too large, set to 0!
396  if (m_verbosity && m_isDebugEnabled) {
397  LogDebug("L1GTEvmDigiToRaw") << "\nBunch cross number [hex] = " << std::hex << bxCross
398  << "\n larger than 12 bits. Set to 0! \n"
399  << std::dec << std::endl;
400  }
401  }
402  int bxIdVal = bxCrossHw;
403 
404  // Identifier of the FED
405  int sourceIdVal = m_evmGtFedId;
406 
407  // Version identifier of the FED data format
408  int versionVal = 0;
409 
410  // 0 -> the current header word is the last one.
411  // 1-> other header words can follow
412  // (always 1 for ECAL)
413  bool moreHeadersVal = false;
414 
415  FEDHeader gtFEDHeader(ptrGt);
416 
417  gtFEDHeader.set(ptrGt, triggerTypeVal, lvl1IdVal, bxIdVal, sourceIdVal, versionVal, moreHeadersVal);
418 }
419 
420 // pack the GTFE block
422  unsigned char* ptrGt,
423  L1GtfeExtWord& gtfeBlock,
424  cms_uint16_t activeBoardsGtValue) {
425  if (m_verbosity && m_isDebugEnabled) {
426  LogDebug("L1GTEvmDigiToRaw") << "\nPacking GTFE \n" << std::endl;
427  }
428 
430 
431  // initialize the required number of word64
432  int nrWord64 = gtfeBlock.getSize() / uLength;
433  std::vector<cms_uint64_t> tmpWord64;
434  tmpWord64.resize(nrWord64);
435 
436  for (int iWord = 0; iWord < nrWord64; ++iWord) {
437  tmpWord64[iWord] = 0x0000000000000000ULL;
438  }
439 
440  // fill the values in the words
441  for (int iWord = 0; iWord < nrWord64; ++iWord) {
442  gtfeBlock.setBoardIdWord64(tmpWord64[iWord], iWord);
443  gtfeBlock.setRecordLength1Word64(tmpWord64[iWord], iWord);
444  gtfeBlock.setRecordLengthWord64(tmpWord64[iWord], iWord);
445  gtfeBlock.setBxNrWord64(tmpWord64[iWord], iWord);
446  gtfeBlock.setSetupVersionWord64(tmpWord64[iWord], iWord);
447  gtfeBlock.setActiveBoardsWord64(tmpWord64[iWord], iWord, activeBoardsGtValue);
448  gtfeBlock.setAltNrBxBoardWord64(tmpWord64[iWord], iWord);
449  gtfeBlock.setTotalTriggerNrWord64(tmpWord64[iWord], iWord);
450 
451  for (int iBst = 0; iBst < m_bstLengthBytes; ++iBst) {
452  gtfeBlock.setBstWord64(tmpWord64[iWord], iBst, iWord);
453  }
454  }
455 
456  // put the words in the FED record
457 
458  cms_uint64_t* pw = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(ptrGt));
459 
460  for (int iWord = 0; iWord < nrWord64; ++iWord) {
461  *pw++ = tmpWord64[iWord];
462 
463  if (m_verbosity && m_isDebugEnabled) {
464  LogTrace("L1GTEvmDigiToRaw") << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16)
465  << tmpWord64[iWord] << std::dec << std::setfill(' ') << std::endl;
466  }
467  }
468 }
469 
470 // pack the TCS block
471 void L1GTEvmDigiToRaw::packTCS(const edm::EventSetup& evSetup, unsigned char* ptrGt, L1TcsWord& tcsBlock) {
472  if (m_verbosity && m_isDebugEnabled) {
473  LogDebug("L1GTEvmDigiToRaw") << "\nPacking TCS \n" << std::endl;
474  }
475 
477 
478  // initialize the required number of word64
479  int nrWord64 = tcsBlock.getSize() / uLength;
480  std::vector<cms_uint64_t> tmpWord64;
481  tmpWord64.resize(nrWord64);
482 
483  for (int iWord = 0; iWord < nrWord64; ++iWord) {
484  tmpWord64[iWord] = 0x0000000000000000ULL;
485  }
486 
487  // fill the values in the words
488  for (int iWord = 0; iWord < nrWord64; ++iWord) {
489  tcsBlock.setBoardIdWord64(tmpWord64[iWord], iWord);
490  tcsBlock.setBxNrWord64(tmpWord64[iWord], iWord);
491  tcsBlock.setDaqNrWord64(tmpWord64[iWord], iWord);
492  tcsBlock.setTriggerTypeWord64(tmpWord64[iWord], iWord);
493  tcsBlock.setStatusWord64(tmpWord64[iWord], iWord);
494  tcsBlock.setLuminositySegmentNrWord64(tmpWord64[iWord], iWord);
495 
496  tcsBlock.setPartRunNrWord64(tmpWord64[iWord], iWord);
497  tcsBlock.setAssignedPartitionsWord64(tmpWord64[iWord], iWord);
498 
499  tcsBlock.setPartTrigNrWord64(tmpWord64[iWord], iWord);
500  tcsBlock.setEventNrWord64(tmpWord64[iWord], iWord);
501 
502  tcsBlock.setOrbitNrWord64(tmpWord64[iWord], iWord);
503  }
504 
505  // put the words in the FED record
506 
507  cms_uint64_t* pw = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(ptrGt));
508 
509  for (int iWord = 0; iWord < nrWord64; ++iWord) {
510  *pw++ = tmpWord64[iWord];
511 
512  if (m_verbosity && m_isDebugEnabled) {
513  LogTrace("L1GTEvmDigiToRaw") << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16)
514  << tmpWord64[iWord] << std::dec << std::setfill(' ') << std::endl;
515  }
516  }
517 }
518 
519 // pack the FDL block
520 void L1GTEvmDigiToRaw::packFDL(const edm::EventSetup& evSetup, unsigned char* ptrGt, L1GtFdlWord& fdlBlock) {
521  if (m_verbosity && m_isDebugEnabled) {
522  LogDebug("L1GTEvmDigiToRaw") << "\nPacking FDL \n" << std::endl;
523  }
524 
526 
527  // initialize the required number of word64
528  int nrWord64 = fdlBlock.getSize() / uLength;
529  std::vector<cms_uint64_t> tmpWord64;
530  tmpWord64.resize(nrWord64);
531 
532  for (int iWord = 0; iWord < nrWord64; ++iWord) {
533  tmpWord64[iWord] = 0x0000000000000000ULL;
534  }
535 
536  // fill the values in the words
537  for (int iWord = 0; iWord < nrWord64; ++iWord) {
538  fdlBlock.setBoardIdWord64(tmpWord64[iWord], iWord);
539  fdlBlock.setBxInEventWord64(tmpWord64[iWord], iWord);
540  fdlBlock.setBxNrWord64(tmpWord64[iWord], iWord);
541  fdlBlock.setEventNrWord64(tmpWord64[iWord], iWord);
542 
543  fdlBlock.setGtTechnicalTriggerWordWord64(tmpWord64[iWord], iWord);
544 
545  fdlBlock.setGtDecisionWordAWord64(tmpWord64[iWord], iWord);
546  fdlBlock.setGtDecisionWordBWord64(tmpWord64[iWord], iWord);
547 
548  fdlBlock.setGtDecisionWordExtendedWord64(tmpWord64[iWord], iWord);
549 
550  fdlBlock.setPhysicsDeclaredWord64(tmpWord64[iWord], iWord);
551  fdlBlock.setGtPrescaleFactorIndexTechWord64(tmpWord64[iWord], iWord);
552  fdlBlock.setGtPrescaleFactorIndexAlgoWord64(tmpWord64[iWord], iWord);
553  fdlBlock.setNoAlgoWord64(tmpWord64[iWord], iWord);
554  fdlBlock.setFinalORWord64(tmpWord64[iWord], iWord);
555 
556  fdlBlock.setOrbitNrWord64(tmpWord64[iWord], iWord);
557  fdlBlock.setLumiSegmentNrWord64(tmpWord64[iWord], iWord);
558  fdlBlock.setLocalBxNrWord64(tmpWord64[iWord], iWord);
559  }
560 
561  // put the words in the FED record
562 
563  cms_uint64_t* pw = reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(ptrGt));
564 
565  for (int iWord = 0; iWord < nrWord64; ++iWord) {
566  *pw++ = tmpWord64[iWord];
567 
568  if (m_verbosity && m_isDebugEnabled) {
569  LogTrace("L1GTEvmDigiToRaw") << std::setw(4) << iWord << " " << std::hex << std::setfill('0') << std::setw(16)
570  << tmpWord64[iWord] << std::dec << std::setfill(' ') << std::endl;
571  }
572  }
573 }
574 
575 // pack trailer
576 void L1GTEvmDigiToRaw::packTrailer(unsigned char* ptrGt, unsigned char* ptrGtBegin, int dataSize) {
577  // TODO FIXME where from to get all numbers?
578 
579  // The length of the event fragment counted in 64-bit words including header and trailer
580  int lengthVal = dataSize / 8;
581 
582  // Cyclic Redundancy Code of the event fragment including header and trailer
583  int crcVal = evf::compute_crc(ptrGtBegin, dataSize);
584 
585  // Event fragment status information
586  int evtStatusVal = 0;
587 
588  // Current value of the Trigger Throttling System bits.
589  int ttsBitsVal = 0;
590 
591  // 0 -> the current trailer word is the last one.
592  // 1-> other trailer words can follow
593  // (always 0 for ECAL)
594  bool moreTrailersVal = false;
595 
596  FEDTrailer gtFEDTrailer(ptrGt);
597  gtFEDTrailer.set(ptrGt, lengthVal, crcVal, evtStatusVal, ttsBitsVal, moreTrailersVal);
598 }
599 
600 // static class members
L1GTEvmDigiToRaw::L1GTEvmDigiToRaw
L1GTEvmDigiToRaw(const edm::ParameterSet &)
constructor(s)
Definition: L1GTEvmDigiToRaw.cc:52
FEDNumbering.h
GTFE
Definition: L1GtDefinitions.h:28
L1GtfeWord::activeBoards
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
Definition: L1GtfeWord.h:119
L1GtFdlWord::setNoAlgoWord64
void setNoAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:514
L1GlobalTriggerReadoutSetup::UnitLength
static const int UnitLength
one unit in the word is UnitLength bits
Definition: L1GlobalTriggerReadoutSetup.h:56
L1TcsWord::setStatusWord64
void setStatusWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:180
MessageLogger.h
L1TcsWord::setLuminositySegmentNrWord64
void setLuminositySegmentNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:193
ESHandle.h
L1GTEvmDigiToRaw::m_isDebugEnabled
const bool m_isDebugEnabled
Definition: L1GTEvmDigiToRaw.h:105
TCS
Definition: L1GtDefinitions.h:28
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
edm
HLT enums.
Definition: AlignableModifier.h:19
L1TcsWord::setEventNrWord64
void setEventNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:241
L1GtfeExtWord.h
L1TcsWord
Definition: L1TcsWord.h:29
L1TcsWord::print
void print(std::ostream &myCout) const
pretty print the content of a L1TcsWord
Definition: L1TcsWord.cc:274
L1GtBoardMaps
Definition: L1GtBoardMaps.h:33
L1GlobalTriggerEvmReadoutRecord::gtfeWord
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
Definition: L1GlobalTriggerEvmReadoutRecord.cc:249
L1GtFdlWord::setGtDecisionWordBWord64
void setGtDecisionWordBWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:388
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
L1GTEvmDigiToRaw::m_verbosity
const int m_verbosity
verbosity level
Definition: L1GTEvmDigiToRaw.h:104
FDL
Definition: L1GtDefinitions.h:28
L1GtfeExtWord::setBstWord64
void setBstWord64(cms_uint64_t &word64, int iB, const int iWord)
Definition: L1GtfeExtWord.cc:372
L1GTEvmDigiToRaw::m_totalBxInEvent
int m_totalBxInEvent
total Bx's in the event, obtained from GTFE block
Definition: L1GTEvmDigiToRaw.h:89
L1TcsWord::setOrbitNrWord64
void setOrbitNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:252
L1GTEvmDigiToRaw.h
L1GtFdlWord::setOrbitNrWord64
void setOrbitNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:536
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
L1GtFdlWord::setBoardIdWord64
void setBoardIdWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:179
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
L1GtFdlWord::setLumiSegmentNrWord64
void setLumiSegmentNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:549
L1TcsWord::setTriggerTypeWord64
void setTriggerTypeWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:169
FEDNumbering
Definition: FEDNumbering.h:17
L1GtfeWord::setRecordLengthWord64
void setRecordLengthWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:142
L1GtfeWord::setAltNrBxBoardWord64
void setAltNrBxBoardWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:212
L1TcsWord.h
L1GtfeWord::recordLength
const cms_uint16_t recordLength() const
get/set record length for alternative 0
Definition: L1GtfeWord.h:82
L1TcsWord::setPartTrigNrWord64
void setPartTrigNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:230
L1GtfeWord::setRecordLength1Word64
void setRecordLength1Word64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:129
L1GlobalTriggerEvmReadoutRecord.h
L1GTEvmDigiToRaw::m_maxBxInEvent
int m_maxBxInEvent
Definition: L1GTEvmDigiToRaw.h:97
L1GtFdlWord::setGtPrescaleFactorIndexTechWord64
void setGtPrescaleFactorIndexTechWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:490
L1GtFdlWord::setGtTechnicalTriggerWordWord64
void setGtTechnicalTriggerWordWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:259
L1GlobalTriggerEvmReadoutRecord
Definition: L1GlobalTriggerEvmReadoutRecord.h:36
L1GTEvmDigiToRaw::packTrailer
void packTrailer(unsigned char *, unsigned char *, int)
pack trailer word
Definition: L1GTEvmDigiToRaw.cc:576
L1GtfeWord::setSetupVersionWord64
void setSetupVersionWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:166
edm::ESHandle
Definition: DTSurvey.h:22
L1GtfeWord::setBoardIdWord64
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:116
L1GtFdlWord::setPhysicsDeclaredWord64
void setPhysicsDeclaredWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:477
L1GlobalTriggerEvmReadoutRecord::gtFdlWord
const L1GtFdlWord gtFdlWord(int bxInEvent) const
get / set FDL word (record) in the GT readout record
Definition: L1GlobalTriggerEvmReadoutRecord.cc:259
L1GtFdlWord.h
TIM
Definition: L1GtDefinitions.h:28
L1TcsWord::getSize
const unsigned int getSize() const
get the size of the TCS block in GT EVM record (in multiple of 8 bits)
Definition: L1TcsWord.h:197
L1TcsWord::setAssignedPartitionsWord64
void setAssignedPartitionsWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:217
evf::compute_crc
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:46
L1GtFdlWord::setBxInEventWord64
void setBxInEventWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:194
L1GtfeWord::setTotalTriggerNrWord64
void setTotalTriggerNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:233
L1GtBoard.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:47
FEDTrailer
Definition: FEDTrailer.h:14
L1GlobalTriggerReadoutSetup.h
L1GtFdlWord::setEventNrWord64
void setEventNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:218
L1GTEvmDigiToRaw::packHeader
void packHeader(unsigned char *, edm::Event &)
block packers ----------—
Definition: L1GTEvmDigiToRaw.cc:380
L1TcsWord::setDaqNrWord64
void setDaqNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:156
L1GtFdlWord
Definition: L1GtFdlWord.h:29
L1GtFdlWord::setBxNrWord64
void setBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:207
createfilelist.int
int
Definition: createfilelist.py:10
L1GTEvmDigiToRaw::produce
void produce(edm::Event &, const edm::EventSetup &) override
loop over events
Definition: L1GTEvmDigiToRaw.cc:79
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GtfeExtWord::print
void print(std::ostream &myCout) const override
pretty print the content of a L1GtfeExtWord
Definition: L1GtfeExtWord.cc:434
L1GTEvmDigiToRaw::m_evmGtInputToken
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_evmGtInputToken
input tag for GT EVM record
Definition: L1GTEvmDigiToRaw.h:79
L1GtfeWord::setActiveBoardsWord64
void setActiveBoardsWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:191
L1GtFwd.h
FEDRawDataCollection.h
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
L1GTEvmDigiToRaw::m_evmGtInputTag
const edm::InputTag m_evmGtInputTag
Definition: L1GTEvmDigiToRaw.h:80
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
cms_uint16_t
unsigned short cms_uint16_t
Definition: typedefs.h:13
edm::EventSetup
Definition: EventSetup.h:58
L1GTEvmDigiToRaw::m_l1GtBMToken
const edm::ESGetToken< L1GtBoardMaps, L1GtBoardMapsRcd > m_l1GtBMToken
EventSetup Token for L1GtBoardMaps.
Definition: L1GTEvmDigiToRaw.h:83
L1GTEvmDigiToRaw::m_bstLengthBytes
int m_bstLengthBytes
length of BST record (in bytes)
Definition: L1GTEvmDigiToRaw.h:100
FEDTrailer::set
static void set(unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
Set all fields in the trailer.
Definition: FEDTrailer.cc:31
L1GtBoardMaps.h
L1GtfeWord.h
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
L1GtfeExtWord
Definition: L1GtfeExtWord.h:31
L1GtFdlWord::setGtDecisionWordExtendedWord64
void setGtDecisionWordExtendedWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:446
L1GTEvmDigiToRaw::packGTFE
void packGTFE(const edm::EventSetup &, unsigned char *, L1GtfeExtWord &, cms_uint16_t activeBoardsGtValue)
Definition: L1GTEvmDigiToRaw.cc:421
L1GtFdlWord::setLocalBxNrWord64
void setLocalBxNrWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:560
L1GtFdlWord::setGtDecisionWordAWord64
void setGtDecisionWordAWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:361
L1GtfeExtWord::bstLengthBytes
const unsigned int bstLengthBytes() const
get the size of the BST block
Definition: L1GtfeExtWord.h:65
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1GtfeWord::recordLength1
const cms_uint16_t recordLength1() const
get/set record length for alternative 1
Definition: L1GtfeWord.h:71
L1GlobalTriggerEvmReadoutRecord::tcsWord
const L1TcsWord tcsWord() const
get / set TCS word (record) in the GT readout record
Definition: L1GlobalTriggerEvmReadoutRecord.cc:254
L1GtfeExtWord::getSize
const unsigned int getSize() const
get the size of the GTFE block in GT EVM record (in multiple of 8 bits)
Definition: L1GtfeExtWord.cc:402
L1TcsWord::setBxNrWord64
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:145
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
FEDHeader::set
static void set(unsigned char *header, uint8_t triggerType, uint32_t lvl1ID, uint16_t bxID, uint16_t sourceID, uint8_t version=0, bool moreHeaders=false)
Set all fields in the header.
Definition: FEDHeader.cc:25
FEDRawData::resize
void resize(size_t newsize)
Definition: FEDRawData.cc:28
L1GtFdlWord::print
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
Definition: L1GtFdlWord.cc:595
L1TcsWord::setBoardIdWord64
void setBoardIdWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:134
L1GTEvmDigiToRaw::m_evmGtFedId
int m_evmGtFedId
Definition: L1GTEvmDigiToRaw.h:76
EventSetup.h
L1GtfeWord::setBxNrWord64
void setBxNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1GtfeWord.cc:153
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:12
L1TcsWord::setPartRunNrWord64
void setPartRunNrWord64(cms_uint64_t &word64, int iWord)
Definition: L1TcsWord.cc:204
L1GTEvmDigiToRaw::packFDL
void packFDL(const edm::EventSetup &, unsigned char *, L1GtFdlWord &)
pack FDL blocks for various bunch crosses
Definition: L1GTEvmDigiToRaw.cc:520
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
L1GTEvmDigiToRaw::m_minBxInEvent
int m_minBxInEvent
Definition: L1GTEvmDigiToRaw.h:93
L1GtBoardMapsRcd
Definition: L1GtBoardMapsRcd.h:39
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
FEDHeader
Definition: FEDHeader.h:14
edm::Event
Definition: Event.h:73
FEDHeader.h
L1GtfeWord::altNrBxBoard
const cms_uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
Definition: L1GtfeWord.h:134
L1GtFdlWord::setFinalORWord64
void setFinalORWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:525
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
L1GtFdlWord::setGtPrescaleFactorIndexAlgoWord64
void setGtPrescaleFactorIndexAlgoWord64(cms_uint64_t &word64, const int iWord)
Definition: L1GtFdlWord.cc:503
L1GTEvmDigiToRaw::m_activeBoardsMaskGt
cms_uint16_t m_activeBoardsMaskGt
mask for active boards
Definition: L1GTEvmDigiToRaw.h:86
L1GtBoardMapsRcd.h
L1GTEvmDigiToRaw::packTCS
void packTCS(const edm::EventSetup &evSetup, unsigned char *ptrGt, L1TcsWord &tcsBlock)
pack the TCS block
Definition: L1GTEvmDigiToRaw.cc:471
CRC16.h
L1GlobalTriggerEvmReadoutRecord::print
void print(std::ostream &myCout) const
pretty print the content of a L1GlobalTriggerEvmReadoutRecord
Definition: L1GlobalTriggerEvmReadoutRecord.cc:311
FEDTrailer.h