ATLAS Offline Software
ZdcByteStreamTool.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  * ZdcByteStreamTool.cxx
7  *
8  * Created on: May 7, 2009
9  * Author: leite
10  * (shameless based on the L1 Calo ByteStreamTool)
11  *
12  */
13 
14 #include <numeric>
15 #include <utility>
16 
17 #include "GaudiKernel/IInterface.h"
18 #include "GaudiKernel/MsgStream.h"
19 
21 
22 
23 #include "ZdcEvent/ZdcDigits.h"
28 //#include "ZdcByteStream/ZdcModifySlices.h"
30 
32 
34 
35 
36 //==================================================================================================
37 // Interface ID
38 static const InterfaceID IID_IZdcByteStreamTool("ZdcByteStreamTool", 1, 1);
39 
40 const InterfaceID& ZdcByteStreamTool::interfaceID()
41 {
42  return IID_IZdcByteStreamTool;
43 }
44 //==================================================================================================
45 
47  const std::string& name,
48  const IInterface* parent) :
50  //m_version(1),
51  //m_compVers(4),
52  m_channels(64),
53  m_crates(8),
54  //m_modules(16),
55  m_subDetector(eformat::FORWARD_ZDC),
56  m_srcIdMap(nullptr),
57  //m_towerKey(0),
58  //m_errorBlock(0),
59  m_rodStatus(nullptr)
60 
61 {
62  declareInterface<ZdcByteStreamTool> (this);
63 
64  declareProperty("PrintCompStats", m_printCompStats = 0, "Print compressed format statistics");
65 
66  // Properties for reading bytestream only
67  declareProperty("ZeroSuppress", m_zeroSuppress = 0,
68  "Only make trigger towers with non-zero EM or Had energy");
69  declareProperty("ROBSourceIDs", m_sourceIDs, "ROB fragment source identifiers");
70  declareProperty("PedestalValue", m_pedestal = 10,
71  "Pedestal value - needed for compressed formats 0,1 only");
72 
73  // Properties for writing bytestream only
74  declareProperty("DataFormat", m_dataFormat = 1, "Format identifier (0-3) in sub-block header");
75  declareProperty("FADCBaseline", m_fadcBaseline = 0,
76  "FADC baseline lower bound for compressed formats");
77  declareProperty("FADCThreshold", m_fadcThreshold = 1,
78  "FADC threshold for super-compressed format");
79  declareProperty("SlinksPerCrate", m_slinks = 4, "The number of S-Links per crate");
80  declareProperty("SimulSlicesLUT", m_dfltSlicesLut = 1,
81  "The number of LUT slices in the simulation");
82  declareProperty("SimulSlicesFADC", m_dfltSlicesFadc = 7,
83  "The number of FADC slices in the simulation");
84  declareProperty("ForceSlicesLUT", m_forceSlicesLut = 0,
85  "If >0, the number of LUT slices in bytestream");
86  declareProperty("ForceSlicesFADC", m_forceSlicesFadc = 0,
87  "If >0, the number of FADC slices in bytestream");
88 
89 }
90 
91 //==================================================================================================
92 // Initialize the tool
94 {
95  /*
96  * This would be used for crate/module/channel to eta/phi/layer mappings
97  StatusCode sc = m_zdcMaps.retrieve();
98  if (sc.isFailure())
99  {
100  msg(MSG::ERROR) << "Failed to retrieve tool " << m_zdcMaps << endmsg;
101  return sc;
102  }
103  else msg(MSG::INFO) << "Retrieved tool " << m_zdcMaps << endmsg;
104  */
105  m_srcIdMap = new ZdcSrcIdMap();
107  m_rodStatus = new std::vector<uint32_t>(2);
108 
109  const ZdcID* zdcID = nullptr;
110  if (detStore()->retrieve( zdcID ).isFailure() ) {
111  msg(MSG::ERROR) << "execute: Could not retrieve ZdcID object from the detector store" << endmsg;
112  return StatusCode::FAILURE;
113  }
114  else {
115  msg(MSG::DEBUG) << "execute: retrieved ZdcID" << endmsg;
116  }
117  m_zdcID = zdcID;
118 
119  return StatusCode::SUCCESS;
120 }
121 //==================================================================================================
122 
123 //==================================================================================================
124 // Finalize the tool
126 {
127  if (m_printCompStats && msgLvl(MSG::INFO))
128  {
129  msg(MSG::INFO);
130  printCompStats();
131  }
132 
133  delete m_rodStatus;
134  delete m_errorBlock;
135  //delete m_towerKey;
136  delete m_srcIdMap;
137  return StatusCode::SUCCESS;
138 }
139 //==================================================================================================
140 
141 //==================================================================================================
142 // Conversion bytestream to ZDCCollection
144  ZdcDigitsCollection* const ttCollection)
145 {
146 
147  const bool debug = msgLvl(MSG::DEBUG);
148  //const bool debug = 1;
149  const bool verbose = msgLvl(MSG::VERBOSE);
150 
151 
152  if (debug) msg(MSG::DEBUG);
153  if (verbose) msg(MSG::VERBOSE);
154 
155  // Clear trigger tower map
156 
157  typedef std::map<uint32_t,ZdcDigits*> hashmapType;
158  hashmapType digits_map;
159 
160  // Loop over ROB fragments
161  //msg(MSG::INFO) << "ZDC: Inside EVENT !" << endmsg;
162  int robCount = 0;
163  ROBIterator rob = robFrags.begin();
164  ROBIterator robEnd = robFrags.end();
165  for (; rob != robEnd; ++rob)
166  {
167 
168  ++robCount;
169  if (debug)
170  {
171  msg() << "ZDC: Treating ROB fragment " << robCount << endmsg;
172  }
173 
174  // Unpack ROD data (slinks)
175 
176  RODPointer payloadBeg;
178  RODPointer payloadEnd;
179  (*rob)->rod_data(payloadBeg);
180  payloadEnd = payloadBeg + (*rob)->rod_ndata();
181  payload = payloadBeg;
182  if (payload == payloadEnd)
183  {
184  if (debug) msg() << "ZDC: ROB fragment empty" << endmsg;
185  continue;
186  }
187 
188  // Check identifier
189  const uint32_t sourceID = (*rob)->rod_source_id();
190  if (debug)
191  {
192  if (ZdcSrcIdMap::subDet(sourceID) != m_subDetector || ZdcSrcIdMap::daqOrRoi(sourceID)
193  != 0)
194  {
195  msg() << "ZDC: Wrong source identifier in data: " << MSG::hex << sourceID << MSG::dec
196  << endmsg;
197  }
198  }
199  const int rodCrate = ZdcSrcIdMap::crate(sourceID);
200  if (debug)
201  {
202  msg() << "ZDC: Treating crate " << rodCrate << " slink " << ZdcSrcIdMap::slink(sourceID)
203  << "From SubDetectorID " << ZdcSrcIdMap::subDet(sourceID) << endmsg;
204  }
205 
206  /* Comment out - this needs adaptation as there are too much L1 dialect in here
207  * for now I wnat ot compile/run the bytestream to esd convertion, as I know how
208  * to unpack the ppm data
209  *
210  */
211  // First word is User Header
212  ZdcUserHeader userHeader(*payload);
213  const int minorVersion = (*rob)->rod_version() & 0xffff;
214  userHeader.setVersion(minorVersion);
215  const int headerWords = userHeader.words();
216  if (headerWords != 1 && debug)
217  {
218  msg() << "ZDC: Unexpected number of user header words: " << headerWords << endmsg;
219  }
220  // Does this makes sense??? Look above headerWords == 1
221  for (int i = 0; i < headerWords; ++i)
222  ++payload;
223  // triggered slice offsets
224  const int trigLut = userHeader.ppmLut();
225  const int trigFadc = userHeader.ppmFadc();
226  // FADC baseline lower bound
227  m_fadcBaseline = userHeader.lowerBound();
228  if (debug)
229  {
230  msg() << "ZDC: Minor format version number: " << MSG::hex << minorVersion << MSG::dec
231  << endmsg << "ZDC: LUT triggered slice offset: " << trigLut << endmsg
232  << "ZDC: FADC triggered slice offset: " << trigFadc << endmsg
233  << "ZDC: FADC baseline lower bound: " << m_fadcBaseline << endmsg;
234  }
235  const int runNumber = (*rob)->rod_run_no() & 0xffffff;
236 
237  // Find the number of channels per sub-block
238  int chanPerSubBlock = 0;
239  if (payload != payloadEnd)
240  {
242  {
243  msg(MSG::ERROR) << "Missing Sub-block header" << endmsg;
244  return StatusCode::FAILURE;
245  }
246  ZdcPpmSubBlock testBlock;
247  //Fix coverity CID 19251
248  //payload = testBlock.read(payload, payloadEnd);
249  testBlock.read(payload, payloadEnd);
250  chanPerSubBlock = testBlock.channelsPerSubBlock();
251  if (chanPerSubBlock == 0)
252  {
253  msg(MSG::ERROR) << "Unsupported version/data format: " << testBlock.version()
254  << "/" << testBlock.format() << endmsg;
255  return StatusCode::FAILURE;
256  }
257  if (m_channels % chanPerSubBlock != 0)
258  {
259  msg(MSG::ERROR) << "Invalid channels per sub-block: " << chanPerSubBlock << endmsg;
260  return StatusCode::FAILURE;
261  }
262  if (debug) msg() << "Channels per sub-block: " << chanPerSubBlock << endmsg;
263  }
264  else
265  {
266  if (debug) msg() << "ROB fragment contains user header only" << endmsg;
267  continue;
268  }
269  const int numSubBlocks = m_channels / chanPerSubBlock;
270 
271  // Loop over PPMs
272 
273  payload = payloadBeg;
274  for (int i = 0; i < headerWords; ++i)
275  ++payload;
276  while (payload != payloadEnd)
277  {
278 
279  // Get all sub-blocks for one PPM
280 
281  int crate = 0;
282  int module = 0;
283  m_ppmBlocks.clear();
284  for (int block = 0; block < numSubBlocks; ++block)
285  {
288  {
289  msg(MSG::ERROR) << "Unexpected data sequence" << endmsg;
290  return StatusCode::FAILURE;
291  }
292  if (chanPerSubBlock != m_channels && ZdcSubBlock::seqno(*payload) != block
293  * chanPerSubBlock)
294  {
295  if (debug)
296  {
297  msg() << "Unexpected channel sequence number: "
298  << ZdcSubBlock::seqno(*payload) << " expected " << block
299  * chanPerSubBlock << endmsg;
300  }
301  if (!m_ppmBlocks.empty()) break;
302  else
303  {
304  if (!debug)
305  {
306  msg(MSG::ERROR) << "Unexpected channel sequence number" << endmsg;
307  }
308  return StatusCode::FAILURE;
309  }
310  }
311  ZdcPpmSubBlock* const subBlock = new ZdcPpmSubBlock();
312  m_ppmBlocks.push_back(subBlock);
313  payload = subBlock->read(payload, payloadEnd);
314  if (block == 0)
315  {
316  crate = subBlock->crate();
317  module = subBlock->module();
318  if (debug)
319  {
320  msg() << "Module " << module << endmsg;
321  if (crate != rodCrate)
322  {
323  msg() << "Inconsistent crate number in ROD source ID" << endmsg;
324  }
325  }
326  }
327  else
328  {
329  if (subBlock->crate() != crate)
330  {
331  msg(MSG::ERROR) << "Inconsistent crate number in sub-blocks" << endmsg;
332  return StatusCode::FAILURE;
333  }
334  if (subBlock->module() != module)
335  {
336  msg(MSG::ERROR) << "Inconsistent module number in sub-blocks" << endmsg;
337  return StatusCode::FAILURE;
338  }
339  }
340  if (payload == payloadEnd && block != numSubBlocks - 1)
341  {
342  if (debug) msg() << "Premature end of data" << endmsg;
343  break;
344  }
345  }
346 
347  // Is there an error block?
348 
349  //delete m_errorBlock;
350  //m_errorBlock = 0;
351  m_errorBlock->clear();
352  if (payload != payloadEnd)
353  {
356  {
357  if (debug) msg() << "Error block found" << endmsg;
358  //m_errorBlock = new ZdcPpmSubBlock();
359  payload = m_errorBlock->read(payload, payloadEnd);
360  if (m_errorBlock->crate() != crate)
361  {
362  msg(MSG::ERROR) << "Inconsistent crate number in error block" << endmsg;
363  return StatusCode::FAILURE;
364  }
365  if (m_errorBlock->module() != module)
366  {
367  msg(MSG::ERROR) << "Inconsistent module number in error block" << endmsg;
368  return StatusCode::FAILURE;
369  }
371  {
372  if (debug)
373  {
374  std::string errMsg(m_errorBlock->unpackErrorMsg());
375  msg() << "Unpacking error block failed: " << errMsg << endmsg;
376  }
377  }
378  //delete m_errorBlock;
379  }
380  }
381 
382  // Loop over sub-blocks and fill trigger towers
383 
384  const int actualSubBlocks = m_ppmBlocks.size();
385  for (int block = 0; block < actualSubBlocks; ++block)
386  {
387  ZdcPpmSubBlock* const subBlock = m_ppmBlocks[block];
388  subBlock->setLutOffset(trigLut);
389  subBlock->setFadcOffset(trigFadc);
390  subBlock->setPedestal(m_pedestal);
391  subBlock->setFadcBaseline(m_fadcBaseline);
392  subBlock->setRunNumber(runNumber);
393  if (debug)
394  {
395  msg() << "Unpacking sub-block version/format/seqno: " << subBlock->version()
396  << "/" << subBlock->format() << "/" << subBlock->seqno() << endmsg;
397  }
398  if (subBlock->dataWords() && !subBlock->unpack())
399  {
400  if (debug)
401  {
402  std::string errMsg(subBlock->unpackErrorMsg());
403  msg() << "Unpacking PPM sub-block failed: " << errMsg << endmsg;
404  }
405  }
406  if (m_printCompStats) addCompStats(subBlock->compStats());
407  for (int chan = 0; chan < chanPerSubBlock; ++chan)
408  {
409  const int channel = block * chanPerSubBlock + chan;
410  std::vector<int> lut;
411  std::vector<int> fadc;
412  std::vector<int> bcidLut;
413  std::vector<int> bcidFadc;
414  subBlock->ppmData(channel, lut, fadc, bcidLut, bcidFadc);
415 // int trigLutKeep = trigLut;
416 // int trigFadcKeep = trigFadc;
417  if (lut.size() < size_t(trigLut + 1))
418  {
419  if (debug)
420  {
421  msg() << "Triggered LUT slice from header "
422  << "inconsistent with number of slices: " << trigLut << ", "
423  << lut.size() << ", reset to 0" << endmsg;
424  }
425 // trigLutKeep = 0;
426  }
427  if (fadc.size() < size_t(trigFadc + 1))
428  {
429  if (debug)
430  {
431  msg() << "Triggered FADC slice from header "
432  << "inconsistent with number of slices: " << trigFadc << ", "
433  << fadc.size() << ", reset to 0" << endmsg;
434  }
435 // trigFadcKeep = 0;
436  }
437  /*
438  LVL1::DataError errorBits(0);
439  if (m_errorBlock)
440  {
441  errorBits.set(LVL1::DataError::PPMErrorWord,
442  m_errorBlock->ppmError(channel));
443  errorBits.set(LVL1::DataError::SubStatusWord, m_errorBlock->subStatus());
444  }
445  else
446  {
447  errorBits.set(LVL1::DataError::PPMErrorWord, subBlock->ppmError(channel));
448  const ZdcPpmSubBlock* const lastBlock = m_ppmBlocks[actualSubBlocks - 1];
449  errorBits.set(LVL1::DataError::SubStatusWord, lastBlock->subStatus());
450  }
451  // Wrong bit set for compressed formats 1.01 to 1.03
452  if (subBlock->format() > 1 && subBlock->seqno() < 4)
453  {
454  errorBits.set(LVL1::DataError::ModuleError, (errorBits.error()
455  >> (LVL1::DataError::ModuleError + 1)) & 0x1);
456  }
457  const int error = errorBits.error();
458  */
459  // Only save non-zero data
460 
461  const bool any = std::accumulate(lut.begin(), lut.end(), 0)
462  || std::accumulate(fadc.begin(), fadc.end(), 0)
463  || std::accumulate(bcidLut.begin(), bcidLut.end(), 0)
464  || std::accumulate(bcidFadc.begin(), bcidFadc.end(), 0);
465 
466 
467  // Channel as unpacked is a SLink channel ordering, which is different
468  // from PPM channel ordering
469  // the sequence is :
470  // All channel A MCM
471  // All channel D MCM
472  // All channel B MCM
473  // All channel C MCM
474  Identifier chan_id;
475 
476  int ppmChannel = subBlock->getPpmChannel(channel);
477 
478  msg(MSG::DEBUG) << "--> ZCS: " << ZdcCablingService::getInstance() << endmsg;
479  chan_id = ZdcCablingService::getInstance()->h2s_channel_id(module, ppmChannel);
480 
481  const uint32_t chan_hash = chan_id.get_identifier32().get_compact();
482  msg(MSG::DEBUG) << "chan_hash = " << chan_hash << endmsg;
483 
484  //Change after uncommenting the above
485  //if (any || error)
486  if (any)
487  {
490  if (debug)
491  {
492  msg(MSG::DEBUG) << endmsg;
493  msg(MSG::DEBUG) <<" --------------------------------------" << endmsg;
494  msg(MSG::DEBUG) <<
495  "--> ZDC: [SubDet., Crate, Mod., Slink Chn., PPM Chan.] ";
496  msg(MSG::DEBUG) <<
497  "[" << m_subDetector << ", " << crate << ", " <<
498  module << ", " << channel << "," << ppmChannel << "]" << endmsg;
499 
500  msg(MSG::DEBUG) << "--> ZDC: LUT: ";
501  printVec(lut);
502  msg(MSG::DEBUG) << endmsg;
503 
504  msg(MSG::DEBUG) << "--> ZDC: FADC: ";
505  printVec(fadc);
506  msg(MSG::DEBUG) << endmsg;
507 
508  msg(MSG::DEBUG) << "--> ZDC: bcidLUT: ";
509  printVec(bcidLut);
510  msg(MSG::DEBUG) << endmsg;
511 
512  msg(MSG::DEBUG) << "--> ZDC: bcidFADC: ";
513  printVec(bcidFadc);
514  msg(MSG::DEBUG) << endmsg;
515 
516  msg(MSG::DEBUG) << "--> ZDC ID: " << chan_id.getString() << endmsg;
517  msg(MSG::DEBUG) << "--> ID side: " << m_zdcID->side(chan_id) << endmsg;
518  msg(MSG::DEBUG) << "--> ID module: " << m_zdcID->module(chan_id) << endmsg;
519  msg(MSG::DEBUG) << "--> ID type: " << m_zdcID->type(chan_id) << endmsg;
520  msg(MSG::DEBUG) << "--> ID channel: " << m_zdcID->channel(chan_id) << endmsg;
521 
522  msg(MSG::DEBUG) << "gain=" << gain << " delay=" << delay << endmsg;
523 
524  msg(MSG::DEBUG) <<" --------------------------------------" << endmsg;
525 
526  }
527 
528  hashmapType::iterator iter = digits_map.find(chan_hash);
529  if (iter == digits_map.end())
530  {
531  digits_map.insert(std::pair<uint32_t,ZdcDigits*>(chan_hash,new ZdcDigits(chan_id)));
532  iter = digits_map.find(chan_hash);
533  }
534  if (iter != digits_map.end())
535  {
536  if (gain==0&&delay==0) (*iter).second->set_digits_gain0_delay0(fadc);
537  if (gain==1&&delay==0) (*iter).second->set_digits_gain1_delay0(fadc);
538  if (gain==0&&delay==1) (*iter).second->set_digits_gain0_delay1(fadc);
539  if (gain==1&&delay==1) (*iter).second->set_digits_gain1_delay1(fadc);
540  }
541 
542  }
543  }
544  }
545  }
546  }
547 
548  hashmapType::iterator iter = digits_map.begin();
549  hashmapType::iterator iter_end = digits_map.end();
550 
551  while (iter != iter_end)
552  {
553  ttCollection->push_back((*iter).second);
554  ++iter;
555  }
556 
557  msg(MSG::DEBUG) << "-->ZDC: Collection has " << ttCollection->size() << " elements " << endmsg;
558 
559  return StatusCode::SUCCESS;
560 }
561 //==================================================================================================
562 
563 //==================================================================================================
564 // Conversion of ZDCCollection to bytestream
566  RawEventWrite* const /*re*/)
567 {
568  //if (re) ttCollection->size();
569  //See PpmByteStreamTool for a implementation
570  return StatusCode::SUCCESS;
571 }
572 //==================================================================================================
573 
574 //==================================================================================================
575 // Add compression stats to totals
576 void ZdcByteStreamTool::addCompStats(const std::vector<uint32_t>& stats)
577 {
578  if (stats.empty()) return;
579  const int n = stats.size();
580  if (m_compStats.empty()) m_compStats.resize(n);
581  for (int i = 0; i < n; ++i)
582  m_compStats[i] += stats[i];
583 }
584 //==================================================================================================
585 
586 //==================================================================================================
587 // Print compression stats
589 {
590  msg() << "Compression stats format/count: ";
591  const int n = m_compStats.size();
592  for (int i = 0; i < n; ++i)
593  {
594  msg() << " " << i << "/" << m_compStats[i];
595  }
596  msg() << endmsg;
597 }
598 //==================================================================================================
599 
600 //==================================================================================================
601 // Return reference to vector with all possible Source Identifiers
602 const std::vector<uint32_t>& ZdcByteStreamTool::sourceIDs()
603 {
604  if (m_sourceIDs.empty()) {
605  const int maxlinks = ZdcSrcIdMap::maxSlinks();
606  for (int crate = 0; crate < m_crates; ++crate) {
607  for (int slink = 0; slink < maxlinks; ++slink) {
608  const int daqOrRoi = 0;
609  const uint32_t rodId = ZdcSrcIdMap::getRodID(crate, slink, daqOrRoi,
610  m_subDetector);
611  const uint32_t robId = ZdcSrcIdMap::getRobID(rodId);
612  m_sourceIDs.push_back(robId);
613  }
614  }
615  }
616  return m_sourceIDs;
617 }
618 //==================================================================================================
619 
620 //==================================================================================================
621 // Print a vector
622 void ZdcByteStreamTool::printVec(const std::vector<int>& vec) const
623 {
624  std::vector<int>::const_iterator pos;
625  //msg() << "-----> " ;
626  for (pos = vec.begin(); pos != vec.end(); ++pos)
627  {
628  if (pos != vec.begin()) msg() << ",";
629  msg() << *pos;
630  }
631  //msg() << endmsg;
632 }
633 //==================================================================================================
634 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ZdcSrcIdMap::crate
static int crate(uint32_t code)
moduleID -> crate
Definition: ZdcSrcIdMap.cxx:55
eformat
Definition: L1CaloBsDecoderUtil.h:11
ZdcPpmSubBlock::channelsPerSubBlock
static int channelsPerSubBlock(int version, int format)
Return the number of channels per sub-block.
Definition: ZdcPpmSubBlock.cxx:464
ZdcPpmSubBlock.h
ZdcCablingService::getInstance
static const ZdcCablingService * getInstance()
get pointer to service instance
Definition: ZdcCablingService.cxx:14
RawEventWrite
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition: RawEvent.h:39
ZdcByteStreamTool::m_channels
int m_channels
Number of channels per module (may not all be used)
Definition: ZdcByteStreamTool.h:101
ZdcByteStreamTool::m_ppmBlocks
DataVector< ZdcPpmSubBlock > m_ppmBlocks
Vector for current PPM sub-blocks.
Definition: ZdcByteStreamTool.h:133
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
ZdcByteStreamTool.h
ZdcUserHeader::setVersion
void setVersion(int minorVersion)
Set version flag.
Definition: ZdcUserHeader.h:127
ZdcUserHeader.h
ZdcUserHeader::lowerBound
int lowerBound() const
Return FADC lower bound.
Definition: ZdcUserHeader.h:104
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
ZdcID::module
int module(const Identifier &id) const
Definition: ZdcID.h:163
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
ZdcSubBlock::dataWords
int dataWords() const
Return number of data words.
Definition: ZdcSubBlock.h:235
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ZdcSrcIdMap::getRobID
static uint32_t getRobID(uint32_t rod_id)
ROD -> ROB.
Definition: ZdcSrcIdMap.cxx:30
ZdcByteStreamTool::m_dataFormat
int m_dataFormat
Sub_block header version.
Definition: ZdcByteStreamTool.h:95
ZdcDigits
Definition: ZdcDigits.h:28
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
ZdcUserHeader::ppmFadc
int ppmFadc() const
Definition: ZdcUserHeader.h:98
ZdcDigitsCollection.h
ZdcCablingService::h2s_channel_id
Identifier h2s_channel_id(int crate, int channel) const
Definition: ZdcCablingService.cxx:326
ZdcByteStreamTool::RODPointer
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
Definition: ZdcByteStreamTool.h:83
ZdcSubBlock::seqno
int seqno() const
Definition: ZdcSubBlock.h:255
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ZdcByteStreamTool::sourceIDs
const std::vector< uint32_t > & sourceIDs()
Return reference to vector with all possible Source Identifiers.
Definition: ZdcByteStreamTool.cxx:602
ZdcByteStreamTool::m_zeroSuppress
int m_zeroSuppress
Zero suppression on input.
Definition: ZdcByteStreamTool.h:123
ZdcByteStreamTool::m_dfltSlicesLut
int m_dfltSlicesLut
Default number of LUT slices in simulation.
Definition: ZdcByteStreamTool.h:109
ZdcPpmSubBlock::setLutOffset
void setLutOffset(int offset)
Definition: ZdcPpmSubBlock.h:329
ZdcPpmSubBlock::setRunNumber
void setRunNumber(int run)
Definition: ZdcPpmSubBlock.h:354
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
ZdcByteStreamTool::m_dfltSlicesFadc
int m_dfltSlicesFadc
Default number of FADC slices in simulation.
Definition: ZdcByteStreamTool.h:111
ZdcSubBlock::wordType
static SubBlockWordType wordType(uint32_t word)
Word identification.
Definition: ZdcSubBlock.cxx:422
ZdcPpmSubBlock::unpack
bool unpack()
Unpack data.
Definition: ZdcPpmSubBlock.cxx:295
ZdcSubBlock::crate
int crate() const
Definition: ZdcSubBlock.h:265
ZdcSubBlock::version
int version() const
Definition: ZdcSubBlock.h:245
ZdcByteStreamTool::printCompStats
void printCompStats() const
Print compression stats.
Definition: ZdcByteStreamTool.cxx:588
python.PyAthena.module
module
Definition: PyAthena.py:134
ZdcByteStreamTool::m_rodStatus
std::vector< uint32_t > * m_rodStatus
ROD Status words.
Definition: ZdcByteStreamTool.h:137
ZdcByteStreamTool::m_errorBlock
ZdcPpmSubBlock * m_errorBlock
Trigger tower key provider.
Definition: ZdcByteStreamTool.h:131
ZdcSrcIdMap::subDet
static eformat::SubDetector subDet(uint32_t code)
ID -> sub-detector.
Definition: ZdcSrcIdMap.cxx:87
ZdcCablingService.h
ZdcByteStreamTool::m_fadcThreshold
int m_fadcThreshold
FADC threshold for super-compressed format.
Definition: ZdcByteStreamTool.h:121
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
ZdcSrcIdMap::daqOrRoi
static int daqOrRoi(uint32_t code)
moduleID -> daqOrRoi
Definition: ZdcSrcIdMap.cxx:63
ZdcSubBlock::format
int format() const
Definition: ZdcSubBlock.h:250
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
ZdcCablingService::hwid2delay
int hwid2delay(int crate, int channel) const
Definition: ZdcCablingService.cxx:417
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
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
ZdcByteStreamTool::m_forceSlicesFadc
int m_forceSlicesFadc
Force number of FADC slices in bytestream.
Definition: ZdcByteStreamTool.h:115
ZdcSrcIdMap::maxSlinks
static int maxSlinks()
Return the maximum possible number of slinks.
Definition: ZdcSrcIdMap.cxx:80
ZdcSrcIdMap.h
ZdcSubBlock::HEADER
@ HEADER
Definition: ZdcSubBlock.h:37
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ZdcByteStreamTool::convert
StatusCode convert(const IROBDataProviderSvc::VROBFRAG &robFrags, ZdcDigitsCollection *ttCollection)
Convert ROB fragments to ZdcCollection.
Definition: ZdcByteStreamTool.cxx:143
ZdcSrcIdMap::slink
static int slink(uint32_t code)
moduleID -> slink
Definition: ZdcSrcIdMap.cxx:71
delay
double delay(std::size_t d)
Definition: JetTrigTimerTest.cxx:14
ZdcUserHeader::ppmLut
int ppmLut() const
Definition: ZdcUserHeader.h:92
ZdcByteStreamTool::addCompStats
void addCompStats(const std::vector< uint32_t > &stats)
Add compression stats to totals.
Definition: ZdcByteStreamTool.cxx:576
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition: IROBDataProviderSvc.h:29
ZdcByteStreamTool::m_pedestal
int m_pedestal
Pedestal value.
Definition: ZdcByteStreamTool.h:117
ZdcByteStreamTool::printVec
void printVec(const std::vector< int > &vec) const
Print a vector.
Definition: ZdcByteStreamTool.cxx:622
ZdcByteStreamTool::ROBIterator
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
Definition: ZdcByteStreamTool.h:82
ZdcByteStreamTool::m_compStats
std::vector< uint32_t > m_compStats
Vector for compression statistics.
Definition: ZdcByteStreamTool.h:135
ZdcByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: ZdcByteStreamTool.cxx:40
FullEventAssembler.h
DataVector::clear
void clear()
Erase all the elements in the collection.
ZdcByteStreamTool::m_crates
int m_crates
Number of crates.
Definition: ZdcByteStreamTool.h:103
ZdcPpmSubBlock::setFadcOffset
void setFadcOffset(int offset)
Definition: ZdcPpmSubBlock.h:334
ZdcPpmSubBlock::errorBlock
static bool errorBlock(uint32_t word)
Check if a header word is for an error block.
Definition: ZdcPpmSubBlock.cxx:495
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
ZdcPpmSubBlock::setFadcBaseline
void setFadcBaseline(int baseline)
Definition: ZdcPpmSubBlock.h:344
ZdcPpmSubBlock::clear
void clear()
Clear all data.
Definition: ZdcPpmSubBlock.cxx:75
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ZdcDigits.h
ZdcPpmSubBlock::ppmData
void ppmData(int chan, std::vector< int > &lut, std::vector< int > &fadc, std::vector< int > &bcidLut, std::vector< int > &bcidFadc) const
Return unpacked data for given channel.
Definition: ZdcPpmSubBlock.cxx:167
ZdcByteStreamTool::m_printCompStats
int m_printCompStats
Compression version.
Definition: ZdcByteStreamTool.h:99
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ZdcCablingService::hwid2gain
int hwid2gain(int crate, int channel) const
Definition: ZdcCablingService.cxx:407
ZdcPpmSubBlock::compStats
const std::vector< uint32_t > & compStats() const
Return reference to compression stats.
Definition: ZdcPpmSubBlock.h:389
ZdcByteStreamTool::m_slinks
int m_slinks
Number of modules per crate (may not all exist)
Definition: ZdcByteStreamTool.h:107
ZdcPpmSubBlock::getPpmChannel
int getPpmChannel(const int channel) const
Definition: ZdcPpmSubBlock.h:415
ZdcSrcIdMap::getRodID
static uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet)
Make a ROD Source ID.
Definition: ZdcSrcIdMap.cxx:19
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
ZdcPpmSubBlock::setPedestal
void setPedestal(int pedval)
Definition: ZdcPpmSubBlock.h:339
ZdcUserHeader
L1Calo User Header class.
Definition: ZdcUserHeader.h:24
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
ZdcSubBlock.h
ZdcSubBlock::module
int module() const
Definition: ZdcSubBlock.h:270
ZdcSubBlock::read
OFFLINE_FRAGMENTS_NAMESPACE::PointerType read(const OFFLINE_FRAGMENTS_NAMESPACE::PointerType beg, const OFFLINE_FRAGMENTS_NAMESPACE::PointerType end)
Input complete packed sub-block from ROD array.
Definition: ZdcSubBlock.cxx:121
ZdcByteStreamTool::m_fadcBaseline
int m_fadcBaseline
FADC baseline lower bound.
Definition: ZdcByteStreamTool.h:119
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
ZdcByteStreamTool::ZdcByteStreamTool
ZdcByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ZdcByteStreamTool.cxx:46
DEBUG
#define DEBUG
Definition: page_access.h:11
ZdcID::side
int side(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: ZdcID.h:157
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
ZdcID::type
int type(const Identifier &id) const
Definition: ZdcID.h:169
ZdcByteStreamTool::finalize
virtual StatusCode finalize() override
Definition: ZdcByteStreamTool.cxx:125
ZdcDigitsCollection
Definition: ZdcDigitsCollection.h:20
ZdcByteStreamTool::m_zdcID
const ZdcID * m_zdcID
Definition: ZdcByteStreamTool.h:141
ZdcPpmSubBlock
Sub-Block class for PPM data.
Definition: ZdcPpmSubBlock.h:30
ZdcSrcIdMap
This class provides conversion between Lower level Source ID to higher level source ID for L1Calo Byt...
Definition: ZdcSrcIdMap.h:24
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
AthAlgTool
Definition: AthAlgTool.h:26
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
ZdcByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: ZdcByteStreamTool.cxx:93
ZdcID
Definition: ZdcID.h:25
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ZdcByteStreamTool::m_sourceIDs
std::vector< uint32_t > m_sourceIDs
ROB source IDs.
Definition: ZdcByteStreamTool.h:125
ZdcByteStreamTool::m_subDetector
eformat::SubDetector m_subDetector
Sub-detector type.
Definition: ZdcByteStreamTool.h:127
ZdcByteStreamTool::m_srcIdMap
ZdcSrcIdMap * m_srcIdMap
Source ID converter.
Definition: ZdcByteStreamTool.h:129
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
ZdcByteStreamTool::m_forceSlicesLut
int m_forceSlicesLut
Force number of LUT slices in bytestream.
Definition: ZdcByteStreamTool.h:113
ZdcSubBlock::unpackErrorMsg
std::string unpackErrorMsg() const
Return the unpacking error message for printing.
Definition: ZdcSubBlock.cxx:206
ZdcUserHeader::words
int words() const
Return number of header words (should be one)
Definition: ZdcUserHeader.h:86
ZdcID::channel
int channel(const Identifier &id) const
Definition: ZdcID.h:175