ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
ZdcSubBlock Class Reference

Zdc Sub Block base class. More...

#include <ZdcSubBlock.h>

Inheritance diagram for ZdcSubBlock:
Collaboration diagram for ZdcSubBlock:

Public Types

enum  SubBlockWordType { HEADER, DATA, STATUS }
 
enum  DataFormats { NEUTRAL = 0, UNCOMPRESSED = 1, COMPRESSED = 2, SUPERCOMPRESSED = 3 }
 
enum  UnpackErrorType {
  UNPACK_NONE, UNPACK_VERSION, UNPACK_FORMAT, UNPACK_COMPRESSION_VERSION,
  UNPACK_COMPRESSION_SLICES, UNPACK_DATA_TRUNCATED, UNPACK_SOURCE_ID, UNPACK_WORD_ID
}
 

Public Member Functions

 ZdcSubBlock ()
 
 ~ZdcSubBlock ()
 
void clear ()
 Clear all data. More...
 
int dataWords () const
 Return number of data words. More...
 
void setHeader (int wordId, int version, int format, int seqno, int crate, int module, int slices2, int slices1)
 Store header data. More...
 
int wordId () const
 
int version () const
 
int format () const
 
int seqno () const
 
int slice () const
 
int crate () const
 
int module () const
 
int slices2 () const
 
int slices1 () const
 
uint32_t failingBCN () const
 
bool glinkTimeout () const
 
bool glinkDown () const
 
bool upstreamError () const
 
bool daqOverflow () const
 
bool bcnMismatch () const
 
bool glinkProtocol () const
 
bool glinkParity () const
 
uint32_t subStatus () const
 Return Sub-status word. More...
 
void setBunchCrossing (int bc)
 Set the Bunch Crossing number (neutral format only) More...
 
int bunchCrossing () const
 Return the Bunch Crossing number (neutral format only) More...
 
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. More...
 
void write (FullEventAssembler< ZdcSrcIdMap >::RODDATA *theROD) const
 Output complete packed sub-block to ROD vector. More...
 
void setStatus (uint32_t failingBCN, bool glinkTimeout, bool glinkDown, bool upstreamError, bool daqOverflow, bool bcnMismatch, bool glinkProtocol, bool glinkParity)
 Store error status trailer. More...
 
void setDaqOverflow (int bit=1)
 Set DAQ FIFO Overflow bit in Sub-status word. More...
 
void setGlinkParity (int bit=1)
 Set G-Link Parity bit in Sub-status word. More...
 
void setUnpackErrorCode (int code)
 Set the unpacking error code. More...
 
int unpackErrorCode () const
 Return the unpacking error code. More...
 
std::string unpackErrorMsg () const
 Return the unpacking error message for printing. More...
 
void packer (uint32_t datum, int nbits)
 Pack given data into given number of bits. More...
 
void packerFlush ()
 Flush the current data word padded with zeros. More...
 
void setStreamed ()
 Set continuous bit streaming for compressed formats. More...
 
uint32_t unpacker (int nbits)
 Unpack given number of bits of data. More...
 
void unpackerInit ()
 Initialise unpacker. More...
 
bool unpackerSuccess () const
 Return unpacker success flag. More...
 
void packerNeutral (int pin, uint32_t datum, int nbits)
 Pack given neutral data from given pin. More...
 
void packerNeutralParity (int pin)
 Pack current G-Link parity bit for given pin. More...
 
uint32_t unpackerNeutral (int pin, int nbits)
 Unpack given number of bits of neutral data for given pin. More...
 
bool unpackerNeutralParityError (int pin)
 Unpack and test G-Link parity bit for given pin. More...
 

Static Public Member Functions

static SubBlockWordType wordType (uint32_t word)
 Word identification. More...
 
static int wordId (uint32_t word)
 Return wordID field from given header word. More...
 
static int format (uint32_t word)
 Return data format from given header word. More...
 
static int seqno (uint32_t word)
 Return seqno field from given header word. More...
 
static int module (uint32_t word)
 Return module field from given header word. More...
 
static int minBits (uint32_t datum)
 Return the minimum number of bits needed for given data. More...
 
static int parityBit (int init, uint32_t datum, int nbits)
 Return the parity bit for given data. More...
 

Private Attributes

uint32_t m_header
 Sub-Block Header. More...
 
uint32_t m_trailer
 Sub-Block Status Trailer. More...
 
int m_bunchCrossing
 Bunch Crossing number (neutral format only) More...
 
int m_unpackError
 Unpacking error code. More...
 
uint32_t m_bitword
 
int m_currentBit
 
int m_maxBits
 
uint32_t m_maxMask
 
bool m_unpackerFlag
 
std::vector< uint32_t >::const_iterator m_dataPos
 
std::vector< uint32_t >::const_iterator m_dataPosEnd
 
std::vector< int > m_currentPinBit
 
std::vector< int > m_oddParity
 
int m_dataWords
 Current number of data words. More...
 
std::vector< uint32_t > m_data
 Sub-Block data. More...
 

Static Private Attributes

static const int s_headerBit = 30
 ZdcSubBlock.cxx this is a base class derived (copyed) from LVL1 I do not think we need this this way; either implement directly on PpmSubBlock or link to LVL1. More...
 
static const int s_statusBit = 28
 
static const uint32_t s_headerMask = 0x3
 
static const uint32_t s_statusMask = 0x1
 
static const uint32_t s_headerVal = 0x3
 
static const uint32_t s_statusVal = 0x1
 
static const int s_wordIdBit = 28
 
static const int s_versionBit = 25
 
static const int s_formatBit = 22
 
static const int s_seqnoBit = 16
 
static const int s_crateBit = 12
 
static const int s_moduleBit = 8
 
static const int s_slices2Bit = 3
 
static const int s_slices1Bit = 0
 
static const uint32_t s_wordIdMask = 0xf
 
static const uint32_t s_versionMask = 0x7
 
static const uint32_t s_formatMask = 0x7
 
static const uint32_t s_seqnoMask = 0x3f
 
static const uint32_t s_crateMask = 0xf
 
static const uint32_t s_moduleMask = 0xf
 
static const uint32_t s_slices2Mask = 0x1f
 
static const uint32_t s_slices1Mask = 0x7
 
static const int s_failingBcnBit = 22
 
static const int s_glinkTimeoutBit = 7
 
static const int s_glinkDownBit = 6
 
static const int s_upstreamErrorBit = 4
 
static const int s_daqOverflowBit = 3
 
static const int s_bcnMismatchBit = 2
 
static const int s_glinkProtocolBit = 1
 
static const int s_glinkParityBit = 0
 
static const uint32_t s_failingBcnMask = 0x3f
 
static const int s_maxWordBits = 32
 
static const int s_maxStreamedBits = 31
 
static const uint32_t s_maxWordMask = 0xffffffff
 
static const uint32_t s_maxStreamedMask = 0x7fffffff
 
static const int s_maxPins = 20
 
static const uint32_t s_glinkDavSet = 0x400000
 

Detailed Description

Zdc Sub Block base class.

Author
Peter Faulkner

Derived (copied !) from L1Calo Sub-Block base class.

Don't think we need this, as there is only one type of subblock (only PPM) being used by ZDC. Implement at once inside ZdcPpmSubBlock

Marco Leite

TRY_LINK_LVL1

Definition at line 34 of file ZdcSubBlock.h.

Member Enumeration Documentation

◆ DataFormats

Enumerator
NEUTRAL 
UNCOMPRESSED 
COMPRESSED 
SUPERCOMPRESSED 

Definition at line 41 of file ZdcSubBlock.h.

41  { NEUTRAL = 0,
42  UNCOMPRESSED = 1,
43  COMPRESSED = 2,
44  SUPERCOMPRESSED = 3 };

◆ SubBlockWordType

Enumerator
HEADER 
DATA 
STATUS 

Definition at line 37 of file ZdcSubBlock.h.

37  { HEADER,
38  DATA,
39  STATUS };

◆ UnpackErrorType

Enumerator
UNPACK_NONE 
UNPACK_VERSION 
UNPACK_FORMAT 
UNPACK_COMPRESSION_VERSION 
UNPACK_COMPRESSION_SLICES 
UNPACK_DATA_TRUNCATED 
UNPACK_SOURCE_ID 
UNPACK_WORD_ID 

Definition at line 46 of file ZdcSubBlock.h.

Constructor & Destructor Documentation

◆ ZdcSubBlock()

ZdcSubBlock::ZdcSubBlock ( )

Definition at line 66 of file ZdcSubBlock.cxx.

◆ ~ZdcSubBlock()

ZdcSubBlock::~ZdcSubBlock ( )

Definition at line 79 of file ZdcSubBlock.cxx.

80 {
81 }

Member Function Documentation

◆ bcnMismatch()

bool ZdcSubBlock::bcnMismatch ( ) const
inline

Definition at line 310 of file ZdcSubBlock.h.

311 {
312  return m_trailer & (0x1 << s_bcnMismatchBit);
313 }

◆ bunchCrossing()

int ZdcSubBlock::bunchCrossing ( ) const
inline

Return the Bunch Crossing number (neutral format only)

Definition at line 335 of file ZdcSubBlock.h.

336 {
337  return m_bunchCrossing;
338 }

◆ clear()

void ZdcSubBlock::clear ( )

Clear all data.

Definition at line 85 of file ZdcSubBlock.cxx.

86 {
87  m_header = 0;
88  m_trailer = 0;
89  m_bunchCrossing = 0;
91  m_bitword = 0;
92  m_currentBit = 0;
93  m_unpackerFlag = false;
94  m_currentPinBit.assign(s_maxPins, 0);
95  m_oddParity.assign(s_maxPins, 1);
96  m_dataWords = 0;
97  m_data.clear();
98 }

◆ crate()

int ZdcSubBlock::crate ( ) const
inline

Definition at line 265 of file ZdcSubBlock.h.

266 {
267  return (m_header >> s_crateBit) & s_crateMask;
268 }

◆ daqOverflow()

bool ZdcSubBlock::daqOverflow ( ) const
inline

Definition at line 305 of file ZdcSubBlock.h.

306 {
307  return m_trailer & (0x1 << s_daqOverflowBit);
308 }

◆ dataWords()

int ZdcSubBlock::dataWords ( ) const
inline

Return number of data words.

Definition at line 235 of file ZdcSubBlock.h.

236 {
237  return m_dataWords;
238 }

◆ failingBCN()

uint32_t ZdcSubBlock::failingBCN ( ) const
inline

Definition at line 285 of file ZdcSubBlock.h.

286 {
288 }

◆ format() [1/2]

int ZdcSubBlock::format ( ) const
inline

Definition at line 250 of file ZdcSubBlock.h.

251 {
252  return (m_header >> s_formatBit) & s_formatMask;
253 }

◆ format() [2/2]

int ZdcSubBlock::format ( uint32_t  word)
static

Return data format from given header word.

Definition at line 441 of file ZdcSubBlock.cxx.

442 {
443  return (word >> s_formatBit) & s_formatMask;
444 }

◆ glinkDown()

bool ZdcSubBlock::glinkDown ( ) const
inline

Definition at line 295 of file ZdcSubBlock.h.

296 {
297  return m_trailer & (0x1 << s_glinkDownBit);
298 }

◆ glinkParity()

bool ZdcSubBlock::glinkParity ( ) const
inline

Definition at line 320 of file ZdcSubBlock.h.

321 {
322  return m_trailer & (0x1 << s_glinkParityBit);
323 }

◆ glinkProtocol()

bool ZdcSubBlock::glinkProtocol ( ) const
inline

Definition at line 315 of file ZdcSubBlock.h.

316 {
317  return m_trailer & (0x1 << s_glinkProtocolBit);
318 }

◆ glinkTimeout()

bool ZdcSubBlock::glinkTimeout ( ) const
inline

Definition at line 290 of file ZdcSubBlock.h.

291 {
292  return m_trailer & (0x1 << s_glinkTimeoutBit);
293 }

◆ minBits()

int ZdcSubBlock::minBits ( uint32_t  datum)
static

Return the minimum number of bits needed for given data.

Definition at line 245 of file ZdcSubBlock.cxx.

246 {
247  const int maxBits = 32;
248  int nbits = maxBits;
249  for (int i = 0; i < maxBits; ++i) {
250  if ( !(datum >> i)) {
251  nbits = i;
252  break;
253  }
254  }
255  return nbits;
256 }

◆ module() [1/2]

int ZdcSubBlock::module ( ) const
inline

Definition at line 270 of file ZdcSubBlock.h.

271 {
272  return (m_header >> s_moduleBit) & s_moduleMask;
273 }

◆ module() [2/2]

int ZdcSubBlock::module ( uint32_t  word)
static

Return module field from given header word.

Definition at line 455 of file ZdcSubBlock.cxx.

456 {
457  return (word >> s_moduleBit) & s_moduleMask;
458 }

◆ packer()

void ZdcSubBlock::packer ( uint32_t  datum,
int  nbits 
)

Pack given data into given number of bits.

Definition at line 271 of file ZdcSubBlock.cxx.

272 {
273  if (nbits > 0) {
274  uint32_t mask = 0x1;
275  for (int i = 1; i < nbits; ++i) mask |= (mask << 1);
276  m_bitword |= (datum & mask) << m_currentBit;
277  m_currentBit += nbits;
278  if (m_currentBit >= m_maxBits) {
279  m_bitword &= m_maxMask;
280  m_data.push_back(m_bitword);
281  ++m_dataWords;
282  const int bitsLeft = m_currentBit - m_maxBits;
283  if (bitsLeft > 0) {
284  m_bitword = (datum & mask) >> (nbits - bitsLeft);
285  m_currentBit = bitsLeft;
286  } else {
287  m_bitword = 0;
288  m_currentBit = 0;
289  }
290  }
291  }
292 }

◆ packerFlush()

void ZdcSubBlock::packerFlush ( )

Flush the current data word padded with zeros.

Definition at line 296 of file ZdcSubBlock.cxx.

297 {
298  if (m_currentBit > 0) {
299  m_bitword &= m_maxMask;
300  m_data.push_back(m_bitword);
301  ++m_dataWords;
302  m_bitword = 0;
303  m_currentBit = 0;
304  }
305 }

◆ packerNeutral()

void ZdcSubBlock::packerNeutral ( int  pin,
uint32_t  datum,
int  nbits 
)

Pack given neutral data from given pin.

Definition at line 364 of file ZdcSubBlock.cxx.

366 {
367  if (pin >= 0 && pin < s_maxPins && nbits > 0) {
368  if (m_currentPinBit[pin] + nbits > m_dataWords) {
369  m_dataWords = m_currentPinBit[pin] + nbits;
371  }
372  for (int bit = 0; bit < nbits; ++bit) {
373  m_data[m_currentPinBit[pin] + bit] |= ((datum >> bit) & 0x1) << pin;
374  }
375  m_currentPinBit[pin] += nbits;
376  m_oddParity[pin] = parityBit(m_oddParity[pin], datum, nbits);
377  }
378 }

◆ packerNeutralParity()

void ZdcSubBlock::packerNeutralParity ( int  pin)

Pack current G-Link parity bit for given pin.

Definition at line 382 of file ZdcSubBlock.cxx.

383 {
384  if (pin >= 0 && pin < s_maxPins) {
385  packerNeutral(pin, m_oddParity[pin], 1);
386  m_oddParity[pin] = 1;
387  }
388 }

◆ parityBit()

int ZdcSubBlock::parityBit ( int  init,
uint32_t  datum,
int  nbits 
)
static

Return the parity bit for given data.

Definition at line 260 of file ZdcSubBlock.cxx.

262 {
263  // set init to 0/1 for even/odd parity
264  int parity = init;
265  for (int bit = 0; bit < nbits; ++bit) parity ^= (datum >> bit) & 0x1;
266  return parity;
267 }

◆ read()

Input complete packed sub-block from ROD array.

Definition at line 121 of file ZdcSubBlock.cxx.

124 {
125  m_dataWords = 0;
126  m_unpackerFlag = true;
129  for (; pos != pose; ++pos) {
130  const uint32_t word = *pos;
131  const SubBlockWordType type = wordType(word);
132  if (type == HEADER) {
133  if (m_header) return pos;
134  m_header = word;
135  }
136  else if (type == STATUS) m_trailer = word;
137  else {
138  m_data.push_back(word);
139  ++m_dataWords;
140  }
141  }
142  return pose;
143 }

◆ seqno() [1/2]

int ZdcSubBlock::seqno ( ) const
inline

Definition at line 255 of file ZdcSubBlock.h.

256 {
257  return (m_header >> s_seqnoBit) & s_seqnoMask;
258 }

◆ seqno() [2/2]

int ZdcSubBlock::seqno ( uint32_t  word)
static

Return seqno field from given header word.

Definition at line 448 of file ZdcSubBlock.cxx.

449 {
450  return (word >> s_seqnoBit) & s_seqnoMask;
451 }

◆ setBunchCrossing()

void ZdcSubBlock::setBunchCrossing ( int  bc)
inline

Set the Bunch Crossing number (neutral format only)

Definition at line 330 of file ZdcSubBlock.h.

331 {
332  if (bc) m_bunchCrossing = bc;
333 }

◆ setDaqOverflow()

void ZdcSubBlock::setDaqOverflow ( int  bit = 1)

Set DAQ FIFO Overflow bit in Sub-status word.

Definition at line 186 of file ZdcSubBlock.cxx.

187 {
188  if (bit) {
189  if (m_trailer) m_trailer |= (1 << s_daqOverflowBit);
190  else setStatus(0, false, false, false, true, false, false, false);
191  }
192 }

◆ setGlinkParity()

void ZdcSubBlock::setGlinkParity ( int  bit = 1)

Set G-Link Parity bit in Sub-status word.

Definition at line 196 of file ZdcSubBlock.cxx.

197 {
198  if (bit) {
199  if (m_trailer) m_trailer |= (1 << s_glinkParityBit);
200  else setStatus(0, false, false, false, false, false, false, true);
201  }
202 }

◆ setHeader()

void ZdcSubBlock::setHeader ( int  wordId,
int  version,
int  format,
int  seqno,
int  crate,
int  module,
int  slices2,
int  slices1 
)

Store header data.

Definition at line 102 of file ZdcSubBlock.cxx.

106 {
107  uint32_t word = 0;
108  word |= (wordId & s_wordIdMask) << s_wordIdBit;
109  word |= (version & s_versionMask) << s_versionBit;
110  word |= (format & s_formatMask) << s_formatBit;
111  word |= (seqno & s_seqnoMask) << s_seqnoBit;
112  word |= (crate & s_crateMask) << s_crateBit;
113  word |= (module & s_moduleMask) << s_moduleBit;
114  word |= (slices2 & s_slices2Mask) << s_slices2Bit;
115  word |= (slices1 & s_slices1Mask) << s_slices1Bit;
116  m_header = word;
117 }

◆ setStatus()

void ZdcSubBlock::setStatus ( uint32_t  failingBCN,
bool  glinkTimeout,
bool  glinkDown,
bool  upstreamError,
bool  daqOverflow,
bool  bcnMismatch,
bool  glinkProtocol,
bool  glinkParity 
)

Store error status trailer.

Definition at line 160 of file ZdcSubBlock.cxx.

164 {
165  uint32_t word = 0;
167  word |= glinkTimeout << s_glinkTimeoutBit;
168  word |= glinkDown << s_glinkDownBit;
170  word |= daqOverflow << s_daqOverflowBit;
171  word |= bcnMismatch << s_bcnMismatchBit;
173  word |= glinkParity << s_glinkParityBit;
174  if (word) {
175  word |= (wordId() & s_wordIdMask) << s_wordIdBit;
176  word |= (s_statusVal & s_statusMask) << s_statusBit;
177  word |= (seqno() & s_seqnoMask) << s_seqnoBit;
178  word |= (crate() & s_crateMask) << s_crateBit;
179  word |= (module() & s_moduleMask) << s_moduleBit;
180  }
181  m_trailer = word;
182 }

◆ setStreamed()

void ZdcSubBlock::setStreamed ( )
inline

Set continuous bit streaming for compressed formats.

Definition at line 350 of file ZdcSubBlock.h.

351 {
354 }

◆ setUnpackErrorCode()

void ZdcSubBlock::setUnpackErrorCode ( int  code)
inline

Set the unpacking error code.

Definition at line 340 of file ZdcSubBlock.h.

341 {
343 }

◆ slice()

int ZdcSubBlock::slice ( ) const
inline

Definition at line 260 of file ZdcSubBlock.h.

261 {
262  return seqno();
263 }

◆ slices1()

int ZdcSubBlock::slices1 ( ) const
inline

Definition at line 280 of file ZdcSubBlock.h.

281 {
282  return (m_header >> s_slices1Bit) & s_slices1Mask;
283 }

◆ slices2()

int ZdcSubBlock::slices2 ( ) const
inline

Definition at line 275 of file ZdcSubBlock.h.

276 {
277  return (m_header >> s_slices2Bit) & s_slices2Mask;
278 }

◆ subStatus()

uint32_t ZdcSubBlock::subStatus ( ) const
inline

Return Sub-status word.

Definition at line 325 of file ZdcSubBlock.h.

326 {
327  return m_trailer;
328 }

◆ unpacker()

uint32_t ZdcSubBlock::unpacker ( int  nbits)

Unpack given number of bits of data.

Definition at line 309 of file ZdcSubBlock.cxx.

310 {
311  uint32_t word = 0;
312  if (nbits > 0) {
313  if (m_dataPos == m_dataPosEnd) {
314  m_unpackerFlag = false;
315  return 0;
316  }
317  int nbitsDone = nbits;
318  if (nbitsDone > m_maxBits - m_currentBit) {
319  nbitsDone = m_maxBits - m_currentBit;
320  }
321  uint32_t mask = 0x1;
322  for (int i = 1; i < nbitsDone; ++i) mask |= (mask << 1);
323  word = (m_bitword >> m_currentBit) & mask;
324  m_currentBit += nbits;
325  if (m_currentBit >= m_maxBits) {
326  m_bitword = 0;
327  if (m_dataPos != m_dataPosEnd) {
328  ++m_dataPos;
329  if (m_dataPos != m_dataPosEnd) {
330  m_bitword = *m_dataPos;
331  }
332  }
333  m_currentBit = 0;
334  const int bitsLeft = nbits - nbitsDone;
335  if (bitsLeft > 0) {
336  if (m_dataPos == m_dataPosEnd) {
337  m_unpackerFlag = false;
338  return word;
339  }
340  mask = 0x1;
341  for (int i = 1; i < bitsLeft; ++i) mask |= (mask << 1);
342  word |= (m_bitword & mask) << nbitsDone;
343  m_currentBit = bitsLeft;
344  }
345  }
346  }
347  return word;
348 }

◆ unpackerInit()

void ZdcSubBlock::unpackerInit ( )

Initialise unpacker.

Definition at line 352 of file ZdcSubBlock.cxx.

353 {
354  m_bitword = 0;
355  m_currentBit = 0;
356  m_unpackerFlag = true;
357  m_dataPos = m_data.begin();
358  m_dataPosEnd = m_data.end();
360 }

◆ unpackerNeutral()

uint32_t ZdcSubBlock::unpackerNeutral ( int  pin,
int  nbits 
)

Unpack given number of bits of neutral data for given pin.

Definition at line 392 of file ZdcSubBlock.cxx.

393 {
394  uint32_t word = 0;
395  if (pin >= 0 && pin < s_maxPins && nbits > 0
396  && m_currentPinBit[pin] + nbits <= m_dataWords) {
397  for (int bit = 0; bit < nbits; ++bit) {
398  word |= ((m_data[m_currentPinBit[pin] + bit] >> pin) & 0x1) << bit;
399  }
400  m_currentPinBit[pin] += nbits;
401  m_oddParity[pin] = parityBit(m_oddParity[pin], word, nbits);
402  } else m_unpackerFlag = false;
403  return word;
404 }

◆ unpackerNeutralParityError()

bool ZdcSubBlock::unpackerNeutralParityError ( int  pin)

Unpack and test G-Link parity bit for given pin.

Definition at line 408 of file ZdcSubBlock.cxx.

409 {
410  bool error = true;
411  if (pin >= 0 && pin < s_maxPins) {
412  int parity = m_oddParity[pin];
413  int bit = unpackerNeutral(pin, 1);
414  m_oddParity[pin] = 1;
415  error = !(bit == parity);
416  }
417  return error;
418 }

◆ unpackErrorCode()

int ZdcSubBlock::unpackErrorCode ( ) const
inline

Return the unpacking error code.

Definition at line 345 of file ZdcSubBlock.h.

346 {
347  return m_unpackError;
348 }

◆ unpackErrorMsg()

std::string ZdcSubBlock::unpackErrorMsg ( ) const

Return the unpacking error message for printing.

Definition at line 206 of file ZdcSubBlock.cxx.

207 {
208  std::string msg;
209  switch (m_unpackError) {
210  case UNPACK_NONE:
211  msg = "No error";
212  break;
213  case UNPACK_VERSION:
214  msg = "Unsupported Data Version";
215  break;
216  case UNPACK_FORMAT:
217  msg = "Unsupported Data Format";
218  break;
220  msg = "Unsupported Compression Version";
221  break;
223  msg = "Unsupported Number of Slices for Compression Version";
224  break;
226  msg = "Premature End of Sub-block Data";
227  break;
228  case UNPACK_SOURCE_ID:
229  msg = "Invalid Source ID in Sub-block Data";
230  break;
231  case UNPACK_WORD_ID:
232  msg = "Invalid Word ID in Sub-block Data";
233  break;
234  default:
235  msg = "Unknown Error Code";
236  break;
237  }
238  return msg;
239 }

◆ unpackerSuccess()

bool ZdcSubBlock::unpackerSuccess ( ) const
inline

Return unpacker success flag.

Definition at line 356 of file ZdcSubBlock.h.

357 {
358  return m_unpackerFlag;
359 }

◆ upstreamError()

bool ZdcSubBlock::upstreamError ( ) const
inline

Definition at line 300 of file ZdcSubBlock.h.

301 {
302  return m_trailer & (0x1 << s_upstreamErrorBit);
303 }

◆ version()

int ZdcSubBlock::version ( ) const
inline

Definition at line 245 of file ZdcSubBlock.h.

246 {
247  return (m_header >> s_versionBit) & s_versionMask;
248 }

◆ wordId() [1/2]

int ZdcSubBlock::wordId ( ) const
inline

Definition at line 240 of file ZdcSubBlock.h.

241 {
242  return (m_header >> s_wordIdBit) & s_wordIdMask;
243 }

◆ wordId() [2/2]

int ZdcSubBlock::wordId ( uint32_t  word)
static

Return wordID field from given header word.

Definition at line 434 of file ZdcSubBlock.cxx.

435 {
436  return (word >> s_wordIdBit) & s_wordIdMask;
437 }

◆ wordType()

ZdcSubBlock::SubBlockWordType ZdcSubBlock::wordType ( uint32_t  word)
static

Word identification.

Definition at line 422 of file ZdcSubBlock.cxx.

423 {
425  if (((word >> s_headerBit) & s_headerMask) == s_headerVal) {
426  if (((word >> s_statusBit) & s_statusMask) == s_statusVal) type = STATUS;
427  else type = HEADER;
428  }
429  return type;
430 }

◆ write()

void ZdcSubBlock::write ( FullEventAssembler< ZdcSrcIdMap >::RODDATA *  theROD) const

Output complete packed sub-block to ROD vector.

Definition at line 147 of file ZdcSubBlock.cxx.

149 {
150  theROD->push_back(m_header);
151  std::vector<uint32_t>::const_iterator pos;
152  for (pos = m_data.begin(); pos != m_data.end(); ++pos) {
153  theROD->push_back(*pos);
154  }
155  if (m_trailer) theROD->push_back(m_trailer);
156 }

Member Data Documentation

◆ m_bitword

uint32_t ZdcSubBlock::m_bitword
private

Definition at line 218 of file ZdcSubBlock.h.

◆ m_bunchCrossing

int ZdcSubBlock::m_bunchCrossing
private

Bunch Crossing number (neutral format only)

Definition at line 214 of file ZdcSubBlock.h.

◆ m_currentBit

int ZdcSubBlock::m_currentBit
private

Definition at line 219 of file ZdcSubBlock.h.

◆ m_currentPinBit

std::vector<int> ZdcSubBlock::m_currentPinBit
private

Definition at line 226 of file ZdcSubBlock.h.

◆ m_data

std::vector<uint32_t> ZdcSubBlock::m_data
private

Sub-Block data.

Definition at line 231 of file ZdcSubBlock.h.

◆ m_dataPos

std::vector<uint32_t>::const_iterator ZdcSubBlock::m_dataPos
private

Definition at line 223 of file ZdcSubBlock.h.

◆ m_dataPosEnd

std::vector<uint32_t>::const_iterator ZdcSubBlock::m_dataPosEnd
private

Definition at line 224 of file ZdcSubBlock.h.

◆ m_dataWords

int ZdcSubBlock::m_dataWords
private

Current number of data words.

Definition at line 229 of file ZdcSubBlock.h.

◆ m_header

uint32_t ZdcSubBlock::m_header
private

Sub-Block Header.

Definition at line 210 of file ZdcSubBlock.h.

◆ m_maxBits

int ZdcSubBlock::m_maxBits
private

Definition at line 220 of file ZdcSubBlock.h.

◆ m_maxMask

uint32_t ZdcSubBlock::m_maxMask
private

Definition at line 221 of file ZdcSubBlock.h.

◆ m_oddParity

std::vector<int> ZdcSubBlock::m_oddParity
private

Definition at line 227 of file ZdcSubBlock.h.

◆ m_trailer

uint32_t ZdcSubBlock::m_trailer
private

Sub-Block Status Trailer.

Definition at line 212 of file ZdcSubBlock.h.

◆ m_unpackerFlag

bool ZdcSubBlock::m_unpackerFlag
private

Definition at line 222 of file ZdcSubBlock.h.

◆ m_unpackError

int ZdcSubBlock::m_unpackError
private

Unpacking error code.

Definition at line 216 of file ZdcSubBlock.h.

◆ s_bcnMismatchBit

const int ZdcSubBlock::s_bcnMismatchBit = 2
staticprivate

Definition at line 196 of file ZdcSubBlock.h.

◆ s_crateBit

const int ZdcSubBlock::s_crateBit = 12
staticprivate

Definition at line 178 of file ZdcSubBlock.h.

◆ s_crateMask

const uint32_t ZdcSubBlock::s_crateMask = 0xf
staticprivate

Definition at line 186 of file ZdcSubBlock.h.

◆ s_daqOverflowBit

const int ZdcSubBlock::s_daqOverflowBit = 3
staticprivate

Definition at line 195 of file ZdcSubBlock.h.

◆ s_failingBcnBit

const int ZdcSubBlock::s_failingBcnBit = 22
staticprivate

Definition at line 191 of file ZdcSubBlock.h.

◆ s_failingBcnMask

const uint32_t ZdcSubBlock::s_failingBcnMask = 0x3f
staticprivate

Definition at line 199 of file ZdcSubBlock.h.

◆ s_formatBit

const int ZdcSubBlock::s_formatBit = 22
staticprivate

Definition at line 176 of file ZdcSubBlock.h.

◆ s_formatMask

const uint32_t ZdcSubBlock::s_formatMask = 0x7
staticprivate

Definition at line 184 of file ZdcSubBlock.h.

◆ s_glinkDavSet

const uint32_t ZdcSubBlock::s_glinkDavSet = 0x400000
staticprivate

Definition at line 207 of file ZdcSubBlock.h.

◆ s_glinkDownBit

const int ZdcSubBlock::s_glinkDownBit = 6
staticprivate

Definition at line 193 of file ZdcSubBlock.h.

◆ s_glinkParityBit

const int ZdcSubBlock::s_glinkParityBit = 0
staticprivate

Definition at line 198 of file ZdcSubBlock.h.

◆ s_glinkProtocolBit

const int ZdcSubBlock::s_glinkProtocolBit = 1
staticprivate

Definition at line 197 of file ZdcSubBlock.h.

◆ s_glinkTimeoutBit

const int ZdcSubBlock::s_glinkTimeoutBit = 7
staticprivate

Definition at line 192 of file ZdcSubBlock.h.

◆ s_headerBit

const int ZdcSubBlock::s_headerBit = 30
staticprivate

ZdcSubBlock.cxx this is a base class derived (copyed) from LVL1 I do not think we need this this way; either implement directly on PpmSubBlock or link to LVL1.

TRY_LINK_LVL1

Marco Leite 27 May 2009

Definition at line 167 of file ZdcSubBlock.h.

◆ s_headerMask

const uint32_t ZdcSubBlock::s_headerMask = 0x3
staticprivate

Definition at line 169 of file ZdcSubBlock.h.

◆ s_headerVal

const uint32_t ZdcSubBlock::s_headerVal = 0x3
staticprivate

Definition at line 171 of file ZdcSubBlock.h.

◆ s_maxPins

const int ZdcSubBlock::s_maxPins = 20
staticprivate

Definition at line 206 of file ZdcSubBlock.h.

◆ s_maxStreamedBits

const int ZdcSubBlock::s_maxStreamedBits = 31
staticprivate

Definition at line 202 of file ZdcSubBlock.h.

◆ s_maxStreamedMask

const uint32_t ZdcSubBlock::s_maxStreamedMask = 0x7fffffff
staticprivate

Definition at line 204 of file ZdcSubBlock.h.

◆ s_maxWordBits

const int ZdcSubBlock::s_maxWordBits = 32
staticprivate

Definition at line 201 of file ZdcSubBlock.h.

◆ s_maxWordMask

const uint32_t ZdcSubBlock::s_maxWordMask = 0xffffffff
staticprivate

Definition at line 203 of file ZdcSubBlock.h.

◆ s_moduleBit

const int ZdcSubBlock::s_moduleBit = 8
staticprivate

Definition at line 179 of file ZdcSubBlock.h.

◆ s_moduleMask

const uint32_t ZdcSubBlock::s_moduleMask = 0xf
staticprivate

Definition at line 187 of file ZdcSubBlock.h.

◆ s_seqnoBit

const int ZdcSubBlock::s_seqnoBit = 16
staticprivate

Definition at line 177 of file ZdcSubBlock.h.

◆ s_seqnoMask

const uint32_t ZdcSubBlock::s_seqnoMask = 0x3f
staticprivate

Definition at line 185 of file ZdcSubBlock.h.

◆ s_slices1Bit

const int ZdcSubBlock::s_slices1Bit = 0
staticprivate

Definition at line 181 of file ZdcSubBlock.h.

◆ s_slices1Mask

const uint32_t ZdcSubBlock::s_slices1Mask = 0x7
staticprivate

Definition at line 189 of file ZdcSubBlock.h.

◆ s_slices2Bit

const int ZdcSubBlock::s_slices2Bit = 3
staticprivate

Definition at line 180 of file ZdcSubBlock.h.

◆ s_slices2Mask

const uint32_t ZdcSubBlock::s_slices2Mask = 0x1f
staticprivate

Definition at line 188 of file ZdcSubBlock.h.

◆ s_statusBit

const int ZdcSubBlock::s_statusBit = 28
staticprivate

Definition at line 168 of file ZdcSubBlock.h.

◆ s_statusMask

const uint32_t ZdcSubBlock::s_statusMask = 0x1
staticprivate

Definition at line 170 of file ZdcSubBlock.h.

◆ s_statusVal

const uint32_t ZdcSubBlock::s_statusVal = 0x1
staticprivate

Definition at line 172 of file ZdcSubBlock.h.

◆ s_upstreamErrorBit

const int ZdcSubBlock::s_upstreamErrorBit = 4
staticprivate

Definition at line 194 of file ZdcSubBlock.h.

◆ s_versionBit

const int ZdcSubBlock::s_versionBit = 25
staticprivate

Definition at line 175 of file ZdcSubBlock.h.

◆ s_versionMask

const uint32_t ZdcSubBlock::s_versionMask = 0x7
staticprivate

Definition at line 183 of file ZdcSubBlock.h.

◆ s_wordIdBit

const int ZdcSubBlock::s_wordIdBit = 28
staticprivate

Definition at line 174 of file ZdcSubBlock.h.

◆ s_wordIdMask

const uint32_t ZdcSubBlock::s_wordIdMask = 0xf
staticprivate

Definition at line 182 of file ZdcSubBlock.h.


The documentation for this class was generated from the following files:
ZdcSubBlock::m_trailer
uint32_t m_trailer
Sub-Block Status Trailer.
Definition: ZdcSubBlock.h:212
ZdcSubBlock::glinkTimeout
bool glinkTimeout() const
Definition: ZdcSubBlock.h:290
ZdcSubBlock::m_data
std::vector< uint32_t > m_data
Sub-Block data.
Definition: ZdcSubBlock.h:231
ZdcSubBlock::DATA
@ DATA
Definition: ZdcSubBlock.h:38
ZdcSubBlock::NEUTRAL
@ NEUTRAL
Definition: ZdcSubBlock.h:41
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
ZdcSubBlock::bcnMismatch
bool bcnMismatch() const
Definition: ZdcSubBlock.h:310
ZdcSubBlock::glinkProtocol
bool glinkProtocol() const
Definition: ZdcSubBlock.h:315
ZdcSubBlock::m_dataPosEnd
std::vector< uint32_t >::const_iterator m_dataPosEnd
Definition: ZdcSubBlock.h:224
ZdcSubBlock::s_seqnoMask
static const uint32_t s_seqnoMask
Definition: ZdcSubBlock.h:185
ZdcSubBlock::s_glinkDavSet
static const uint32_t s_glinkDavSet
Definition: ZdcSubBlock.h:207
ZdcSubBlock::s_wordIdBit
static const int s_wordIdBit
Definition: ZdcSubBlock.h:174
ZdcSubBlock::unpackerNeutral
uint32_t unpackerNeutral(int pin, int nbits)
Unpack given number of bits of neutral data for given pin.
Definition: ZdcSubBlock.cxx:392
ZdcSubBlock::m_bunchCrossing
int m_bunchCrossing
Bunch Crossing number (neutral format only)
Definition: ZdcSubBlock.h:214
ZdcSubBlock::SUPERCOMPRESSED
@ SUPERCOMPRESSED
Definition: ZdcSubBlock.h:44
ZdcSubBlock::UNPACK_DATA_TRUNCATED
@ UNPACK_DATA_TRUNCATED
Definition: ZdcSubBlock.h:51
ZdcSubBlock::wordId
int wordId() const
Definition: ZdcSubBlock.h:240
ZdcSubBlock::s_formatBit
static const int s_formatBit
Definition: ZdcSubBlock.h:176
ZdcSubBlock::s_maxStreamedBits
static const int s_maxStreamedBits
Definition: ZdcSubBlock.h:202
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ZdcSubBlock::m_maxBits
int m_maxBits
Definition: ZdcSubBlock.h:220
ZdcSubBlock::s_maxStreamedMask
static const uint32_t s_maxStreamedMask
Definition: ZdcSubBlock.h:204
ZdcSubBlock::s_upstreamErrorBit
static const int s_upstreamErrorBit
Definition: ZdcSubBlock.h:194
ZdcSubBlock::s_maxWordMask
static const uint32_t s_maxWordMask
Definition: ZdcSubBlock.h:203
ZdcSubBlock::m_currentBit
int m_currentBit
Definition: ZdcSubBlock.h:219
ZdcSubBlock::UNPACK_FORMAT
@ UNPACK_FORMAT
Definition: ZdcSubBlock.h:48
ZdcSubBlock::upstreamError
bool upstreamError() const
Definition: ZdcSubBlock.h:300
ZdcSubBlock::slices1
int slices1() const
Definition: ZdcSubBlock.h:280
ZdcSubBlock::glinkParity
bool glinkParity() const
Definition: ZdcSubBlock.h:320
ZdcSubBlock::s_statusMask
static const uint32_t s_statusMask
Definition: ZdcSubBlock.h:170
ZdcSubBlock::s_statusBit
static const int s_statusBit
Definition: ZdcSubBlock.h:168
ZdcSubBlock::m_oddParity
std::vector< int > m_oddParity
Definition: ZdcSubBlock.h:227
ZdcSubBlock::s_glinkTimeoutBit
static const int s_glinkTimeoutBit
Definition: ZdcSubBlock.h:192
ZdcSubBlock::m_dataWords
int m_dataWords
Current number of data words.
Definition: ZdcSubBlock.h:229
ZdcSubBlock::seqno
int seqno() const
Definition: ZdcSubBlock.h:255
ZdcSubBlock::m_currentPinBit
std::vector< int > m_currentPinBit
Definition: ZdcSubBlock.h:226
ZdcSubBlock::COMPRESSED
@ COMPRESSED
Definition: ZdcSubBlock.h:43
ZdcSubBlock::s_glinkParityBit
static const int s_glinkParityBit
Definition: ZdcSubBlock.h:198
ZdcSubBlock::UNPACK_WORD_ID
@ UNPACK_WORD_ID
Definition: ZdcSubBlock.h:53
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
ZdcSubBlock::m_bitword
uint32_t m_bitword
Definition: ZdcSubBlock.h:218
ZdcSubBlock::s_slices1Bit
static const int s_slices1Bit
Definition: ZdcSubBlock.h:181
ZdcSubBlock::wordType
static SubBlockWordType wordType(uint32_t word)
Word identification.
Definition: ZdcSubBlock.cxx:422
ZdcSubBlock::crate
int crate() const
Definition: ZdcSubBlock.h:265
ZdcSubBlock::STATUS
@ STATUS
Definition: ZdcSubBlock.h:39
ZdcSubBlock::s_crateMask
static const uint32_t s_crateMask
Definition: ZdcSubBlock.h:186
ZdcSubBlock::version
int version() const
Definition: ZdcSubBlock.h:245
ZdcSubBlock::s_versionMask
static const uint32_t s_versionMask
Definition: ZdcSubBlock.h:183
ZdcSubBlock::s_versionBit
static const int s_versionBit
Definition: ZdcSubBlock.h:175
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
ZdcSubBlock::s_failingBcnMask
static const uint32_t s_failingBcnMask
Definition: ZdcSubBlock.h:199
ZdcSubBlock::m_header
uint32_t m_header
Sub-Block Header.
Definition: ZdcSubBlock.h:210
ZdcSubBlock::format
int format() const
Definition: ZdcSubBlock.h:250
lumiFormat.i
int i
Definition: lumiFormat.py:92
ZdcSubBlock::UNPACK_COMPRESSION_VERSION
@ UNPACK_COMPRESSION_VERSION
Definition: ZdcSubBlock.h:49
ZdcSubBlock::HEADER
@ HEADER
Definition: ZdcSubBlock.h:37
ZdcSubBlock::s_headerVal
static const uint32_t s_headerVal
Definition: ZdcSubBlock.h:171
ZdcSubBlock::s_bcnMismatchBit
static const int s_bcnMismatchBit
Definition: ZdcSubBlock.h:196
ZdcSubBlock::m_maxMask
uint32_t m_maxMask
Definition: ZdcSubBlock.h:221
ZdcSubBlock::setStatus
void setStatus(uint32_t failingBCN, bool glinkTimeout, bool glinkDown, bool upstreamError, bool daqOverflow, bool bcnMismatch, bool glinkProtocol, bool glinkParity)
Store error status trailer.
Definition: ZdcSubBlock.cxx:160
ZdcSubBlock::s_statusVal
static const uint32_t s_statusVal
Definition: ZdcSubBlock.h:172
ZdcSubBlock::m_unpackError
int m_unpackError
Unpacking error code.
Definition: ZdcSubBlock.h:216
ZdcSubBlock::UNPACK_COMPRESSION_SLICES
@ UNPACK_COMPRESSION_SLICES
Definition: ZdcSubBlock.h:50
ZdcSubBlock::s_slices2Bit
static const int s_slices2Bit
Definition: ZdcSubBlock.h:180
ZdcSubBlock::s_glinkProtocolBit
static const int s_glinkProtocolBit
Definition: ZdcSubBlock.h:197
ZdcSubBlock::slices2
int slices2() const
Definition: ZdcSubBlock.h:275
ZdcSubBlock::daqOverflow
bool daqOverflow() const
Definition: ZdcSubBlock.h:305
ZdcSubBlock::s_crateBit
static const int s_crateBit
Definition: ZdcSubBlock.h:178
ZdcSubBlock::s_maxPins
static const int s_maxPins
Definition: ZdcSubBlock.h:206
ZdcSubBlock::UNPACK_VERSION
@ UNPACK_VERSION
Definition: ZdcSubBlock.h:47
pmontree.code
code
Definition: pmontree.py:443
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
ZdcSubBlock::UNCOMPRESSED
@ UNCOMPRESSED
Definition: ZdcSubBlock.h:42
ZdcSubBlock::packerNeutral
void packerNeutral(int pin, uint32_t datum, int nbits)
Pack given neutral data from given pin.
Definition: ZdcSubBlock.cxx:364
ZdcSubBlock::SubBlockWordType
SubBlockWordType
Definition: ZdcSubBlock.h:37
ZdcSubBlock::failingBCN
uint32_t failingBCN() const
Definition: ZdcSubBlock.h:285
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
ZdcSubBlock::UNPACK_SOURCE_ID
@ UNPACK_SOURCE_ID
Definition: ZdcSubBlock.h:52
ZdcSubBlock::UNPACK_NONE
@ UNPACK_NONE
Definition: ZdcSubBlock.h:46
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ZdcSubBlock::s_headerBit
static const int s_headerBit
ZdcSubBlock.cxx this is a base class derived (copyed) from LVL1 I do not think we need this this way;...
Definition: ZdcSubBlock.h:167
ZdcSubBlock::s_daqOverflowBit
static const int s_daqOverflowBit
Definition: ZdcSubBlock.h:195
ZdcSubBlock::module
int module() const
Definition: ZdcSubBlock.h:270
ZdcSubBlock::s_slices2Mask
static const uint32_t s_slices2Mask
Definition: ZdcSubBlock.h:188
ZdcSubBlock::glinkDown
bool glinkDown() const
Definition: ZdcSubBlock.h:295
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ZdcSubBlock::s_moduleMask
static const uint32_t s_moduleMask
Definition: ZdcSubBlock.h:187
ZdcSubBlock::s_maxWordBits
static const int s_maxWordBits
Definition: ZdcSubBlock.h:201
ZdcSubBlock::s_slices1Mask
static const uint32_t s_slices1Mask
Definition: ZdcSubBlock.h:189
ZdcSubBlock::s_moduleBit
static const int s_moduleBit
Definition: ZdcSubBlock.h:179
ZdcSubBlock::m_dataPos
std::vector< uint32_t >::const_iterator m_dataPos
Definition: ZdcSubBlock.h:223
ZdcSubBlock::s_glinkDownBit
static const int s_glinkDownBit
Definition: ZdcSubBlock.h:193
ZdcSubBlock::m_unpackerFlag
bool m_unpackerFlag
Definition: ZdcSubBlock.h:222
get_generator_info.error
error
Definition: get_generator_info.py:40
ZdcSubBlock::parityBit
static int parityBit(int init, uint32_t datum, int nbits)
Return the parity bit for given data.
Definition: ZdcSubBlock.cxx:260
ZdcSubBlock::s_formatMask
static const uint32_t s_formatMask
Definition: ZdcSubBlock.h:184
ZdcSubBlock::s_seqnoBit
static const int s_seqnoBit
Definition: ZdcSubBlock.h:177
error
Definition: IImpactPoint3dEstimator.h:70
ZdcSubBlock::s_wordIdMask
static const uint32_t s_wordIdMask
Definition: ZdcSubBlock.h:182
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
ZdcSubBlock::s_failingBcnBit
static const int s_failingBcnBit
Definition: ZdcSubBlock.h:191
ZdcSubBlock::s_headerMask
static const uint32_t s_headerMask
Definition: ZdcSubBlock.h:169