ATLAS Offline Software
PpmByteStreamReadV1V2Tool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ===========================================================================
6 // Includes
7 // ===========================================================================
8 // STD:
9 // ===========================================================================
10 #include <stdexcept>
11 #include <bitset>
12 // ===========================================================================
13 #include "eformat/SourceIdentifier.h"
17 
18 #include "CaloUserHeader.h"
19 #include "SubBlockHeader.h"
20 #include "SubBlockStatus.h"
21 #include "WordDecoder.h"
22 
23 #include "../L1CaloSubBlock.h" // Only for error codes
24 #include "../L1CaloSrcIdMap.h"
25 
27 
29 // ===========================================================================
30 
31 namespace {
32 uint32_t bitFieldSize(uint32_t word, uint8_t offset, uint8_t size) {
33  return (word >> offset) & ((1U << size) - 1);
34 }
35 
36 uint32_t crateModuleMask(uint8_t crate, uint8_t module) {
37  return (crate << 8) | (1 << 4) | module;
38 }
39 
40 uint32_t coolId(uint8_t crate, uint8_t module, uint8_t channel) {
41  const uint8_t pin = channel % 16;
42  const uint8_t asic = channel / 16;
43  return (crateModuleMask(crate, module) << 16) | (pin << 8) | asic;
44 }
45 
46 int16_t pedCorrection(uint16_t twoBytePedCor) {
47  return twoBytePedCor > 511? (twoBytePedCor - 1024): twoBytePedCor;
48 }
49 
50 #if 0
51 std::string noAuxSuffix(const std::string& name) {
52  if ((name.size() > 4) && (name.substr(name.size()-4, 4) == "Aux.")) {
53  return name.substr(0, name.size() - 4);
54  }
55  return name;
56 }
57 #endif
58 }
59 // ===========================================================================
60 namespace LVL1BS {
61 // ===========================================================================
62 // Constructor
64  "PpmByteStreamxAODReadTool"*/) :
65  AsgTool(name),
66  m_errorTool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
67  m_ppmMaps("LVL1::PpmMappingTool/PpmMappingTool"),
68  m_robDataProvider("ROBDataProviderSvc", name),
69  m_srcIdMap(nullptr),
70  m_maxSizeSeen(0)
71 {
72  declareInterface<PpmByteStreamReadV1V2Tool>(this);
73  declareProperty("UseSWROD",m_useSWROD = false, "Use SWROD readout instead of legacy (which was removed in 2024)");
74  declareProperty("PpmMappingTool", m_ppmMaps,
75  "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
76  declareProperty("ROBDataProviderSvc", m_robDataProvider,
77  "Get ROB source IDs service");
78 }
79 
80 // ===========================================================================
81 // Initialize
82 
83 
85  ATH_MSG_DEBUG("Initializing " << name());
86 
87  m_srcIdMap = new L1CaloSrcIdMap();
89  CHECK(m_errorTool.retrieve());
90  CHECK(m_ppmMaps.retrieve());
91  CHECK(m_robDataProvider.retrieve());
92 
93  initSourceIDs();
94 
95  return StatusCode::SUCCESS;
96 }
97 // ===========================================================================
98 // Finalize
99 
101  delete m_srcIdMap;
102 
103  return StatusCode::SUCCESS;
104 }
105 
106 // Conversion bytestream to trigger towers
108  State& state,
109  const IROBDataProviderSvc::VROBFRAG& robFrags) const
110 {
111  if (m_maxSizeSeen > state.m_triggerTowers->capacity()){
113  }
114 
115  state.m_subDetectorID = eformat::TDAQ_CALO_PREPROC;
116 
117  ROBIterator rob = robFrags.begin();
118  ROBIterator robEnd = robFrags.end();
119 
120  int robCounter = 1;
121  for (; rob != robEnd; ++rob, ++robCounter) {
122 
124  if (!sc.isSuccess()) {
125 
126  }
127  }
128 
130  return StatusCode::SUCCESS;
131 }
132 
133 
135  xAOD::TriggerTowerContainer* const ttCollection) const
136 {
138 }
139 
141  xAOD::TriggerTowerContainer* const ttCollection) const
142 {
143  State state;
144  state.m_triggerTowers = ttCollection;
145  const std::vector<uint32_t>& vID(ppmSourceIDs(state, sgKey));
146  // // get ROB fragments
148  m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags, "PpmByteStreamxAODReadTool");
149  ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size());
150 
151  CHECK(convert(state, robFrags));
152  return StatusCode::SUCCESS;
153 }
154 
155 // ===========================================================================
157  State& state,
158  const ROBIterator& robIter, const RequestType& /*requestedType*/) const
159 {
160  auto rob = **robIter;
161 
163  "Treating ROB fragment source id #" << MSG::hex << rob.rob_source_id());
164 
165 
166  state.m_rodSourceId = rob.rod_source_id();
167  state.m_robSourceId = rob.source_id();
168  const auto sourceID = (state.m_rodSourceId >> 16) & 0xff;
169  const auto rodCrate = m_srcIdMap->crate(state.m_rodSourceId);
170  const auto rodSlink = m_srcIdMap->slink(state.m_rodSourceId);
171  // -------------------------------------------------------------------------
172  // Check Rob status
173  if (rob.nstatus() > 0) {
174  ROBPointer robData;
175  rob.status(robData);
176  if (*robData != 0) {
177  ATH_MSG_WARNING("ROB status error - skipping fragment");
178  m_errorTool->robError(state.m_rodSourceId, *robData);
179  return StatusCode::FAILURE;
180  }
181  }
182  // -------------------------------------------------------------------------
183  RODPointer payloadBeg;
184  RODPointer payloadEnd;
186 
187  rob.rod_data(payloadBeg);
188  payloadEnd = payloadBeg + rob.rod_ndata();
189  payload = payloadBeg;
190  // -------------------------------------------------------------------------
191  if (payload == payloadEnd) {
192  ATH_MSG_DEBUG("ROB fragment empty");
193  return StatusCode::FAILURE;
194  }
195  // -------------------------------------------------------------------------
196 
197 
198  uint16_t rodVer = rob.rod_version() & 0xffff;
199  uint32_t rodRunNumber = rob.rod_run_no() & 0xffffff;
200  state.m_verCode = ((rodVer & 0xfff) << 4) | 1;
201 
202 
203  if (sourceID != state.m_subDetectorID) {
204  ATH_MSG_ERROR("Wrong subdetector source id for requested objects: " << state.m_rodSourceId);
205  return StatusCode::FAILURE;
206  }
207 
208  ATH_MSG_DEBUG("Treating crate " << rodCrate << " slink " << rodSlink);
210  if (!state.m_caloUserHeader.isValid()) {
211  ATH_MSG_ERROR("Invalid or missing user header");
212  return StatusCode::FAILURE;
213  }
214 
216  "Run number: " << MSG::dec << rodRunNumber << endmsg
217  << "Version code: 0x" << MSG::hex << int(state.m_verCode) << MSG::dec
218  << endmsg << "LUT triggered slice offset: "
219  << int(state.m_caloUserHeader.lut()) << endmsg
220  << "FADC triggered slice offset: " << int(state.m_caloUserHeader.ppFadc())
221  << endmsg << "FADC baseline lower bound: "
222  << int(state.m_caloUserHeader.ppLowerBound()));
223 
224  int indata = 0;
225  uint8_t blockType = 0;
226  int subBlock = 0;
227 
228  for (; payload != payloadEnd; ++payload) {
229  if (CaloUserHeader::isValid(*payload) && (subBlock == 0)) {
230 
232  indata = 0;
233  CHECK(processPpmBlock_(state));
234 
235  state.m_ppLuts.clear();
236  state.m_ppFadcs.clear();
237  state.m_ppBlock.clear();
238 
239  blockType = (*payload >> 28) & 0xf;
240 
241  if ((blockType & 0xd) == 0xc) {
244  "SubBlock version #" << int(state.m_subBlockHeader.version())
245  << " format #" << int(state.m_subBlockHeader.format())
246  << " seqNum (compVer) #" << int(state.m_subBlockHeader.seqNum())
247  << " nslice1 #" << int(state.m_subBlockHeader.nSlice1())
248  << " nslice2 #" << int(state.m_subBlockHeader.nSlice2())
249  );
250  subBlock = blockType & 0xe;
251  } else if (blockType == (subBlock | 1)) {
253  subBlock = 0;
254  }
255  } else {
256  switch(state.m_subDetectorID){
257  case eformat::TDAQ_CALO_PREPROC:
258  CHECK(processPpmWord_(state, *payload, indata));
259  break;
260  default:
261  break;
262  }
263  indata++;
264  }
265  }
266  CHECK(processPpmBlock_(state));
267  state.m_ppLuts.clear();
268  state.m_ppFadcs.clear();
269  state.m_ppBlock.clear();
270  return StatusCode::SUCCESS;
271 }
272 
274  uint32_t word,
275  int indata) const
276 {
277  if ( (state.m_subBlockHeader.format() == 0)
278  || (state.m_subBlockHeader.format() >= 2)
279  || (state.m_verCode >= 0x41)) {
280  state.m_ppBlock.push_back(word);
281  } else if ((state.m_verCode == 0x21) || (state.m_verCode == 0x31)) {
282  return processPpmStandardR3V1_(state, word, indata);
283  } else {
284  ATH_MSG_ERROR("Unsupported PPM version:format ("
285  << state.m_verCode << ":" << state.m_subBlockHeader.format()
286  <<") combination");
287  return StatusCode::FAILURE;
288  }
289  return StatusCode::SUCCESS;
290 }
291 
292 
294 {
295  if (state.m_ppBlock.size() > 0) {
296  if (state.m_subBlockHeader.format() == 0) {
298  CHECK(sc);
299  return sc;
300  }
301 
302  if (state.m_verCode == 0x31) {
304  CHECK(sc);
305  return sc;
306  }
307 
308  if (state.m_verCode == 0x41 || state.m_verCode == 0x42) {
310  CHECK(sc);
311  return sc;
312  }
313  }
314 
315  if (state.m_ppLuts.size() > 0) {
316  if (state.m_verCode == 0x21 || state.m_verCode == 0x31) {
318  CHECK(sc);
319  return sc;
320  }
321  ATH_MSG_ERROR("Unknown PPM subheader format '"
322  << int(state.m_subBlockHeader.format())
323  << "' for rob version '"
324  << MSG::hex << int(state.m_verCode)
325  << MSG::dec << "'" );
326  return StatusCode::FAILURE;
327  }
328  return StatusCode::SUCCESS;
329 }
330 
332 {
333  uint8_t numLut = state.m_subBlockHeader.nSlice1();
334  uint8_t numFadc = state.m_subBlockHeader.nSlice2();
335  uint8_t totSlice = 3 * numLut + numFadc;
336 
337  uint8_t channel = 0;
338  for ( int asic = 0 ; asic < 4 ; ++asic ) {
339  for ( int mcm = 0 ; mcm < 16 ; ++mcm ) {
340  // ----------------------------------------------------------------------
341  std::vector<uint32_t> rotated(totSlice);
342 
343  for ( uint8_t slice = 0 ; slice < totSlice ; ++slice ) {
344  for ( uint8_t bit = 0 ; bit < 11 ; ++bit ) {
345  if ( state.m_ppBlock[slice * 11 + asic * (11 * totSlice) + bit + 1] & (1 << mcm))
346  rotated[slice] |= (1 << bit);
347  }
348  }
349 
350  bool nonZeroData = false;
351  for (uint8_t slice = 0; slice < numLut; ++slice) {
352  if (rotated[slice]
353  || rotated[slice + numLut]
354  || rotated[slice + 2 * numLut + numFadc]) { // CP, JET
355  nonZeroData = true;
356  break;
357  }
358  }
359 
360  std::vector<uint8_t> lcpVal;
361  std::vector<uint8_t> lcpBcidVec;
362  std::vector<uint8_t> ljeVal;
363  std::vector<uint8_t> ljeSat80Vec;
364  std::vector<int16_t> pedCor;
365  std::vector<uint8_t> pedEn;
366 
367  std::vector<uint16_t> adcVal;
368  std::vector<uint8_t> adcExt;
369 
370  if (nonZeroData) {
371  for (uint8_t slice = 0; slice < numLut; ++slice) {
372  lcpVal.push_back(rotated[slice] & 0xff);
373  ljeVal.push_back(rotated[slice + numLut] & 0xff);
374  pedCor.push_back(::pedCorrection(rotated[slice + 2 * numLut + numFadc] & 0x3ff));
375 
376  lcpBcidVec.push_back((rotated[slice] >> 8) & 0x7);
377  ljeSat80Vec.push_back((rotated[slice + numLut] >> 8) & 0x7);
378  pedEn.push_back((rotated[slice + 2 * numLut + numFadc] >> 10) & 0x1);
379  }
380  }
381 
382  for (uint8_t slice = 0; slice < numFadc; ++slice) {
383  if (rotated[slice + numLut]) { // CP, JET
384  nonZeroData = true;
385  break;
386  }
387  }
388 
389  if (nonZeroData) {
390  for (uint8_t slice = 0; slice < numFadc; ++ slice) {
391  adcVal.push_back(rotated[slice + 2 * numLut] & 0x3ff);
392  adcExt.push_back((rotated[slice + 2 * numLut] >> 10 & 0x1) & 0x3ff);
393  }
394  }
395 
397  state,
398  state.m_subBlockHeader.crate(),
399  state.m_subBlockHeader.module(),
400  channel,
401  std::move(lcpVal),
402  std::move(lcpBcidVec),
403  std::move(ljeVal),
404  std::move(ljeSat80Vec),
405  std::move(adcVal),
406  std::move(adcExt),
407  std::move(pedCor),
408  std::move(pedEn)));
409  // ---------------------------------------------------------------------
410  channel++;
411  }
412  }
413  return StatusCode::SUCCESS;
414 }
415 
417 {
418  BitReader br (state.m_ppBlock);
419  uint8_t chan = 0;
420  try{
421  while (chan < 64) {
422  uint8_t present = 1;
423  if (state.m_subBlockHeader.format() == 3) {
424  present = br.getField(1);
425  }
426 
427  if (present == 1) {
428  uint8_t lutVal = 0;
429  uint8_t fmt = 6;
430  uint8_t lutSat=0;
431  uint8_t lutExt=0;
432  uint8_t lutPeak=0;
433 
434  std::vector<uint16_t> adcVal = {0 , 0, 0, 0, 0};
435  std::vector<uint8_t> adcExt = {0 , 0, 0, 0, 0};
436 
437  uint8_t minHeader = br.getField(4);
438  uint8_t minIndex = minHeader % 5;
439  if (minHeader < 15) { // Formats 0-5
440  if (minHeader < 10) { // Formats 0-1
441  fmt = minHeader / 5;
442  } else { // Formats 2-5
443  fmt = 2 + br.getField( 2);
444  uint8_t haveLut = br.getField(1);
445  if (fmt == 2) {
446  if (haveLut == 1) {
447  lutVal = br.getField(3);
448  lutPeak = 1; // Even if LutVal==0 it seems
449  }
450  } else {
451  uint8_t haveExt = br.getField(1);
452  if (haveLut == 1) {
453  lutVal = br.getField(8);
454  lutExt = br.getField(1);
455  lutSat = br.getField(1);
456  lutPeak = br.getField(1);
457  }
458 
459  if (haveExt == 1){
460  for(uint8_t i = 0; i < 5; ++i) {
461  adcExt[i] = br.getField(1);
462  }
463  } else {
464  adcExt[2] = lutExt;
465  }
466  }
467  }
468  adcVal = getPpmAdcSamplesR3_(state, br, fmt, minIndex);
469  } else {
470  uint8_t haveAdc = br.getField(1);
471  if (haveAdc == 1) {
472  uint16_t val = br.getField(10);
473  for(uint8_t i = 0; i < 5; ++i) {
474  adcVal[i] = val;
475  }
476  }
477  }
478  // Add Trigger Tower
479  //std::vector<uint8_t> luts = {lutVal};
481  state,
482  state.m_subBlockHeader.crate(),
483  state.m_subBlockHeader.module(),
484  chan,
485  std::vector<uint8_t> {lutVal},
486  std::vector<uint8_t> {uint8_t(lutExt | (lutSat << 1) | (lutPeak << 2))},
487  std::move(adcVal),
488  std::move(adcExt)
489  ));
490  }
491  chan++;
492  }
493  }catch (const std::out_of_range& ex) {
494  ATH_MSG_WARNING("Excess Data in Sub-block");
496  }
497  return StatusCode::SUCCESS;
498 }
499 
501  State& state,
502  BitReader& br, uint8_t format, uint8_t minIndex) const
503 {
504  std::vector<uint16_t> adc = {0, 0, 0, 0, 0};
505  uint8_t minAdc = 0;
506 
507  for(uint8_t i = 0; i <5; ++i) {
508  uint8_t longField = 0;
509  uint8_t numBits = 0;
510  if (format > 2) {
511  longField = br.getField(1);
512  numBits = longField == 0? 4: (format * 2);
513  } else {
514  numBits = i == 0? 4: (format + 2);
515  }
516 
517  if (i == 0) {
518  minAdc = br.getField(numBits);
519  if (longField == 0) {
520  minAdc += state.m_caloUserHeader.ppLowerBound();
521  }
522  } else {
523  adc[i] = minAdc + br.getField(numBits);
524  }
525  }
526 
527  if (minIndex == 0) {
528  adc[0] = minAdc;
529  } else {
530  adc[0] = adc[minIndex];
531  adc[minIndex] = minAdc;
532  }
533  return adc;
534 }
535 
536 
537 
539  uint32_t word,
540  int inData) const
541 {
542 
543  StatusCode sc = StatusCode::SUCCESS;
544  if (state.m_subBlockHeader.seqNum() == 63) { // Error block
545  ATH_MSG_DEBUG("Error PPM subblock");
546  //TODO: errorTool
547  } else {
548  const uint8_t numAdc = state.m_subBlockHeader.nSlice2();
549  const uint8_t numLut = state.m_subBlockHeader.nSlice1();
550  const uint8_t nTotal = numAdc + numLut;
551  const uint8_t wordsPerBlock = 8; // 16 towers (4 MCMs) / 2 per word
552  const uint8_t iBlk = inData / wordsPerBlock;
553  uint8_t iChan = state.m_subBlockHeader.seqNum() + 2 * (inData % wordsPerBlock);
554 
555  if (iBlk < numLut) { // First all LUT values
556  for(uint8_t i = 0; i < 2; ++i) {
557  uint16_t subword = (word >> 16 * i) & 0x7ff;
558  state.m_ppLuts[iChan].push_back(subword);
559  iChan++;
560  }
561  } else if (iBlk < nTotal) { // Next all FADC values
562  for(uint8_t i = 0; i < 2; ++i) {
563  uint16_t subword = (word >> (16 * i)) & 0x7ff;
564  state.m_ppFadcs[iChan].push_back(subword);
565  iChan++;
566  }
567 
568  } else{
569  ATH_MSG_WARNING("Error decoding Ppm word (run1)");
570  sc = StatusCode::FAILURE;
571  }
572 
573  }
574  return sc;
575 }
576 
578 {
579  if (state.m_subBlockHeader.format() == 1) {
581  return StatusCode::SUCCESS;
582  } else if (state.m_subBlockHeader.format() >= 2) {
584  return StatusCode::SUCCESS;
585  }
586  return StatusCode::FAILURE;
587 }
588 
590 {
591  BitReader br (state.m_ppBlock);
592  uint8_t numAdc = state.m_subBlockHeader.nSlice2();
593  uint8_t numLut = state.m_subBlockHeader.nSlice1();
594  int16_t pedCorBase = -20;
595 
596 
597  try{
598  for(uint8_t chan = 0; chan < s_channels; ++chan) {
599  uint8_t present = 1;
600 
601  std::vector<uint8_t> haveLut(numLut, 0);
602  std::vector<uint8_t> lcpVal(numLut, 0);
603 
604  std::vector<uint8_t> lcpExt(numLut, 0);
605  std::vector<uint8_t> lcpSat(numLut, 0);
606  std::vector<uint8_t> lcpPeak(numLut, 0);
607  std::vector<uint8_t> lcpBcidVec(numLut, 0);
608 
609  std::vector<uint8_t> ljeVal(numLut, 0);
610 
611  std::vector<uint8_t> ljeLow(numLut, 0);
612  std::vector<uint8_t> ljeHigh(numLut, 0);
613  std::vector<uint8_t> ljeRes(numLut, 0);
614  std::vector<uint8_t> ljeSat80Vec(numLut, 0);
615 
616  std::vector<uint16_t> adcVal(numAdc, 0);
617  std::vector<uint8_t> adcExt(numAdc, 0);
618  std::vector<int16_t> pedCor(numLut, 0);
619  std::vector<uint8_t> pedEn(numLut, 0);
620 
621  int8_t encoding = -1;
622  int8_t minIndex = -1;
623 
624  if (state.m_subBlockHeader.format() == 3) {
625  present = br.getField(1);
626  }
627  if (present == 1) {
628  interpretPpmHeaderR4V1_(br, numAdc, encoding, minIndex);
629  CHECK((encoding != -1) && (minIndex != -1));
630  // First get the LIT related quantities
631  if (encoding < 3) {
632  // Get the peal finder bits
633  for(uint i=0; i < numLut; ++i) {
634  lcpPeak[i] = br.getField(1);
635  }
636  // Get Sat80 low bits
637  if (encoding > 0) {
638  for (uint8_t i = 0; i < numLut; ++i) {
639  ljeLow[i] = br.getField(1);
640  }
641  }
642  // Get LutCP and LutJEP values (these are
643  // only present if the peak finder is set).
644  if (encoding == 2) {
645  for (uint8_t i = 0; i < numLut; ++i) {
646  if (lcpPeak[i] == 1) {
647  lcpVal[i] = br.getField(4);
648  }
649  }
650  for(uint8_t i = 0; i < numLut; ++i) {
651  if (lcpPeak[i] == 1){
652  ljeVal[i] = br.getField(3);
653  }
654  }
655  }
656  } else if (encoding < 6) {
657  // Get LUT presence flag for each LUT slice.
658  for(uint8_t i = 0; i < numLut; ++i){
659  haveLut[i] = br.getField(1);
660  }
661 
662  // Get external BCID bits (if block is present).
663  uint8_t haveExt = br.getField(1);
664 
665  if (haveExt == 1) {
666  for (uint8_t i = 0; i < numAdc; ++i) {
667  adcExt[i] = br.getField(1);
668  }
669  }
670 
671  for(uint8_t i = 0; i < numLut; ++i){
672  if (haveLut[i] == 1) {
673  lcpVal[i] = br.getField(8);
674  lcpExt[i] = br.getField(1);
675  lcpSat[i] = br.getField(1);
676  lcpPeak[i] = br.getField(1);
677  }
678  }
679  // Get JEP LUT values and corresponding bits.
680  for(uint8_t i = 0; i < numLut; ++i){
681  if (haveLut[i] == 1) {
682  ljeVal[i] = br.getField(8);
683  ljeLow[i] = br.getField(1);
684  ljeHigh[i] = br.getField(1);
685  ljeRes[i] = br.getField(1);
686  }
687  }
688 
689  }
690 
691  }
692  // Next get the ADC related quantities (all encodings).
693  adcVal = getPpmAdcSamplesR4_(state, br, encoding, minIndex);
694  // Finally get the pedestal correction.
695  if ((encoding < 3) || (encoding == 6)) {
696  for (uint8_t i = 0; i < numLut; ++i)
697  {
698  pedCor[i] = br.getField(6) + pedCorBase;
699  if (state.m_subBlockHeader.compVer() > 0) {
700  pedEn[i] = 1;
701  }
702  }
703  } else {
704  // At the moment there is an enabled bit for every LUT slice
705  // (even though its really a global flag).
706  // The correction values is a twos complement signed value.
707  for (uint8_t i = 0; i < numLut; ++i)
708  {
709  uint16_t val = br.getField(10);
710  pedCor[i] = ::pedCorrection(val);
711  pedEn[i] = br.getField(1);
712  }
713  }
714 
715  for(uint8_t i=0; i < numLut; ++i){
716  lcpBcidVec[i] = uint8_t((lcpPeak[i] << 2) | (lcpSat[i] << 1) | lcpExt[i]);
717  ljeSat80Vec[i] = uint8_t((ljeRes[i] << 2) | (ljeHigh[i] << 1) | ljeLow[i]);
718  }
721  chan,
722  std::move(lcpVal), std::move(lcpBcidVec),
723  std::move(ljeVal), std::move(ljeSat80Vec),
724  std::move(adcVal), std::move(adcExt),
725  std::move(pedCor), std::move(pedEn)));
726  } // for
727  } catch (const std::out_of_range& ex) {
728  ATH_MSG_WARNING("Excess Data in Sub-block");
730  }
731  //Check status workd
732  return StatusCode::SUCCESS;
733 
734 }
735 
737  uint8_t numAdc,
738  int8_t& encoding, int8_t& minIndex) const
739 {
740  uint8_t minHeader = 0;
741 
742  if (numAdc == 5) {
743  minHeader = br.getField(4);
744 
745  minIndex = minHeader % 5;
746  if (minHeader < 15){ // Encodings 0-5
747  if (minHeader < 10) {
748  encoding = minHeader / 5;
749  } else {
750  encoding = 2 + br.getField(2);
751  }
752  } else {
753  encoding = 6;
754  }
755  } else {
756  uint8_t numBits = 0;
757  if (numAdc ==3 ) {
758  numBits = 2;
759  } else if (numAdc == 7) {
760  numBits = 3;
761  } else if (numAdc < 16) {
762  numBits = 4;
763  }
764 
765  if (numBits > 0) {
766  uint8_t fieldSize = 1 << numBits;
767  minHeader = br.getField(numBits);
768  uint8_t encValue = fieldSize - 1;
769  if (minHeader == encValue) { // Encoding 6
770  encoding = 6;
771  minIndex = 0;
772  } else {
773  minHeader += br.getField(2) << numBits;
774  minIndex = minHeader % fieldSize;
775  encValue = 3 * fieldSize;
776 
777  if (minHeader < encValue) { // Encodings 0-2
778  encoding = minHeader / fieldSize;
779  } else {
780  encoding = 3 + br.getField(2);
781  }
782  }
783  }
784  }
785 }
786 
788  State& state,
789  BitReader& br,
790  uint8_t encoding, uint8_t minIndex) const
791 {
792  uint8_t numAdc = state.m_subBlockHeader.nSlice2();
793 
794  if (encoding == 6) {
795  uint16_t val = br.getField(6);
796  return std::vector<uint16_t>(numAdc, val);
797  } else if ( encoding < 3) {
798  std::vector<uint16_t> adc(numAdc, 0);
799  uint16_t minAdc = br.getField(5) + state.m_caloUserHeader.ppLowerBound();
800  adc[minIndex] = minAdc;
801  for(uint8_t i = 1; i < numAdc; ++i) {
802  adc[i == minIndex? 0: i] = br.getField(encoding + 2) + minAdc;
803  }
804  return adc;
805  } else {
806  std::vector<uint16_t> adc(numAdc, 0);
807  uint16_t minAdc = br.getField(1)
808  ? br.getField(encoding * 2)
809  : (br.getField(5) +
811 
812  adc[minIndex] = minAdc;
813  for (uint8_t i = 1; i < numAdc; ++i) {
814  adc[minIndex == i? 0: i] = br.getField(
815  br.getField(1)? encoding * 2: 4
816  ) + minAdc;
817  }
818  return adc;
819  }
820 }
821 
823 {
824  if (state.m_subBlockHeader.format() == 1) {
826  return StatusCode::SUCCESS;
827  } else if (state.m_subBlockHeader.format() >= 2) {
828  // TODO: convert compressed
829  return StatusCode::FAILURE;
830  }
831  return StatusCode::FAILURE;
832 }
833 
835 {
836  BitReader br (state.m_ppBlock);
837  uint8_t numAdc = state.m_subBlockHeader.nSlice2();
838  uint8_t numLut = state.m_subBlockHeader.nSlice1();
839  uint8_t crate = state.m_subBlockHeader.crate();
841 
842  for (uint8_t chan = 0; chan < 64; ++chan) {
843 
844  //for (uint8_t k = 0; k < 4; ++k) {
845  std::vector<uint8_t> lcpVal;
846  std::vector<uint8_t> lcpBcidVec;
847 
848  std::vector<uint8_t> ljeVal;
849  std::vector<uint8_t> ljeSat80Vec;
850 
851 
852 
853  std::vector<uint16_t> adcVal;
854  std::vector<uint8_t> adcExt;
855  std::vector<int16_t> pedCor;
856  std::vector<uint8_t> pedEn;
857  try {
858  for (int i = 0; i < numLut; ++i) {
859  lcpVal.push_back(br.getField(8));
860  lcpBcidVec.push_back(br.getField(3));
861  }
862 
863  for (int i = 0; i < numLut; ++i) {
864  ljeVal.push_back(br.getField(8));
865  ljeSat80Vec.push_back(br.getField(3));
866  }
867 
868  for (int i = 0; i < numAdc; ++i) {
869  adcVal.push_back(br.getField(10));
870  adcExt.push_back(br.getField(1));
871  }
872 
873  for (int i = 0; i < numLut; ++i) {
874  uint16_t pc = br.getField(10);
875  pedCor.push_back(pedCorrection(pc));
876  pedEn.push_back(br.getField(1));
877  }
878  } catch (const std::out_of_range& ex) {
879  ATH_MSG_WARNING("Excess Data in Sub-block");
881  }
882  CHECK(
883  addTriggerTowerV2_(state,
884  crate, module, chan,
885  std::move(lcpVal), std::move(lcpBcidVec),
886  std::move(ljeVal), std::move(ljeSat80Vec),
887  std::move(adcVal), std::move(adcExt),
888  std::move(pedCor), std::move(pedEn)));
889  }
890 
891  return StatusCode::SUCCESS;
892 }
893 
895 {
896  for(auto lut : state.m_ppLuts) {
898  state,
899  state.m_subBlockHeader.crate(),
900  state.m_subBlockHeader.module(),
901  lut.first,
902  lut.second,
903  state.m_ppFadcs[lut.first]));
904  }
905  return StatusCode::SUCCESS;
906 }
907 
909  uint8_t crate, uint8_t module, uint32_t payload) const
910 {
911  LVL1::DataError errorBits(0);
913 
914  const uint32_t error = errorBits.error();
915  int curr = state.m_triggerTowers->size() - 1;
916  for(int i=0; i < s_channels; ++i){
917  if (curr < 0){
918  break;
919  }
920  auto tt = (*state.m_triggerTowers)[curr--];
921  if (tt->coolId() >> 16 & crateModuleMask(crate, module)){
922  tt->setErrorWord(error);
923  }else{
924  break;
925  }
926  }
927 }
928 
929 
931  State& state,
932  uint8_t crate,
933  uint8_t module,
935  std::vector<uint8_t>&& lcpVal,
936  std::vector<uint8_t>&& lcpBcidVec,
937  std::vector<uint8_t>&& ljeVal,
938  std::vector<uint8_t>&& ljeSat80Vec,
939  std::vector<uint16_t>&& adcVal,
940  std::vector<uint8_t>&& adcExt,
941  std::vector<int16_t>&& pedCor,
942  std::vector<uint8_t>&& pedEn) const
943 {
944  uint32_t coolId = ::coolId(crate, module, channel);
945 
946  int layer = 0;
947  double eta = 0.;
948  double phi = 0.;
949 
950  bool isData = m_ppmMaps->mapping(crate, module, channel, eta, phi, layer);
951 
952  if (!isData && !state.m_ppmIsRetSpare && !state.m_ppmIsRetMuon){
953  return StatusCode::SUCCESS;
954  }
955 
956  if (!isData) {
957  const int pin = channel % 16;
958  const int asic = channel / 16;
959  eta = 16 * crate + module;
960  phi = 4 * pin + asic;
961  }
962 
964  state.m_triggerTowers->push_back(tt);
965 
966  tt->initialize(coolId, eta, phi,
967  std::move(lcpVal), std::move(ljeVal),
968  std::move(pedCor), std::move(pedEn),
969  std::move(lcpBcidVec), std::move(adcVal),
970  std::move(adcExt), std::move(ljeSat80Vec),
971  0, state.m_caloUserHeader.lut(),
972  state.m_caloUserHeader.ppFadc());
973  return StatusCode::SUCCESS;
974 }
975 
977  State& state,
978  uint8_t crate,
979  uint8_t module,
981  std::vector<uint8_t>&& luts,
982  std::vector<uint8_t>&& lcpBcidVec,
983  std::vector<uint16_t>&& fadc,
984  std::vector<uint8_t>&& bcidExt
985  ) const
986 {
987  std::vector<uint8_t> ljeSat80Vec;
988 
989  std::vector<int16_t> pedCor;
990  std::vector<uint8_t> pedEn;
991 
993  crate, module, channel,
994  std::move(luts), std::move(lcpBcidVec),
995  std::move(luts) , std::move(ljeSat80Vec),
996  std::move(fadc), std::move(bcidExt),
997  std::move(pedCor), std::move(pedEn))
998  );
999 
1000  return StatusCode::SUCCESS;
1001 }
1002 
1004  State& state,
1005  uint8_t crate,
1006  uint8_t module,
1007  uint8_t channel,
1008  const std::vector<uint16_t>& luts,
1009  const std::vector<uint16_t>& fadc
1010  ) const
1011 {
1012  std::vector<uint8_t> lcpVal;
1013  std::vector<uint8_t> lcpBcidVec;
1014 
1015  std::vector<uint16_t> adcVal;
1016  std::vector<uint8_t> adcExt;
1017 
1018  for(auto lut: luts) {
1019  lcpVal.push_back(BitField::get<uint8_t>(lut, 0, 8));
1020  lcpBcidVec.push_back(BitField::get<uint8_t>(lut, 8, 3));
1021  }
1022 
1023  for(auto f: fadc) {
1024  adcExt.push_back(BitField::get<uint8_t>(f, 0, 1));
1025  adcVal.push_back(BitField::get<uint16_t>(f, 1, 10));
1026  }
1027 
1028  CHECK(addTriggerTowerV1_(state,
1029  crate, module, channel,
1030  std::move(lcpVal), std::move(lcpBcidVec),
1031  std::move(adcVal), std::move(adcExt)));
1032 
1033  return StatusCode::SUCCESS;
1034 }
1035 
1036 
1037 // Return reference to vector with all possible Source Identifiers
1038 
1040 {
1041  const int crates = 8;
1042 
1043  m_ppmSourceIDs.clear();
1044  m_ppmSourceIDsSpare.clear();
1045  m_ppmSourceIDsMuon.clear();
1046 
1047  for (int crate = 0; crate < crates; ++crate) {
1048  for (int slink = 0; slink < m_srcIdMap->maxSlinks(); ++slink) {
1049  const uint32_t rodId = m_srcIdMap->getRodID(crate, slink, 0,
1050  eformat::TDAQ_CALO_PREPROC);
1051  const uint32_t robId = m_srcIdMap->getRobID(rodId);
1052  m_ppmSourceIDs.push_back(robId);
1053  if (crate > 1 && crate < 6) {
1054  m_ppmSourceIDsSpare.push_back(robId);
1055  if (crate < 4 && slink == 0) {
1056  m_ppmSourceIDsMuon.push_back(robId);
1057  }
1058  }
1059  }
1060  }
1061 }
1062 
1063 
1064 
1065 const std::vector<uint32_t>& PpmByteStreamReadV1V2Tool::ppmSourceIDs(
1066  State& state,
1067  const std::string& sgKey) const
1068 {
1069  state.m_ppmIsRetMuon = false;
1070  state.m_ppmIsRetSpare = false;
1071 
1072  if (sgKey.find("Muon") != std::string::npos) {
1073  state.m_ppmIsRetMuon = true;
1074  } else if (sgKey.find("Spare") != std::string::npos) {
1075  state.m_ppmIsRetSpare = true;
1076  }
1077 
1078  if (state.m_ppmIsRetSpare) {
1079  return m_ppmSourceIDsSpare;
1080  }
1081 
1082  if (state.m_ppmIsRetMuon) {
1083  return m_ppmSourceIDsMuon;
1084  }
1085 
1086  return m_ppmSourceIDs;
1087 }
1088 
1089 
1090 
1092  (const uint8_t numBits)
1093 {
1094  if ((m_ppPointer + numBits) <= m_ppMaxBit) {
1095  uint32_t iWord = m_ppPointer / 31;
1096  uint8_t iBit = m_ppPointer % 31;
1097  m_ppPointer += numBits;
1098 
1099  uint32_t result;
1100  if ((iBit + numBits) <= 31) {
1101  result = ::bitFieldSize(m_ppBlock[iWord], iBit, numBits);
1102  } else {
1103  uint8_t nb1 = 31 - iBit;
1104  uint8_t nb2 = numBits - nb1;
1105  uint32_t field1 = ::bitFieldSize(m_ppBlock[iWord], iBit, nb1);
1106  uint32_t field2 = ::bitFieldSize(m_ppBlock[iWord + 1], 0, nb2);
1107  result = field1 | (field2 << nb1);
1108  }
1109 
1110  return result;
1111  }
1112 
1113  throw std::out_of_range("Requested too much bits from ppm block");
1114 }
1115 // ===========================================================================
1116 } // end namespace
1117 // ===========================================================================
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
LVL1BS::SubBlockHeader::seqNum
uint8_t seqNum() const
Definition: SubBlockHeader.cxx:41
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
CxxUtils::atomic_fetch_max
T atomic_fetch_max(std::atomic< T > *a, T v, std::memory_order memorder=std::memory_order_seq_cst)
Atomically calculate maximum.
Definition: atomic_fetch_minmax.h:42
LVL1BS::L1CaloSrcIdMap::slink
int slink(uint32_t code) const
Return slink from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:73
LVL1BS::SubBlockHeader::format
uint8_t format() const
Definition: SubBlockHeader.cxx:38
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlock_
StatusCode processPpmBlock_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:293
LVL1BS::PpmByteStreamReadV1V2Tool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: PpmByteStreamReadV1V2Tool.h:77
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_caloUserHeader
CaloUserHeader m_caloUserHeader
Definition: PpmByteStreamReadV1V2Tool.h:111
LVL1::DataError
Error data.
Definition: DataError.h:27
get_generator_info.result
result
Definition: get_generator_info.py:21
LVL1BS::L1CaloSrcIdMap::useSWROD
static void useSWROD(bool in)
Flag to decide if SWROD readout should be used instead of legacy.
Definition: L1CaloSrcIdMap.h:30
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_subBlockHeader
SubBlockHeader m_subBlockHeader
Definition: PpmByteStreamReadV1V2Tool.h:112
vtune_athena.format
format
Definition: vtune_athena.py:14
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LVL1BS::PpmByteStreamReadV1V2Tool::m_maxSizeSeen
std::atomic< size_t > m_maxSizeSeen
Definition: PpmByteStreamReadV1V2Tool.h:213
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader
Definition: PpmByteStreamReadV1V2Tool.h:82
SubBlockHeader.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1BS::L1CaloSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
Definition: L1CaloSrcIdMap.h:24
LVL1BS::SubBlockHeader::crate
uint8_t crate() const
Definition: SubBlockHeader.cxx:44
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlockR4V1_
StatusCode processPpmBlockR4V1_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:577
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppPointer
uint32_t m_ppPointer
Definition: PpmByteStreamReadV1V2Tool.h:94
LVL1BS::PpmByteStreamReadV1V2Tool::m_errorTool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Definition: PpmByteStreamReadV1V2Tool.h:201
L1Topo::blockType
L1Topo::BlockTypes blockType(const uint32_t word, uint32_t offset=28, uint32_t size=0x0f)
Function to return the block type of a data word from L1Topo
Definition: BlockTypes.cxx:9
LVL1BS::SubBlockHeader::nSlice1
uint8_t nSlice1() const
Definition: SubBlockHeader.cxx:53
LVL1BS::L1CaloSrcIdMap::getRobID
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
Definition: L1CaloSrcIdMap.cxx:32
LVL1BS::PpmByteStreamReadV1V2Tool::addTriggerTowerV1_
StatusCode addTriggerTowerV1_(State &state, uint8_t crate, uint8_t module, uint8_t channel, const std::vector< uint16_t > &luts, const std::vector< uint16_t > &fadc) const
Definition: PpmByteStreamReadV1V2Tool.cxx:1003
LVL1BS::CaloUserHeader
L1Calo User Header class.
Definition: CaloUserHeader.h:22
LVL1BS::PpmByteStreamReadV1V2Tool::processRobFragment_
StatusCode processRobFragment_(State &state, const ROBIterator &robFrag, const RequestType &requestedType) const
Definition: PpmByteStreamReadV1V2Tool.cxx:156
LVL1BS::PpmByteStreamReadV1V2Tool::convert
StatusCode convert(xAOD::TriggerTowerContainer *const ttCollection) const
Convert ROB fragments to trigger towers.
Definition: PpmByteStreamReadV1V2Tool.cxx:134
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppMaxBit
uint32_t m_ppMaxBit
Definition: PpmByteStreamReadV1V2Tool.h:95
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmCompressedR3V1_
StatusCode processPpmCompressedR3V1_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:416
LVL1BS::SubBlockHeader
L1Calo User Header class.
Definition: SubBlockHeader.h:20
LVL1BS::PpmByteStreamReadV1V2Tool::getPpmAdcSamplesR3_
std::vector< uint16_t > getPpmAdcSamplesR3_(State &state, BitReader &br, uint8_t format, uint8_t minIndex) const
Definition: PpmByteStreamReadV1V2Tool.cxx:500
LVL1BS::SubBlockHeader::isSubBlockHeader
bool isSubBlockHeader() const
Definition: SubBlockHeader.cxx:57
atomic_fetch_minmax.h
Atomic min/max functions.
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
LVL1BS::PpmByteStreamReadV1V2Tool::m_srcIdMap
L1CaloSrcIdMap * m_srcIdMap
Definition: PpmByteStreamReadV1V2Tool.h:211
LVL1BS::PpmByteStreamReadV1V2Tool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
Definition: PpmByteStreamReadV1V2Tool.h:205
SubBlockStatus.h
LVL1BS::PpmByteStreamReadV1V2Tool::finalize
virtual StatusCode finalize() override
Definition: PpmByteStreamReadV1V2Tool.cxx:100
LVL1BS::SubBlockHeader::version
uint8_t version() const
Definition: SubBlockHeader.cxx:35
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LVL1BS::PpmByteStreamReadV1V2Tool::processSubBlockStatus_
void processSubBlockStatus_(State &state, uint8_t crate, uint8_t module, uint32_t word) const
Definition: PpmByteStreamReadV1V2Tool.cxx:908
LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmMaps
ToolHandle< LVL1::IL1CaloMappingTool > m_ppmMaps
Channel mapping tool.
Definition: PpmByteStreamReadV1V2Tool.h:203
LVL1::DataError::SubStatusWord
@ SubStatusWord
Definition: DataError.h:44
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.PyAthena.module
module
Definition: PyAthena.py:131
LVL1BS::SubBlockHeader::nSlice2
uint8_t nSlice2() const
Definition: SubBlockHeader.cxx:50
LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmSourceIDs
std::vector< uint32_t > m_ppmSourceIDs
Definition: PpmByteStreamReadV1V2Tool.h:208
LVL1BS::CaloUserHeader::isValid
bool isValid() const
Definition: CaloUserHeader.cxx:46
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
LVL1BS::PpmByteStreamReadV1V2Tool::s_channels
static const uint8_t s_channels
Definition: PpmByteStreamReadV1V2Tool.h:219
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR4V1_
StatusCode processPpmStandardR4V1_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:834
LVL1BS::SubBlockHeader::compVer
uint8_t compVer() const
Definition: SubBlockHeader.h:34
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1BS::SubBlockHeader::module
uint8_t module() const
Definition: SubBlockHeader.cxx:47
LVL1BS::PpmByteStreamReadV1V2Tool::m_useSWROD
bool m_useSWROD
Definition: PpmByteStreamReadV1V2Tool.h:222
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LVL1BS::PpmByteStreamReadV1V2Tool::interpretPpmHeaderR4V1_
void interpretPpmHeaderR4V1_(BitReader &br, uint8_t numAdc, int8_t &encoding, int8_t &minIndex) const
Definition: PpmByteStreamReadV1V2Tool.cxx:736
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_ppmIsRetSpare
bool m_ppmIsRetSpare
Definition: PpmByteStreamReadV1V2Tool.h:110
CaloUserHeader.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
generateReferenceFile.encoding
encoding
Definition: generateReferenceFile.py:15
LVL1::DataError::set
void set(ErrorBit bit, int value=1)
Set an error bit or data.
Definition: DataError.cxx:28
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1BS::L1CaloSrcIdMap::crate
int crate(uint32_t code) const
Return crate from unpacked moduleID.
Definition: L1CaloSrcIdMap.cxx:57
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_robSourceId
uint32_t m_robSourceId
Definition: PpmByteStreamReadV1V2Tool.h:106
LVL1BS::PpmByteStreamReadV1V2Tool::addTriggerTowerV2_
StatusCode addTriggerTowerV2_(State &state, uint8_t crate, uint8_t module, uint8_t channel, std::vector< uint8_t > &&lcpVal, std::vector< uint8_t > &&lcpBcidVec, std::vector< uint8_t > &&ljeVal, std::vector< uint8_t > &&ljeSat80Vec, std::vector< uint16_t > &&adcVal, std::vector< uint8_t > &&adcExt, std::vector< int16_t > &&pedCor, std::vector< uint8_t > &&pedEn) const
Definition: PpmByteStreamReadV1V2Tool.cxx:930
LVL1BS::PpmByteStreamReadV1V2Tool::State
Definition: PpmByteStreamReadV1V2Tool.h:104
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
hist_file_dump.f
f
Definition: hist_file_dump.py:135
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:27
LVL1BS::CaloUserHeader::ppLowerBound
uint8_t ppLowerBound() const
Definition: CaloUserHeader.cxx:43
LVL1BS::CaloUserHeader::ppFadc
uint8_t ppFadc() const
Definition: CaloUserHeader.cxx:31
LVL1BS::PpmByteStreamReadV1V2Tool::PpmByteStreamReadV1V2Tool
PpmByteStreamReadV1V2Tool(const std::string &name)
Definition: PpmByteStreamReadV1V2Tool.cxx:63
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
plotBeamSpotCompare.xd
xd
Definition: plotBeamSpotCompare.py:220
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmNeutral_
StatusCode processPpmNeutral_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:331
WordDecoder.h
DataError.h
DataVector::capacity
size_type capacity() const noexcept
Returns the total number of elements that the collection can hold before needing to allocate more mem...
LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmSourceIDsSpare
std::vector< uint32_t > m_ppmSourceIDsSpare
Definition: PpmByteStreamReadV1V2Tool.h:210
LVL1::DataError::error
int error() const
Return the full error word.
Definition: DataError.h:78
PpmByteStreamReadV1V2Tool.h
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::getField
uint32_t getField(const uint8_t numBits)
Definition: PpmByteStreamReadV1V2Tool.cxx:1092
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_subDetectorID
uint8_t m_subDetectorID
Definition: PpmByteStreamReadV1V2Tool.h:108
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_ppFadcs
FadcsMap m_ppFadcs
Definition: PpmByteStreamReadV1V2Tool.h:115
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmBlockR3V1_
StatusCode processPpmBlockR3V1_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:822
LVL1BS::CaloUserHeader::lut
uint8_t lut() const
Definition: CaloUserHeader.cxx:34
LVL1::TrigT1CaloDefs::xAODTriggerTowerLocation
static const std::string xAODTriggerTowerLocation
Definition: TrigT1CaloDefs.h:36
TrigT1CaloDefs.h
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
LVL1BS::L1CaloSubBlock::UNPACK_EXCESS_DATA
@ UNPACK_EXCESS_DATA
Definition: L1CaloSubBlock.h:41
LVL1BS::PpmByteStreamReadV1V2Tool::RequestType
RequestType
Definition: PpmByteStreamReadV1V2Tool.h:76
LVL1BS::PpmByteStreamReadV1V2Tool::initSourceIDs
void initSourceIDs()
Definition: PpmByteStreamReadV1V2Tool.cxx:1039
LVL1BS::PpmByteStreamReadV1V2Tool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: PpmByteStreamReadV1V2Tool.h:79
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_rodSourceId
uint32_t m_rodSourceId
Definition: PpmByteStreamReadV1V2Tool.h:105
fmt
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmWord_
StatusCode processPpmWord_(State &state, uint32_t word, int indata) const
Definition: PpmByteStreamReadV1V2Tool.cxx:273
LVL1BS::PpmByteStreamReadV1V2Tool::RequestType::PPM
@ PPM
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_triggerTowers
xAOD::TriggerTowerContainer * m_triggerTowers
Definition: PpmByteStreamReadV1V2Tool.h:113
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
LVL1BS::PpmByteStreamReadV1V2Tool::m_ppmSourceIDsMuon
std::vector< uint32_t > m_ppmSourceIDsMuon
Definition: PpmByteStreamReadV1V2Tool.h:209
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_ppLuts
LutsMap m_ppLuts
Definition: PpmByteStreamReadV1V2Tool.h:114
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_ppmIsRetMuon
bool m_ppmIsRetMuon
Definition: PpmByteStreamReadV1V2Tool.h:109
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmCompressedR4V1_
StatusCode processPpmCompressedR4V1_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:589
LVL1BS::PpmByteStreamReadV1V2Tool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: PpmByteStreamReadV1V2Tool.cxx:84
LVL1BS::L1CaloSrcIdMap::getRodID
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
Definition: L1CaloSrcIdMap.cxx:18
LVL1BS::PpmByteStreamReadV1V2Tool::processPpmStandardR3V1_
StatusCode processPpmStandardR3V1_(State &state) const
Definition: PpmByteStreamReadV1V2Tool.cxx:894
LVL1BS::PpmByteStreamReadV1V2Tool::getPpmAdcSamplesR4_
std::vector< uint16_t > getPpmAdcSamplesR4_(State &state, BitReader &br, uint8_t encoding, uint8_t minIndex) const
Definition: PpmByteStreamReadV1V2Tool.cxx:787
LVL1BS::PpmByteStreamReadV1V2Tool::ROBPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
Definition: PpmByteStreamReadV1V2Tool.h:78
LVL1BS::L1CaloSrcIdMap::maxSlinks
int maxSlinks() const
Return the maximum possible number of slinks.
Definition: L1CaloSrcIdMap.cxx:82
LVL1BS::PpmByteStreamReadV1V2Tool::BitReader::m_ppBlock
const std::vector< uint32_t > & m_ppBlock
Definition: PpmByteStreamReadV1V2Tool.h:96
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_verCode
uint8_t m_verCode
Definition: PpmByteStreamReadV1V2Tool.h:107
error
Definition: IImpactPoint3dEstimator.h:70
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
LVL1BS::PpmByteStreamReadV1V2Tool::State::m_ppBlock
std::vector< uint32_t > m_ppBlock
Definition: PpmByteStreamReadV1V2Tool.h:116
python.SystemOfUnits.pc
float pc
Definition: SystemOfUnits.py:99
xAOD::TriggerTower
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/TriggerTower.h:16
PlotCalibFromCool.br
br
Definition: PlotCalibFromCool.py:355
LVL1BS::PpmByteStreamReadV1V2Tool::ppmSourceIDs
const std::vector< uint32_t > & ppmSourceIDs(State &state, const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.
Definition: PpmByteStreamReadV1V2Tool.cxx:1065
TriggerTowerAuxContainer.h