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

Sub-Block class for PPM data. More...

#include <ZdcPpmSubBlock.h>

Inheritance diagram for ZdcPpmSubBlock:
Collaboration diagram for ZdcPpmSubBlock:

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

 ZdcPpmSubBlock ()
 
 ~ZdcPpmSubBlock ()
 
void clear ()
 Clear all data. More...
 
void setPpmHeader (int version, int format, int seqno, int crate, int module, int slicesFadc, int slicesLut)
 Store PPM header. More...
 
void setPpmErrorHeader (int version, int format, int crate, int module, int slicesFadc, int slicesLut)
 Store PPM error block header. More...
 
int slicesFadc () const
 
int slicesLut () const
 
void fillPpmData (int chan, const std::vector< int > &lut, const std::vector< int > &fadc, const std::vector< int > &bcidLut, const std::vector< int > &bcidFadc)
 Store PPM data for later packing. More...
 
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. More...
 
void fillPpmError (int chan, int errorWord)
 Store an error word corresponding to a data channel. More...
 
void fillPpmPinError (int pin, int errorWord)
 Store an error word corresponding to a G-Link pin. More...
 
int ppmError (int chan) const
 Return the error word for a data channel. More...
 
int ppmPinError (int pin) const
 Return the error word for a G-Link pin. More...
 
bool glinkPinParity (int chan) const
 
bool fpgaCorrupt (int chan) const
 
bool bunchMismatch (int chan) const
 
bool eventMismatch (int chan) const
 
bool asicFull (int chan) const
 
bool timeout (int chan) const
 
bool mcmAbsent (int chan) const
 
bool channelDisabled (int chan) const
 
bool channelDisabledA (int pin) const
 
bool channelDisabledB (int pin) const
 
bool channelDisabledC (int pin) const
 
bool channelDisabledD (int pin) const
 
bool glinkPinParity () const
 
bool fpgaCorrupt () const
 
bool bunchMismatch () const
 
bool eventMismatch () const
 
bool asicFull () const
 
bool timeout () const
 
bool mcmAbsent () const
 
bool channelDisabledA () const
 
bool channelDisabledB () const
 
bool channelDisabledC () const
 
bool channelDisabledD () const
 
void setLutOffset (int offset)
 
void setFadcOffset (int offset)
 
void setPedestal (int pedval)
 
void setFadcBaseline (int baseline)
 
void setFadcThreshold (int threshold)
 
void setRunNumber (int run)
 
int lutOffset () const
 
int fadcOffset () const
 
int pedestal () const
 
int fadcBaseline () const
 
int fadcThreshold () const
 
int runNumber () const
 
int getPpmChannel (const int channel) const
 
bool pack ()
 Pack data. More...
 
bool unpack ()
 Unpack data. More...
 
int channelsPerSubBlock () const
 
void setCompStats (const std::vector< uint32_t > &stats)
 Set compression stats. More...
 
const std::vector< uint32_t > & compStats () const
 Return reference to compression stats. 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 int channelsPerSubBlock (int version, int format)
 Return the number of channels per sub-block. More...
 
static bool errorBlock (uint32_t word)
 Check if a header word is for an error block. 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 SubBlockWordType wordType (uint32_t word)
 Word identification. 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 Member Functions

int asic (int chan) const
 Return the ASIC channel corresponding to a data channel. More...
 
int pin (int chan) const
 Return the G-Link pin corresponding to a data channel. More...
 
bool errorBit (int pin, int bit) const
 Error bit extraction. More...
 
bool errorBit (int bit) const
 Global error bit extraction. More...
 
bool packNeutral ()
 Pack neutral data. More...
 
bool packUncompressedData ()
 Pack uncompressed data. More...
 
bool packUncompressedErrors ()
 Pack uncompressed error data. More...
 
bool unpackNeutral ()
 Unpack neutral data. More...
 
bool unpackUncompressedData ()
 Unpack uncompressed data. More...
 
bool unpackUncompressedErrors ()
 Unpack uncompressed error data. More...
 

Private Attributes

uint32_t m_globalError
 
int m_lutOffset
 
int m_fadcOffset
 
int m_pedestal
 
int m_fadcBaseline
 
int m_fadcThreshold
 
int m_runNumber
 
std::vector< uint32_t > m_compStats
 Vector for compression statistics. More...
 
std::vector< uint32_t > m_datamap
 Vector for intermediate data. More...
 
std::vector< uint32_t > m_errormap
 Vector for intermediate error data. More...
 
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 uint32_t s_wordIdVal = 0xc
 Sub-Block class for PPM data. More...
 
static const int s_errorMarker = 63
 
static const int s_wordLen = 16
 
static const int s_lutBit = 0
 
static const int s_bcidLutBit = 8
 
static const int s_fadcBit = 1
 
static const int s_bcidFadcBit = 0
 
static const uint32_t s_lutMask = 0xff
 
static const uint32_t s_bcidLutMask = 0x7
 
static const uint32_t s_fadcMask = 0x3ff
 
static const uint32_t s_bcidFadcMask = 0x1
 
static const int s_channels = 64
 
static const int s_glinkPins = 16
 
static const int s_asicChannels = 4
 
static const int s_dataBits = 11
 
static const int s_errorBits = 10
 
static const int s_bunchCrossingBits = 12
 
static const uint32_t s_errorMask = 0x7ff
 
static const int s_glinkPinParityBit = 10
 
static const int s_fpgaCorruptBit = 9
 
static const int s_bunchMismatchBit = 8
 
static const int s_eventMismatchBit = 7
 
static const int s_asicFullBit = 6
 
static const int s_timeoutBit = 5
 
static const int s_mcmAbsentBit = 4
 
static const int s_channelDisabledBit = 0
 
static const int s_ppmChannel []
 
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

Sub-Block class for PPM data.

Author
Peter Faulkner

This may be link to the equivalent in LVL1 code, TRY_LINK_LVL1 Marco Leite

Definition at line 30 of file ZdcPpmSubBlock.h.

Member Enumeration Documentation

◆ DataFormats

enum ZdcSubBlock::DataFormats
inherited
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

◆ ZdcPpmSubBlock()

ZdcPpmSubBlock::ZdcPpmSubBlock ( )

Definition at line 58 of file ZdcPpmSubBlock.cxx.

58  :
59  m_globalError(0),
60  m_lutOffset(-1),
61  m_fadcOffset(-1),
62  m_pedestal(10),
63  m_fadcBaseline(0),
64  m_fadcThreshold(0),
65  m_runNumber(0)
66 {
67 }

◆ ~ZdcPpmSubBlock()

ZdcPpmSubBlock::~ZdcPpmSubBlock ( )

Definition at line 69 of file ZdcPpmSubBlock.cxx.

70 {
71 }

Member Function Documentation

◆ asic()

int ZdcPpmSubBlock::asic ( int  chan) const
inlineprivate

Return the ASIC channel corresponding to a data channel.

Definition at line 399 of file ZdcPpmSubBlock.h.

400 {
401  return chan / s_glinkPins;
402 }

◆ asicFull() [1/2]

bool ZdcPpmSubBlock::asicFull ( ) const
inline

Definition at line 294 of file ZdcPpmSubBlock.h.

295 {
296  return errorBit(s_asicFullBit);
297 }

◆ asicFull() [2/2]

bool ZdcPpmSubBlock::asicFull ( int  chan) const
inline

Definition at line 234 of file ZdcPpmSubBlock.h.

235 {
236  return errorBit(pin(chan), s_asicFullBit);
237 }

◆ bcnMismatch()

bool ZdcSubBlock::bcnMismatch ( ) const
inlineinherited

Definition at line 310 of file ZdcSubBlock.h.

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

◆ bunchCrossing()

int ZdcSubBlock::bunchCrossing ( ) const
inlineinherited

Return the Bunch Crossing number (neutral format only)

Definition at line 335 of file ZdcSubBlock.h.

336 {
337  return m_bunchCrossing;
338 }

◆ bunchMismatch() [1/2]

bool ZdcPpmSubBlock::bunchMismatch ( ) const
inline

Definition at line 284 of file ZdcPpmSubBlock.h.

285 {
287 }

◆ bunchMismatch() [2/2]

bool ZdcPpmSubBlock::bunchMismatch ( int  chan) const
inline

Definition at line 224 of file ZdcPpmSubBlock.h.

225 {
227 }

◆ channelDisabled()

bool ZdcPpmSubBlock::channelDisabled ( int  chan) const
inline

Definition at line 249 of file ZdcPpmSubBlock.h.

250 {
252 }

◆ channelDisabledA() [1/2]

bool ZdcPpmSubBlock::channelDisabledA ( ) const
inline

Definition at line 309 of file ZdcPpmSubBlock.h.

310 {
312 }

◆ channelDisabledA() [2/2]

bool ZdcPpmSubBlock::channelDisabledA ( int  pin) const
inline

Definition at line 254 of file ZdcPpmSubBlock.h.

255 {
257 }

◆ channelDisabledB() [1/2]

bool ZdcPpmSubBlock::channelDisabledB ( ) const
inline

Definition at line 314 of file ZdcPpmSubBlock.h.

315 {
316  return errorBit(s_channelDisabledBit + 1);
317 }

◆ channelDisabledB() [2/2]

bool ZdcPpmSubBlock::channelDisabledB ( int  pin) const
inline

Definition at line 259 of file ZdcPpmSubBlock.h.

260 {
261  return errorBit(pin, s_channelDisabledBit + 1);
262 }

◆ channelDisabledC() [1/2]

bool ZdcPpmSubBlock::channelDisabledC ( ) const
inline

Definition at line 319 of file ZdcPpmSubBlock.h.

320 {
321  return errorBit(s_channelDisabledBit + 2);
322 }

◆ channelDisabledC() [2/2]

bool ZdcPpmSubBlock::channelDisabledC ( int  pin) const
inline

Definition at line 264 of file ZdcPpmSubBlock.h.

265 {
266  return errorBit(pin, s_channelDisabledBit + 2);
267 }

◆ channelDisabledD() [1/2]

bool ZdcPpmSubBlock::channelDisabledD ( ) const
inline

Definition at line 324 of file ZdcPpmSubBlock.h.

325 {
326  return errorBit(s_channelDisabledBit + 3);
327 }

◆ channelDisabledD() [2/2]

bool ZdcPpmSubBlock::channelDisabledD ( int  pin) const
inline

Definition at line 269 of file ZdcPpmSubBlock.h.

270 {
271  return errorBit(pin, s_channelDisabledBit + 3);
272 }

◆ channelsPerSubBlock() [1/2]

int ZdcPpmSubBlock::channelsPerSubBlock ( ) const

Definition at line 488 of file ZdcPpmSubBlock.cxx.

489 {
490  return channelsPerSubBlock(version(), format());
491 }

◆ channelsPerSubBlock() [2/2]

int ZdcPpmSubBlock::channelsPerSubBlock ( int  version,
int  format 
)
static

Return the number of channels per sub-block.

Definition at line 464 of file ZdcPpmSubBlock.cxx.

465 {
466  int chan = 0;
467  switch (version) {
468  case 1:
469  switch (format) {
470  case UNCOMPRESSED:
472  break;
473  case NEUTRAL:
474  case COMPRESSED:
475  case SUPERCOMPRESSED:
476  chan = s_channels;
477  break;
478  default:
479  break;
480  }
481  break;
482  default:
483  break;
484  }
485  return chan;
486 }

◆ clear()

void ZdcPpmSubBlock::clear ( )

Clear all data.

Definition at line 75 of file ZdcPpmSubBlock.cxx.

76 {
78  m_globalError = 0;
79  m_lutOffset = -1;
80  m_fadcOffset = -1;
81  m_datamap.clear();
82  m_errormap.clear();
83 }

◆ compStats()

const std::vector< uint32_t > & ZdcPpmSubBlock::compStats ( ) const
inline

Return reference to compression stats.

Definition at line 389 of file ZdcPpmSubBlock.h.

390 {
391  return m_compStats;
392 }

◆ crate()

int ZdcSubBlock::crate ( ) const
inlineinherited

Definition at line 265 of file ZdcSubBlock.h.

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

◆ daqOverflow()

bool ZdcSubBlock::daqOverflow ( ) const
inlineinherited

Definition at line 305 of file ZdcSubBlock.h.

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

◆ dataWords()

int ZdcSubBlock::dataWords ( ) const
inlineinherited

Return number of data words.

Definition at line 235 of file ZdcSubBlock.h.

236 {
237  return m_dataWords;
238 }

◆ errorBit() [1/2]

bool ZdcPpmSubBlock::errorBit ( int  bit) const
private

Global error bit extraction.

Definition at line 255 of file ZdcPpmSubBlock.cxx.

256 {
257  return m_globalError & (0x1 << bit);
258 }

◆ errorBit() [2/2]

bool ZdcPpmSubBlock::errorBit ( int  pin,
int  bit 
) const
inlineprivate

Error bit extraction.

Definition at line 409 of file ZdcPpmSubBlock.h.

410 {
411  return m_errormap[pin] & (0x1 << bit);
412 }

◆ errorBlock()

bool ZdcPpmSubBlock::errorBlock ( uint32_t  word)
static

Check if a header word is for an error block.

Definition at line 495 of file ZdcPpmSubBlock.cxx.

496 {
497  bool rc = false;
498  if (format(word) == UNCOMPRESSED &&
499  seqno(word) == s_errorMarker) rc = true;
500  return rc;
501 }

◆ eventMismatch() [1/2]

bool ZdcPpmSubBlock::eventMismatch ( ) const
inline

Definition at line 289 of file ZdcPpmSubBlock.h.

290 {
292 }

◆ eventMismatch() [2/2]

bool ZdcPpmSubBlock::eventMismatch ( int  chan) const
inline

Definition at line 229 of file ZdcPpmSubBlock.h.

230 {
232 }

◆ fadcBaseline()

int ZdcPpmSubBlock::fadcBaseline ( ) const
inline

Definition at line 374 of file ZdcPpmSubBlock.h.

375 {
376  return m_fadcBaseline;
377 }

◆ fadcOffset()

int ZdcPpmSubBlock::fadcOffset ( ) const
inline

Definition at line 364 of file ZdcPpmSubBlock.h.

365 {
366  return (m_fadcOffset < 0) ? slicesFadc()/2 : m_fadcOffset;
367 }

◆ fadcThreshold()

int ZdcPpmSubBlock::fadcThreshold ( ) const
inline

Definition at line 379 of file ZdcPpmSubBlock.h.

380 {
381  return m_fadcThreshold;
382 }

◆ failingBCN()

uint32_t ZdcSubBlock::failingBCN ( ) const
inlineinherited

Definition at line 285 of file ZdcSubBlock.h.

286 {
288 }

◆ fillPpmData()

void ZdcPpmSubBlock::fillPpmData ( int  chan,
const std::vector< int > &  lut,
const std::vector< int > &  fadc,
const std::vector< int > &  bcidLut,
const std::vector< int > &  bcidFadc 
)

Store PPM data for later packing.

Definition at line 129 of file ZdcPpmSubBlock.cxx.

133 {
134  const int sliceL = slicesLut();
135  const int sliceF = slicesFadc();
136  const int slices = sliceL + sliceF;
137  const int chanPerSubBlock = channelsPerSubBlock();
138  if (chanPerSubBlock == 0) {
140  m_datamap.clear();
141  return;
142  }
143  int dataSize = m_datamap.size();
144  if (dataSize == 0) {
145  dataSize = slices * chanPerSubBlock;
146  m_datamap.resize(dataSize);
147  }
148  int offset = (chan % chanPerSubBlock) * slices;
149  if (offset + slices <= dataSize) {
150  for (int pos = 0; pos < sliceL; ++pos) {
151  uint32_t datum = (lut[pos] & s_lutMask) << s_lutBit;
152  datum |= (bcidLut[pos] & s_bcidLutMask) << s_bcidLutBit;
153  m_datamap[offset + pos] = datum;
154  }
155  offset += sliceL;
156  for (int pos = 0; pos < sliceF; ++pos) {
157  const int adc = (fadc[pos] > 0) ? fadc[pos] : 0;
158  uint32_t datum = (adc & s_fadcMask) << s_fadcBit;
159  datum |= (bcidFadc[pos] & s_bcidFadcMask) << s_bcidFadcBit;
160  m_datamap[offset + pos] = datum;
161  }
162  }
163 }

◆ fillPpmError()

void ZdcPpmSubBlock::fillPpmError ( int  chan,
int  errorWord 
)

Store an error word corresponding to a data channel.

Definition at line 207 of file ZdcPpmSubBlock.cxx.

208 {
209  if (m_errormap.empty()) m_errormap.resize(s_glinkPins);
210  // Expand one ASIC channel disabled bit to four
211  const uint32_t chanDisabled = (errorWord & 0x1) << asic(chan);
212  uint32_t word = (((errorWord >> 1) << s_asicChannels)
213  | chanDisabled) & s_errorMask;
214  m_errormap[pin(chan)] |= word;
215  m_globalError |= word;
216 }

◆ fillPpmPinError()

void ZdcPpmSubBlock::fillPpmPinError ( int  pin,
int  errorWord 
)

Store an error word corresponding to a G-Link pin.

Definition at line 220 of file ZdcPpmSubBlock.cxx.

221 {
222  if (m_errormap.empty()) m_errormap.resize(s_glinkPins);
223  m_errormap[pin] = errorWord & s_errorMask;
224  m_globalError = 0;
225  for (uint32_t word : m_errormap) {
226  m_globalError |= word;
227  }
228 }

◆ format() [1/2]

int ZdcSubBlock::format ( ) const
inlineinherited

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)
staticinherited

Return data format from given header word.

Definition at line 441 of file ZdcSubBlock.cxx.

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

◆ fpgaCorrupt() [1/2]

bool ZdcPpmSubBlock::fpgaCorrupt ( ) const
inline

Definition at line 279 of file ZdcPpmSubBlock.h.

280 {
281  return errorBit(s_fpgaCorruptBit);
282 }

◆ fpgaCorrupt() [2/2]

bool ZdcPpmSubBlock::fpgaCorrupt ( int  chan) const
inline

Definition at line 219 of file ZdcPpmSubBlock.h.

220 {
221  return errorBit(pin(chan), s_fpgaCorruptBit);
222 }

◆ getPpmChannel()

int ZdcPpmSubBlock::getPpmChannel ( const int  channel) const
inline

Definition at line 415 of file ZdcPpmSubBlock.h.

416 {
417  return s_ppmChannel[channel];
418 }

◆ glinkDown()

bool ZdcSubBlock::glinkDown ( ) const
inlineinherited

Definition at line 295 of file ZdcSubBlock.h.

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

◆ glinkParity()

bool ZdcSubBlock::glinkParity ( ) const
inlineinherited

Definition at line 320 of file ZdcSubBlock.h.

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

◆ glinkPinParity() [1/2]

bool ZdcPpmSubBlock::glinkPinParity ( ) const
inline

Definition at line 274 of file ZdcPpmSubBlock.h.

275 {
277 }

◆ glinkPinParity() [2/2]

bool ZdcPpmSubBlock::glinkPinParity ( int  chan) const
inline

Definition at line 214 of file ZdcPpmSubBlock.h.

215 {
217 }

◆ glinkProtocol()

bool ZdcSubBlock::glinkProtocol ( ) const
inlineinherited

Definition at line 315 of file ZdcSubBlock.h.

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

◆ glinkTimeout()

bool ZdcSubBlock::glinkTimeout ( ) const
inlineinherited

Definition at line 290 of file ZdcSubBlock.h.

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

◆ lutOffset()

int ZdcPpmSubBlock::lutOffset ( ) const
inline

Definition at line 359 of file ZdcPpmSubBlock.h.

360 {
361  return (m_lutOffset < 0) ? slicesLut()/2 : m_lutOffset;
362 }

◆ mcmAbsent() [1/2]

bool ZdcPpmSubBlock::mcmAbsent ( ) const
inline

Definition at line 304 of file ZdcPpmSubBlock.h.

305 {
306  return errorBit(s_mcmAbsentBit);
307 }

◆ mcmAbsent() [2/2]

bool ZdcPpmSubBlock::mcmAbsent ( int  chan) const
inline

Definition at line 244 of file ZdcPpmSubBlock.h.

245 {
246  return errorBit(pin(chan), s_mcmAbsentBit);
247 }

◆ minBits()

int ZdcSubBlock::minBits ( uint32_t  datum)
staticinherited

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
inlineinherited

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)
staticinherited

Return module field from given header word.

Definition at line 455 of file ZdcSubBlock.cxx.

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

◆ pack()

bool ZdcPpmSubBlock::pack ( )

Pack data.

Definition at line 262 of file ZdcPpmSubBlock.cxx.

263 {
264  bool rc = false;
265  switch (version()) {
266  case 1:
267  switch (format()) {
268  case NEUTRAL:
269  rc = packNeutral();
270  break;
271  case UNCOMPRESSED:
272  switch (seqno()) {
273  case s_errorMarker:
275  break;
276  default:
278  break;
279  }
280  break;
281  case COMPRESSED:
282  case SUPERCOMPRESSED:
283  rc = ZdcPpmCompression::pack(*this);
284  break;
285  default:
286  break;
287  }
288  break;
289  default:
290  break;
291  }
292  return rc;
293 }

◆ packer()

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

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 ( )
inherited

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 
)
inherited

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)
inherited

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 }

◆ packNeutral()

bool ZdcPpmSubBlock::packNeutral ( )
private

Pack neutral data.

Definition at line 332 of file ZdcPpmSubBlock.cxx.

333 {
334  const int slices = slicesLut() + slicesFadc();
335  const int channels = channelsPerSubBlock();
336  if (m_datamap.empty()) m_datamap.resize(slices * channels);
337  // Bunch crossing number
338  for (int pin = 0; pin < s_glinkPins; ++pin) {
339  uint32_t bc = 0;
340  if (pin < s_bunchCrossingBits) bc = (bunchCrossing() >> pin) & 0x1;
341  packerNeutral(pin, bc, 1);
342  }
343  // Data
344  std::vector<uint32_t>::const_iterator pos = m_datamap.begin();
345  for (int asic = 0; asic < s_asicChannels; ++asic) {
346  for (int pin = 0; pin < s_glinkPins; ++pin) {
347  for (int sl = 0; sl < slices; ++sl) {
349  ++pos;
350  }
351  }
352  }
353  // Errors, including GP
354  if (m_errormap.empty()) m_errormap.resize(s_glinkPins);
355  pos = m_errormap.begin();
356  for (int pin = 0; pin < s_glinkPins; ++pin) {
359  ++pos;
360  }
361  return true;
362 }

◆ packUncompressedData()

bool ZdcPpmSubBlock::packUncompressedData ( )
private

Pack uncompressed data.

Definition at line 366 of file ZdcPpmSubBlock.cxx.

367 {
368  const int slices = slicesLut() + slicesFadc();
369  const int channels = channelsPerSubBlock();
370  if (m_datamap.empty()) m_datamap.resize(slices * channels);
371  for (int sl = 0; sl < slices; ++sl) {
372  for (int chan = 0; chan < channels; ++chan) {
374  }
375  }
376  packerFlush();
377  return true;
378 }

◆ packUncompressedErrors()

bool ZdcPpmSubBlock::packUncompressedErrors ( )
private

Pack uncompressed error data.

Definition at line 382 of file ZdcPpmSubBlock.cxx.

383 {
384  if (m_errormap.empty()) m_errormap.resize(s_glinkPins);
385  for (int pin = 0; pin < s_glinkPins; ++pin) {
387  }
388  packerFlush();
389  return true;
390 }

◆ parityBit()

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

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 }

◆ pedestal()

int ZdcPpmSubBlock::pedestal ( ) const
inline

Definition at line 369 of file ZdcPpmSubBlock.h.

370 {
371  return m_pedestal;
372 }

◆ pin()

int ZdcPpmSubBlock::pin ( int  chan) const
inlineprivate

Return the G-Link pin corresponding to a data channel.

Definition at line 404 of file ZdcPpmSubBlock.h.

405 {
406  return chan % s_glinkPins;
407 }

◆ ppmData()

void ZdcPpmSubBlock::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 at line 167 of file ZdcPpmSubBlock.cxx.

171 {
172  lut.clear();
173  fadc.clear();
174  bcidLut.clear();
175  bcidFadc.clear();
176  const int sliceL = slicesLut();
177  const int sliceF = slicesFadc();
178  const int chans = channelsPerSubBlock();
179  if (chans == 0) {
180  return;
181  }
182  int beg = (chan % chans) * (sliceL + sliceF);
183  int end = beg + sliceL;
184  if (size_t(end + sliceF) <= m_datamap.size()) {
185  for (int pos = beg; pos < end; ++pos) {
186  const uint32_t word = m_datamap[pos];
187  lut.push_back((word >> s_lutBit) & s_lutMask);
188  bcidLut.push_back((word >> s_bcidLutBit) & s_bcidLutMask);
189  }
190  beg += sliceL;
191  end += sliceF;
192  for (int pos = beg; pos < end; ++pos) {
193  const uint32_t word = m_datamap[pos];
194  fadc.push_back((word >> s_fadcBit) & s_fadcMask);
195  bcidFadc.push_back((word >> s_bcidFadcBit) & s_bcidFadcMask);
196  }
197  } else {
198  lut.resize(sliceL);
199  fadc.resize(sliceF);
200  bcidLut.resize(sliceL);
201  bcidFadc.resize(sliceF);
202  }
203 }

◆ ppmError()

int ZdcPpmSubBlock::ppmError ( int  chan) const

Return the error word for a data channel.

Definition at line 232 of file ZdcPpmSubBlock.cxx.

233 {
234  int err = 0;
235  if ( !m_errormap.empty()) {
236  // Replace the four ASIC channel disabled bits with just the one
237  // corresponding to the data channel
238  err = (((m_errormap[pin(chan)] & s_errorMask) >> s_asicChannels) << 1)
240  }
241  return err;
242 }

◆ ppmPinError()

int ZdcPpmSubBlock::ppmPinError ( int  pin) const

Return the error word for a G-Link pin.

Definition at line 246 of file ZdcPpmSubBlock.cxx.

247 {
248  int err = 0;
249  if ( !m_errormap.empty()) err = m_errormap[pin] & s_errorMask;
250  return err;
251 }

◆ 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 }

◆ runNumber()

int ZdcPpmSubBlock::runNumber ( ) const
inline

Definition at line 384 of file ZdcPpmSubBlock.h.

385 {
386  return m_runNumber;
387 }

◆ seqno() [1/2]

int ZdcSubBlock::seqno ( ) const
inlineinherited

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)
staticinherited

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)
inlineinherited

Set the Bunch Crossing number (neutral format only)

Definition at line 330 of file ZdcSubBlock.h.

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

◆ setCompStats()

void ZdcPpmSubBlock::setCompStats ( const std::vector< uint32_t > &  stats)
inline

Set compression stats.

Definition at line 394 of file ZdcPpmSubBlock.h.

395 {
396  m_compStats = stats;
397 }

◆ setDaqOverflow()

void ZdcSubBlock::setDaqOverflow ( int  bit = 1)
inherited

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 }

◆ setFadcBaseline()

void ZdcPpmSubBlock::setFadcBaseline ( int  baseline)
inline

Definition at line 344 of file ZdcPpmSubBlock.h.

345 {
347 }

◆ setFadcOffset()

void ZdcPpmSubBlock::setFadcOffset ( int  offset)
inline

Definition at line 334 of file ZdcPpmSubBlock.h.

335 {
337 }

◆ setFadcThreshold()

void ZdcPpmSubBlock::setFadcThreshold ( int  threshold)
inline

Definition at line 349 of file ZdcPpmSubBlock.h.

350 {
352 }

◆ setGlinkParity()

void ZdcSubBlock::setGlinkParity ( int  bit = 1)
inherited

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 
)
inherited

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 }

◆ setLutOffset()

void ZdcPpmSubBlock::setLutOffset ( int  offset)
inline

Definition at line 329 of file ZdcPpmSubBlock.h.

330 {
332 }

◆ setPedestal()

void ZdcPpmSubBlock::setPedestal ( int  pedval)
inline

Definition at line 339 of file ZdcPpmSubBlock.h.

340 {
341  m_pedestal = pedval;
342 }

◆ setPpmErrorHeader()

void ZdcPpmSubBlock::setPpmErrorHeader ( int  version,
int  format,
int  crate,
int  module,
int  slicesFadc,
int  slicesLut 
)

Store PPM error block header.

Definition at line 98 of file ZdcPpmSubBlock.cxx.

◆ setPpmHeader()

void ZdcPpmSubBlock::setPpmHeader ( int  version,
int  format,
int  seqno,
int  crate,
int  module,
int  slicesFadc,
int  slicesLut 
)

Store PPM header.

Definition at line 87 of file ZdcPpmSubBlock.cxx.

◆ setRunNumber()

void ZdcPpmSubBlock::setRunNumber ( int  run)
inline

Definition at line 354 of file ZdcPpmSubBlock.h.

355 {
356  m_runNumber = run;
357 }

◆ setStatus()

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

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 ( )
inlineinherited

Set continuous bit streaming for compressed formats.

Definition at line 350 of file ZdcSubBlock.h.

351 {
354 }

◆ setUnpackErrorCode()

void ZdcSubBlock::setUnpackErrorCode ( int  code)
inlineinherited

Set the unpacking error code.

Definition at line 340 of file ZdcSubBlock.h.

341 {
343 }

◆ slice()

int ZdcSubBlock::slice ( ) const
inlineinherited

Definition at line 260 of file ZdcSubBlock.h.

261 {
262  return seqno();
263 }

◆ slices1()

int ZdcSubBlock::slices1 ( ) const
inlineinherited

Definition at line 280 of file ZdcSubBlock.h.

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

◆ slices2()

int ZdcSubBlock::slices2 ( ) const
inlineinherited

Definition at line 275 of file ZdcSubBlock.h.

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

◆ slicesFadc()

int ZdcPpmSubBlock::slicesFadc ( ) const

Definition at line 108 of file ZdcPpmSubBlock.cxx.

109 {
110  int slices = slices2();
111  if (slices == 0 && format() == NEUTRAL) {
113  }
114  if (slices <= 0) slices = 1;
115  return slices;
116 }

◆ slicesLut()

int ZdcPpmSubBlock::slicesLut ( ) const

Definition at line 120 of file ZdcPpmSubBlock.cxx.

121 {
122  int slices = slices1();
123  if (slices == 0) slices = 1;
124  return slices;
125 }

◆ subStatus()

uint32_t ZdcSubBlock::subStatus ( ) const
inlineinherited

Return Sub-status word.

Definition at line 325 of file ZdcSubBlock.h.

326 {
327  return m_trailer;
328 }

◆ timeout() [1/2]

bool ZdcPpmSubBlock::timeout ( ) const
inline

Definition at line 299 of file ZdcPpmSubBlock.h.

300 {
301  return errorBit(s_timeoutBit);
302 }

◆ timeout() [2/2]

bool ZdcPpmSubBlock::timeout ( int  chan) const
inline

Definition at line 239 of file ZdcPpmSubBlock.h.

240 {
241  return errorBit(pin(chan), s_timeoutBit);
242 }

◆ unpack()

bool ZdcPpmSubBlock::unpack ( )

Unpack data.

Definition at line 295 of file ZdcPpmSubBlock.cxx.

296 {
297  bool rc = false;
298  switch (version()) {
299  case 1:
300  switch (format()) {
301  case NEUTRAL:
302  rc = unpackNeutral();
303  break;
304  case UNCOMPRESSED:
305  switch (seqno()) {
306  case s_errorMarker:
308  break;
309  default:
311  break;
312  }
313  break;
314  case COMPRESSED:
315  case SUPERCOMPRESSED:
316  rc = ZdcPpmCompression::unpack(*this);
317  break;
318  default:
320  break;
321  }
322  break;
323  default:
325  break;
326  }
327  return rc;
328 }

◆ unpacker()

uint32_t ZdcSubBlock::unpacker ( int  nbits)
inherited

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 ( )
inherited

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 
)
inherited

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)
inherited

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
inlineinherited

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
inherited

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
inlineinherited

Return unpacker success flag.

Definition at line 356 of file ZdcSubBlock.h.

357 {
358  return m_unpackerFlag;
359 }

◆ unpackNeutral()

bool ZdcPpmSubBlock::unpackNeutral ( )
private

Unpack neutral data.

Definition at line 394 of file ZdcPpmSubBlock.cxx.

395 {
396  const int slices = slicesLut() + slicesFadc();
397  m_datamap.clear();
398  // Bunch Crossing number
399  int bunchCrossing = 0;
400  for (int pin = 0; pin < s_glinkPins; ++pin) {
401  const int bc = unpackerNeutral(pin, 1);
402  if (pin < s_bunchCrossingBits) bunchCrossing |= bc << pin;
403  }
405  // Data
406  for (int asic = 0; asic < s_asicChannels; ++asic) {
407  for (int pin = 0; pin < s_glinkPins; ++pin) {
408  for (int sl = 0; sl < slices; ++sl) {
410  }
411  }
412  }
413  const bool rc = unpackerSuccess();
415  // Errors
416  m_errormap.clear();
417  m_globalError = 0;
418  for (int pin = 0; pin < s_glinkPins; ++pin) {
421  m_errormap.push_back(error);
422  m_globalError |= error;
423  }
424  return rc;
425 }

◆ unpackUncompressedData()

bool ZdcPpmSubBlock::unpackUncompressedData ( )
private

Unpack uncompressed data.

Definition at line 429 of file ZdcPpmSubBlock.cxx.

430 {
431  const int slices = slicesLut() + slicesFadc();
432  const int channels = channelsPerSubBlock();
433  m_datamap.resize(slices * channels);
434  unpackerInit();
435  for (int sl = 0; sl < slices; ++sl) {
436  for (int chan = 0; chan < channels; ++chan) {
438  }
439  }
440  const bool rc = unpackerSuccess();
442  return rc;
443 }

◆ unpackUncompressedErrors()

bool ZdcPpmSubBlock::unpackUncompressedErrors ( )
private

Unpack uncompressed error data.

Definition at line 447 of file ZdcPpmSubBlock.cxx.

448 {
449  unpackerInit();
450  m_errormap.clear();
451  m_globalError = 0;
452  for (int pin = 0; pin < s_glinkPins; ++pin) {
453  uint32_t word = unpacker(s_wordLen);
454  m_errormap.push_back(word);
455  m_globalError |= word;
456  }
457  const bool rc = unpackerSuccess();
459  return rc;
460 }

◆ upstreamError()

bool ZdcSubBlock::upstreamError ( ) const
inlineinherited

Definition at line 300 of file ZdcSubBlock.h.

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

◆ version()

int ZdcSubBlock::version ( ) const
inlineinherited

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
inlineinherited

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)
staticinherited

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)
staticinherited

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
inherited

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
privateinherited

Definition at line 218 of file ZdcSubBlock.h.

◆ m_bunchCrossing

int ZdcSubBlock::m_bunchCrossing
privateinherited

Bunch Crossing number (neutral format only)

Definition at line 214 of file ZdcSubBlock.h.

◆ m_compStats

std::vector<uint32_t> ZdcPpmSubBlock::m_compStats
private

Vector for compression statistics.

Definition at line 204 of file ZdcPpmSubBlock.h.

◆ m_currentBit

int ZdcSubBlock::m_currentBit
privateinherited

Definition at line 219 of file ZdcSubBlock.h.

◆ m_currentPinBit

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

Definition at line 226 of file ZdcSubBlock.h.

◆ m_data

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

Sub-Block data.

Definition at line 231 of file ZdcSubBlock.h.

◆ m_datamap

std::vector<uint32_t> ZdcPpmSubBlock::m_datamap
private

Vector for intermediate data.

Definition at line 207 of file ZdcPpmSubBlock.h.

◆ m_dataPos

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

Definition at line 223 of file ZdcSubBlock.h.

◆ m_dataPosEnd

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

Definition at line 224 of file ZdcSubBlock.h.

◆ m_dataWords

int ZdcSubBlock::m_dataWords
privateinherited

Current number of data words.

Definition at line 229 of file ZdcSubBlock.h.

◆ m_errormap

std::vector<uint32_t> ZdcPpmSubBlock::m_errormap
private

Vector for intermediate error data.

Definition at line 210 of file ZdcPpmSubBlock.h.

◆ m_fadcBaseline

int ZdcPpmSubBlock::m_fadcBaseline
private

Definition at line 199 of file ZdcPpmSubBlock.h.

◆ m_fadcOffset

int ZdcPpmSubBlock::m_fadcOffset
private

Definition at line 197 of file ZdcPpmSubBlock.h.

◆ m_fadcThreshold

int ZdcPpmSubBlock::m_fadcThreshold
private

Definition at line 200 of file ZdcPpmSubBlock.h.

◆ m_globalError

uint32_t ZdcPpmSubBlock::m_globalError
private

Definition at line 193 of file ZdcPpmSubBlock.h.

◆ m_header

uint32_t ZdcSubBlock::m_header
privateinherited

Sub-Block Header.

Definition at line 210 of file ZdcSubBlock.h.

◆ m_lutOffset

int ZdcPpmSubBlock::m_lutOffset
private

Definition at line 196 of file ZdcPpmSubBlock.h.

◆ m_maxBits

int ZdcSubBlock::m_maxBits
privateinherited

Definition at line 220 of file ZdcSubBlock.h.

◆ m_maxMask

uint32_t ZdcSubBlock::m_maxMask
privateinherited

Definition at line 221 of file ZdcSubBlock.h.

◆ m_oddParity

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

Definition at line 227 of file ZdcSubBlock.h.

◆ m_pedestal

int ZdcPpmSubBlock::m_pedestal
private

Definition at line 198 of file ZdcPpmSubBlock.h.

◆ m_runNumber

int ZdcPpmSubBlock::m_runNumber
private

Definition at line 201 of file ZdcPpmSubBlock.h.

◆ m_trailer

uint32_t ZdcSubBlock::m_trailer
privateinherited

Sub-Block Status Trailer.

Definition at line 212 of file ZdcSubBlock.h.

◆ m_unpackerFlag

bool ZdcSubBlock::m_unpackerFlag
privateinherited

Definition at line 222 of file ZdcSubBlock.h.

◆ m_unpackError

int ZdcSubBlock::m_unpackError
privateinherited

Unpacking error code.

Definition at line 216 of file ZdcSubBlock.h.

◆ s_asicChannels

const int ZdcPpmSubBlock::s_asicChannels = 4
staticprivate

Definition at line 150 of file ZdcPpmSubBlock.h.

◆ s_asicFullBit

const int ZdcPpmSubBlock::s_asicFullBit = 6
staticprivate

Definition at line 160 of file ZdcPpmSubBlock.h.

◆ s_bcidFadcBit

const int ZdcPpmSubBlock::s_bcidFadcBit = 0
staticprivate

Definition at line 142 of file ZdcPpmSubBlock.h.

◆ s_bcidFadcMask

const uint32_t ZdcPpmSubBlock::s_bcidFadcMask = 0x1
staticprivate

Definition at line 146 of file ZdcPpmSubBlock.h.

◆ s_bcidLutBit

const int ZdcPpmSubBlock::s_bcidLutBit = 8
staticprivate

Definition at line 140 of file ZdcPpmSubBlock.h.

◆ s_bcidLutMask

const uint32_t ZdcPpmSubBlock::s_bcidLutMask = 0x7
staticprivate

Definition at line 144 of file ZdcPpmSubBlock.h.

◆ s_bcnMismatchBit

const int ZdcSubBlock::s_bcnMismatchBit = 2
staticprivateinherited

Definition at line 196 of file ZdcSubBlock.h.

◆ s_bunchCrossingBits

const int ZdcPpmSubBlock::s_bunchCrossingBits = 12
staticprivate

Definition at line 153 of file ZdcPpmSubBlock.h.

◆ s_bunchMismatchBit

const int ZdcPpmSubBlock::s_bunchMismatchBit = 8
staticprivate

Definition at line 158 of file ZdcPpmSubBlock.h.

◆ s_channelDisabledBit

const int ZdcPpmSubBlock::s_channelDisabledBit = 0
staticprivate

Definition at line 163 of file ZdcPpmSubBlock.h.

◆ s_channels

const int ZdcPpmSubBlock::s_channels = 64
staticprivate

Definition at line 148 of file ZdcPpmSubBlock.h.

◆ s_crateBit

const int ZdcSubBlock::s_crateBit = 12
staticprivateinherited

Definition at line 178 of file ZdcSubBlock.h.

◆ s_crateMask

const uint32_t ZdcSubBlock::s_crateMask = 0xf
staticprivateinherited

Definition at line 186 of file ZdcSubBlock.h.

◆ s_daqOverflowBit

const int ZdcSubBlock::s_daqOverflowBit = 3
staticprivateinherited

Definition at line 195 of file ZdcSubBlock.h.

◆ s_dataBits

const int ZdcPpmSubBlock::s_dataBits = 11
staticprivate

Definition at line 151 of file ZdcPpmSubBlock.h.

◆ s_errorBits

const int ZdcPpmSubBlock::s_errorBits = 10
staticprivate

Definition at line 152 of file ZdcPpmSubBlock.h.

◆ s_errorMarker

const int ZdcPpmSubBlock::s_errorMarker = 63
staticprivate

Definition at line 136 of file ZdcPpmSubBlock.h.

◆ s_errorMask

const uint32_t ZdcPpmSubBlock::s_errorMask = 0x7ff
staticprivate

Definition at line 155 of file ZdcPpmSubBlock.h.

◆ s_eventMismatchBit

const int ZdcPpmSubBlock::s_eventMismatchBit = 7
staticprivate

Definition at line 159 of file ZdcPpmSubBlock.h.

◆ s_fadcBit

const int ZdcPpmSubBlock::s_fadcBit = 1
staticprivate

Definition at line 141 of file ZdcPpmSubBlock.h.

◆ s_fadcMask

const uint32_t ZdcPpmSubBlock::s_fadcMask = 0x3ff
staticprivate

Definition at line 145 of file ZdcPpmSubBlock.h.

◆ s_failingBcnBit

const int ZdcSubBlock::s_failingBcnBit = 22
staticprivateinherited

Definition at line 191 of file ZdcSubBlock.h.

◆ s_failingBcnMask

const uint32_t ZdcSubBlock::s_failingBcnMask = 0x3f
staticprivateinherited

Definition at line 199 of file ZdcSubBlock.h.

◆ s_formatBit

const int ZdcSubBlock::s_formatBit = 22
staticprivateinherited

Definition at line 176 of file ZdcSubBlock.h.

◆ s_formatMask

const uint32_t ZdcSubBlock::s_formatMask = 0x7
staticprivateinherited

Definition at line 184 of file ZdcSubBlock.h.

◆ s_fpgaCorruptBit

const int ZdcPpmSubBlock::s_fpgaCorruptBit = 9
staticprivate

Definition at line 157 of file ZdcPpmSubBlock.h.

◆ s_glinkDavSet

const uint32_t ZdcSubBlock::s_glinkDavSet = 0x400000
staticprivateinherited

Definition at line 207 of file ZdcSubBlock.h.

◆ s_glinkDownBit

const int ZdcSubBlock::s_glinkDownBit = 6
staticprivateinherited

Definition at line 193 of file ZdcSubBlock.h.

◆ s_glinkParityBit

const int ZdcSubBlock::s_glinkParityBit = 0
staticprivateinherited

Definition at line 198 of file ZdcSubBlock.h.

◆ s_glinkPinParityBit

const int ZdcPpmSubBlock::s_glinkPinParityBit = 10
staticprivate

Definition at line 156 of file ZdcPpmSubBlock.h.

◆ s_glinkPins

const int ZdcPpmSubBlock::s_glinkPins = 16
staticprivate

Definition at line 149 of file ZdcPpmSubBlock.h.

◆ s_glinkProtocolBit

const int ZdcSubBlock::s_glinkProtocolBit = 1
staticprivateinherited

Definition at line 197 of file ZdcSubBlock.h.

◆ s_glinkTimeoutBit

const int ZdcSubBlock::s_glinkTimeoutBit = 7
staticprivateinherited

Definition at line 192 of file ZdcSubBlock.h.

◆ s_headerBit

const int ZdcSubBlock::s_headerBit = 30
staticprivateinherited

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
staticprivateinherited

Definition at line 169 of file ZdcSubBlock.h.

◆ s_headerVal

const uint32_t ZdcSubBlock::s_headerVal = 0x3
staticprivateinherited

Definition at line 171 of file ZdcSubBlock.h.

◆ s_lutBit

const int ZdcPpmSubBlock::s_lutBit = 0
staticprivate

Definition at line 139 of file ZdcPpmSubBlock.h.

◆ s_lutMask

const uint32_t ZdcPpmSubBlock::s_lutMask = 0xff
staticprivate

Definition at line 143 of file ZdcPpmSubBlock.h.

◆ s_maxPins

const int ZdcSubBlock::s_maxPins = 20
staticprivateinherited

Definition at line 206 of file ZdcSubBlock.h.

◆ s_maxStreamedBits

const int ZdcSubBlock::s_maxStreamedBits = 31
staticprivateinherited

Definition at line 202 of file ZdcSubBlock.h.

◆ s_maxStreamedMask

const uint32_t ZdcSubBlock::s_maxStreamedMask = 0x7fffffff
staticprivateinherited

Definition at line 204 of file ZdcSubBlock.h.

◆ s_maxWordBits

const int ZdcSubBlock::s_maxWordBits = 32
staticprivateinherited

Definition at line 201 of file ZdcSubBlock.h.

◆ s_maxWordMask

const uint32_t ZdcSubBlock::s_maxWordMask = 0xffffffff
staticprivateinherited

Definition at line 203 of file ZdcSubBlock.h.

◆ s_mcmAbsentBit

const int ZdcPpmSubBlock::s_mcmAbsentBit = 4
staticprivate

Definition at line 162 of file ZdcPpmSubBlock.h.

◆ s_moduleBit

const int ZdcSubBlock::s_moduleBit = 8
staticprivateinherited

Definition at line 179 of file ZdcSubBlock.h.

◆ s_moduleMask

const uint32_t ZdcSubBlock::s_moduleMask = 0xf
staticprivateinherited

Definition at line 187 of file ZdcSubBlock.h.

◆ s_ppmChannel

const int ZdcPpmSubBlock::s_ppmChannel
staticprivate
Initial value:
= {0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63,
1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61,
2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62 }

Definition at line 164 of file ZdcPpmSubBlock.h.

◆ s_seqnoBit

const int ZdcSubBlock::s_seqnoBit = 16
staticprivateinherited

Definition at line 177 of file ZdcSubBlock.h.

◆ s_seqnoMask

const uint32_t ZdcSubBlock::s_seqnoMask = 0x3f
staticprivateinherited

Definition at line 185 of file ZdcSubBlock.h.

◆ s_slices1Bit

const int ZdcSubBlock::s_slices1Bit = 0
staticprivateinherited

Definition at line 181 of file ZdcSubBlock.h.

◆ s_slices1Mask

const uint32_t ZdcSubBlock::s_slices1Mask = 0x7
staticprivateinherited

Definition at line 189 of file ZdcSubBlock.h.

◆ s_slices2Bit

const int ZdcSubBlock::s_slices2Bit = 3
staticprivateinherited

Definition at line 180 of file ZdcSubBlock.h.

◆ s_slices2Mask

const uint32_t ZdcSubBlock::s_slices2Mask = 0x1f
staticprivateinherited

Definition at line 188 of file ZdcSubBlock.h.

◆ s_statusBit

const int ZdcSubBlock::s_statusBit = 28
staticprivateinherited

Definition at line 168 of file ZdcSubBlock.h.

◆ s_statusMask

const uint32_t ZdcSubBlock::s_statusMask = 0x1
staticprivateinherited

Definition at line 170 of file ZdcSubBlock.h.

◆ s_statusVal

const uint32_t ZdcSubBlock::s_statusVal = 0x1
staticprivateinherited

Definition at line 172 of file ZdcSubBlock.h.

◆ s_timeoutBit

const int ZdcPpmSubBlock::s_timeoutBit = 5
staticprivate

Definition at line 161 of file ZdcPpmSubBlock.h.

◆ s_upstreamErrorBit

const int ZdcSubBlock::s_upstreamErrorBit = 4
staticprivateinherited

Definition at line 194 of file ZdcSubBlock.h.

◆ s_versionBit

const int ZdcSubBlock::s_versionBit = 25
staticprivateinherited

Definition at line 175 of file ZdcSubBlock.h.

◆ s_versionMask

const uint32_t ZdcSubBlock::s_versionMask = 0x7
staticprivateinherited

Definition at line 183 of file ZdcSubBlock.h.

◆ s_wordIdBit

const int ZdcSubBlock::s_wordIdBit = 28
staticprivateinherited

Definition at line 174 of file ZdcSubBlock.h.

◆ s_wordIdMask

const uint32_t ZdcSubBlock::s_wordIdMask = 0xf
staticprivateinherited

Definition at line 182 of file ZdcSubBlock.h.

◆ s_wordIdVal

const uint32_t ZdcPpmSubBlock::s_wordIdVal = 0xc
staticprivate

Sub-Block class for PPM data.

This may be link to the equivalent in LVL1 code, TRY_LINK_LVL1 Marco Leite

Definition at line 135 of file ZdcPpmSubBlock.h.

◆ s_wordLen

const int ZdcPpmSubBlock::s_wordLen = 16
staticprivate

Definition at line 138 of file ZdcPpmSubBlock.h.


The documentation for this class was generated from the following files:
ZdcPpmSubBlock::asic
int asic(int chan) const
Return the ASIC channel corresponding to a data channel.
Definition: ZdcPpmSubBlock.h:399
ZdcPpmSubBlock::s_bcidLutMask
static const uint32_t s_bcidLutMask
Definition: ZdcPpmSubBlock.h:144
ZdcSubBlock::m_trailer
uint32_t m_trailer
Sub-Block Status Trailer.
Definition: ZdcSubBlock.h:212
ZdcPpmSubBlock::unpackNeutral
bool unpackNeutral()
Unpack neutral data.
Definition: ZdcPpmSubBlock.cxx:394
ZdcPpmSubBlock::m_fadcBaseline
int m_fadcBaseline
Definition: ZdcPpmSubBlock.h:199
ZdcPpmSubBlock::s_bunchMismatchBit
static const int s_bunchMismatchBit
Definition: ZdcPpmSubBlock.h:158
ZdcSubBlock::glinkTimeout
bool glinkTimeout() const
Definition: ZdcSubBlock.h:290
ZdcSubBlock::unpackerInit
void unpackerInit()
Initialise unpacker.
Definition: ZdcSubBlock.cxx:352
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
ZdcPpmSubBlock::packNeutral
bool packNeutral()
Pack neutral data.
Definition: ZdcPpmSubBlock.cxx:332
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
ZdcPpmSubBlock::s_fadcBit
static const int s_fadcBit
Definition: ZdcPpmSubBlock.h:141
ZdcSubBlock::setUnpackErrorCode
void setUnpackErrorCode(int code)
Set the unpacking error code.
Definition: ZdcSubBlock.h:340
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
ZdcSubBlock::m_bunchCrossing
int m_bunchCrossing
Bunch Crossing number (neutral format only)
Definition: ZdcSubBlock.h:214
ZdcPpmSubBlock::m_runNumber
int m_runNumber
Definition: ZdcPpmSubBlock.h:201
ZdcPpmSubBlock::s_glinkPins
static const int s_glinkPins
Definition: ZdcPpmSubBlock.h:149
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
ZdcPpmSubBlock::s_bcidFadcBit
static const int s_bcidFadcBit
Definition: ZdcPpmSubBlock.h:142
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
ZdcPpmSubBlock::unpackUncompressedErrors
bool unpackUncompressedErrors()
Unpack uncompressed error data.
Definition: ZdcPpmSubBlock.cxx:447
ZdcPpmSubBlock::s_wordIdVal
static const uint32_t s_wordIdVal
Sub-Block class for PPM data.
Definition: ZdcPpmSubBlock.h:135
ZdcSubBlock::s_upstreamErrorBit
static const int s_upstreamErrorBit
Definition: ZdcSubBlock.h:194
ZdcPpmSubBlock::s_fpgaCorruptBit
static const int s_fpgaCorruptBit
Definition: ZdcPpmSubBlock.h:157
ZdcPpmSubBlock::packUncompressedErrors
bool packUncompressedErrors()
Pack uncompressed error data.
Definition: ZdcPpmSubBlock.cxx:382
ZdcPpmSubBlock::m_errormap
std::vector< uint32_t > m_errormap
Vector for intermediate error data.
Definition: ZdcPpmSubBlock.h:210
ZdcSubBlock::dataWords
int dataWords() const
Return number of data words.
Definition: ZdcSubBlock.h:235
ZdcSubBlock::setHeader
void setHeader(int wordId, int version, int format, int seqno, int crate, int module, int slices2, int slices1)
Store header data.
Definition: ZdcSubBlock.cxx:102
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
ZdcPpmSubBlock::s_lutBit
static const int s_lutBit
Definition: ZdcPpmSubBlock.h:139
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
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
ZdcPpmSubBlock::s_errorMarker
static const int s_errorMarker
Definition: ZdcPpmSubBlock.h:136
ZdcPpmSubBlock::slicesFadc
int slicesFadc() const
Definition: ZdcPpmSubBlock.cxx:108
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
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ZdcPpmSubBlock::m_lutOffset
int m_lutOffset
Definition: ZdcPpmSubBlock.h:196
ZdcSubBlock::UNPACK_WORD_ID
@ UNPACK_WORD_ID
Definition: ZdcSubBlock.h:53
ZdcPpmSubBlock::m_fadcThreshold
int m_fadcThreshold
Definition: ZdcPpmSubBlock.h:200
ZdcPpmSubBlock::s_bcidFadcMask
static const uint32_t s_bcidFadcMask
Definition: ZdcPpmSubBlock.h:146
ZdcSubBlock::unpackerNeutralParityError
bool unpackerNeutralParityError(int pin)
Unpack and test G-Link parity bit for given pin.
Definition: ZdcSubBlock.cxx:408
ZdcSubBlock::packerFlush
void packerFlush()
Flush the current data word padded with zeros.
Definition: ZdcSubBlock.cxx:296
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
dq_defect_copy_defect_database.channels
def channels
Definition: dq_defect_copy_defect_database.py:56
ZdcPpmSubBlock::s_fadcMask
static const uint32_t s_fadcMask
Definition: ZdcPpmSubBlock.h:145
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
ZdcPpmSubBlock::m_globalError
uint32_t m_globalError
Definition: ZdcPpmSubBlock.h:193
ZdcPpmSubBlock::channelDisabled
bool channelDisabled(int chan) const
Definition: ZdcPpmSubBlock.h:249
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
histSizes.code
code
Definition: histSizes.py:129
ZdcPpmSubBlock::s_errorMask
static const uint32_t s_errorMask
Definition: ZdcPpmSubBlock.h:155
ZdcSubBlock::bunchCrossing
int bunchCrossing() const
Return the Bunch Crossing number (neutral format only)
Definition: ZdcSubBlock.h:335
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
ZdcPpmSubBlock::s_channels
static const int s_channels
Definition: ZdcPpmSubBlock.h:148
ZdcSubBlock::format
int format() const
Definition: ZdcSubBlock.h:250
ZdcPpmSubBlock::m_pedestal
int m_pedestal
Definition: ZdcPpmSubBlock.h:198
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
ZdcSubBlock::UNPACK_COMPRESSION_VERSION
@ UNPACK_COMPRESSION_VERSION
Definition: ZdcSubBlock.h:49
ZdcSubBlock::HEADER
@ HEADER
Definition: ZdcSubBlock.h:37
baseline
@ baseline
Definition: SUSYToolsTester.cxx:99
ZdcSubBlock::s_headerVal
static const uint32_t s_headerVal
Definition: ZdcSubBlock.h:171
ZdcPpmSubBlock::s_errorBits
static const int s_errorBits
Definition: ZdcPpmSubBlock.h:152
ZdcPpmSubBlock::s_wordLen
static const int s_wordLen
Definition: ZdcPpmSubBlock.h:138
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::packerNeutralParity
void packerNeutralParity(int pin)
Pack current G-Link parity bit for given pin.
Definition: ZdcSubBlock.cxx:382
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
ZdcPpmSubBlock::s_timeoutBit
static const int s_timeoutBit
Definition: ZdcPpmSubBlock.h:161
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
ZdcPpmSubBlock::m_datamap
std::vector< uint32_t > m_datamap
Vector for intermediate data.
Definition: ZdcPpmSubBlock.h:207
ZdcPpmSubBlock::channelsPerSubBlock
int channelsPerSubBlock() const
Definition: ZdcPpmSubBlock.cxx:488
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
ZdcPpmSubBlock::s_channelDisabledBit
static const int s_channelDisabledBit
Definition: ZdcPpmSubBlock.h:163
ZdcPpmSubBlock::s_glinkPinParityBit
static const int s_glinkPinParityBit
Definition: ZdcPpmSubBlock.h:156
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
ZdcSubBlock::UNCOMPRESSED
@ UNCOMPRESSED
Definition: ZdcSubBlock.h:42
PayloadHelpers::dataSize
size_t dataSize(TDA::PayloadIterator start)
Size in bytes of the buffer that is needed to decode next fragment data content.
Definition: TriggerEDMDeserialiserAlg.cxx:188
ZdcSubBlock::packerNeutral
void packerNeutral(int pin, uint32_t datum, int nbits)
Pack given neutral data from given pin.
Definition: ZdcSubBlock.cxx:364
ZdcPpmSubBlock::m_compStats
std::vector< uint32_t > m_compStats
Vector for compression statistics.
Definition: ZdcPpmSubBlock.h:204
ZdcSubBlock::SubBlockWordType
SubBlockWordType
Definition: ZdcSubBlock.h:37
ZdcSubBlock::setBunchCrossing
void setBunchCrossing(int bc)
Set the Bunch Crossing number (neutral format only)
Definition: ZdcSubBlock.h:330
ZdcPpmSubBlock::s_bunchCrossingBits
static const int s_bunchCrossingBits
Definition: ZdcPpmSubBlock.h:153
ZdcPpmSubBlock::s_asicFullBit
static const int s_asicFullBit
Definition: ZdcPpmSubBlock.h:160
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::unpacker
uint32_t unpacker(int nbits)
Unpack given number of bits of data.
Definition: ZdcSubBlock.cxx:309
ZdcPpmSubBlock::pin
int pin(int chan) const
Return the G-Link pin corresponding to a data channel.
Definition: ZdcPpmSubBlock.h:404
ZdcSubBlock::UNPACK_SOURCE_ID
@ UNPACK_SOURCE_ID
Definition: ZdcSubBlock.h:52
ZdcSubBlock::packer
void packer(uint32_t datum, int nbits)
Pack given data into given number of bits.
Definition: ZdcSubBlock.cxx:271
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
ZdcPpmCompression::pack
static bool pack(ZdcPpmSubBlock &subBlock)
Pack data.
Definition: ZdcPpmCompression.cxx:32
ZdcPpmSubBlock::slicesLut
int slicesLut() const
Definition: ZdcPpmSubBlock.cxx:120
ZdcPpmSubBlock::s_bcidLutBit
static const int s_bcidLutBit
Definition: ZdcPpmSubBlock.h:140
ZdcSubBlock::unpackerSuccess
bool unpackerSuccess() const
Return unpacker success flag.
Definition: ZdcSubBlock.h:356
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
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
ZdcPpmSubBlock::s_ppmChannel
static const int s_ppmChannel[]
Definition: ZdcPpmSubBlock.h:164
ZdcPpmSubBlock::s_lutMask
static const uint32_t s_lutMask
Definition: ZdcPpmSubBlock.h:143
ZdcSubBlock::s_moduleMask
static const uint32_t s_moduleMask
Definition: ZdcSubBlock.h:187
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
ZdcSubBlock::s_slices1Mask
static const uint32_t s_slices1Mask
Definition: ZdcSubBlock.h:189
ZdcPpmSubBlock::s_asicChannels
static const int s_asicChannels
Definition: ZdcPpmSubBlock.h:150
ZdcSubBlock::s_moduleBit
static const int s_moduleBit
Definition: ZdcSubBlock.h:179
ZdcPpmSubBlock::errorBit
bool errorBit(int pin, int bit) const
Error bit extraction.
Definition: ZdcPpmSubBlock.h:409
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
ZdcPpmCompression::unpack
static bool unpack(ZdcPpmSubBlock &subBlock)
Unpack data.
Definition: ZdcPpmCompression.cxx:216
ZdcPpmSubBlock::unpackUncompressedData
bool unpackUncompressedData()
Unpack uncompressed data.
Definition: ZdcPpmSubBlock.cxx:429
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
ZdcPpmSubBlock::s_mcmAbsentBit
static const int s_mcmAbsentBit
Definition: ZdcPpmSubBlock.h:162
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
dumpTgcDigiThreshold.threshold
list threshold
Definition: dumpTgcDigiThreshold.py:34
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
ZdcPpmSubBlock::packUncompressedData
bool packUncompressedData()
Pack uncompressed data.
Definition: ZdcPpmSubBlock.cxx:366
ZdcPpmSubBlock::m_fadcOffset
int m_fadcOffset
Definition: ZdcPpmSubBlock.h:197
keylayer_zslicemap.slices
slices
Definition: keylayer_zslicemap.py:112
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:349
python.LArCondContChannels.chans
list chans
Definition: LArCondContChannels.py:638
ZdcSubBlock::clear
void clear()
Clear all data.
Definition: ZdcSubBlock.cxx:85
ZdcPpmSubBlock::s_dataBits
static const int s_dataBits
Definition: ZdcPpmSubBlock.h:151
ZdcPpmSubBlock::s_eventMismatchBit
static const int s_eventMismatchBit
Definition: ZdcPpmSubBlock.h:159