Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Zdc Sub Block base class.
More...
#include <ZdcSubBlock.h>
|
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
} |
|
|
| 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 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...
|
|
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.
◆ DataFormats
Enumerator |
---|
NEUTRAL | |
UNCOMPRESSED | |
COMPRESSED | |
SUPERCOMPRESSED | |
Definition at line 41 of file ZdcSubBlock.h.
◆ SubBlockWordType
◆ 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.
◆ ZdcSubBlock()
ZdcSubBlock::ZdcSubBlock |
( |
| ) |
|
◆ ~ZdcSubBlock()
ZdcSubBlock::~ZdcSubBlock |
( |
| ) |
|
◆ bcnMismatch()
bool ZdcSubBlock::bcnMismatch |
( |
| ) |
const |
|
inline |
◆ bunchCrossing()
int ZdcSubBlock::bunchCrossing |
( |
| ) |
const |
|
inline |
Return the Bunch Crossing number (neutral format only)
Definition at line 335 of file ZdcSubBlock.h.
◆ clear()
void ZdcSubBlock::clear |
( |
| ) |
|
◆ crate()
int ZdcSubBlock::crate |
( |
| ) |
const |
|
inline |
◆ daqOverflow()
bool ZdcSubBlock::daqOverflow |
( |
| ) |
const |
|
inline |
◆ dataWords()
int ZdcSubBlock::dataWords |
( |
| ) |
const |
|
inline |
◆ failingBCN()
uint32_t ZdcSubBlock::failingBCN |
( |
| ) |
const |
|
inline |
◆ format() [1/2]
int ZdcSubBlock::format |
( |
| ) |
const |
|
inline |
◆ 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.
◆ glinkDown()
bool ZdcSubBlock::glinkDown |
( |
| ) |
const |
|
inline |
◆ glinkParity()
bool ZdcSubBlock::glinkParity |
( |
| ) |
const |
|
inline |
◆ glinkProtocol()
bool ZdcSubBlock::glinkProtocol |
( |
| ) |
const |
|
inline |
◆ glinkTimeout()
bool ZdcSubBlock::glinkTimeout |
( |
| ) |
const |
|
inline |
◆ 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.
247 const int maxBits = 32;
249 for (
int i = 0;
i < maxBits; ++
i) {
250 if ( !(datum >>
i)) {
◆ module() [1/2]
int ZdcSubBlock::module |
( |
| ) |
const |
|
inline |
◆ 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.
◆ 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.
275 for (
int i = 1;
i < nbits; ++
i)
mask |= (
mask << 1);
◆ packerFlush()
void ZdcSubBlock::packerFlush |
( |
| ) |
|
Flush the current data word padded with zeros.
Definition at line 296 of file ZdcSubBlock.cxx.
◆ 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.
367 if (pin >= 0 && pin < s_maxPins && nbits > 0) {
372 for (
int bit = 0; bit < nbits; ++bit) {
◆ packerNeutralParity()
void ZdcSubBlock::packerNeutralParity |
( |
int |
pin | ) |
|
Pack current G-Link parity bit for given pin.
Definition at line 382 of file ZdcSubBlock.cxx.
◆ 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.
265 for (
int bit = 0; bit < nbits; ++bit) parity ^= (datum >> bit) & 0x1;
◆ read()
Input complete packed sub-block from ROD array.
Definition at line 121 of file ZdcSubBlock.cxx.
129 for (;
pos != pose; ++
pos) {
◆ seqno() [1/2]
int ZdcSubBlock::seqno |
( |
| ) |
const |
|
inline |
◆ 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.
◆ setBunchCrossing()
void ZdcSubBlock::setBunchCrossing |
( |
int |
bc | ) |
|
|
inline |
Set the Bunch Crossing number (neutral format only)
Definition at line 330 of file ZdcSubBlock.h.
◆ setDaqOverflow()
void ZdcSubBlock::setDaqOverflow |
( |
int |
bit = 1 | ) |
|
Set DAQ FIFO Overflow bit in Sub-status word.
Definition at line 186 of file ZdcSubBlock.cxx.
190 else setStatus(0,
false,
false,
false,
true,
false,
false,
false);
◆ setGlinkParity()
void ZdcSubBlock::setGlinkParity |
( |
int |
bit = 1 | ) |
|
◆ setHeader()
void ZdcSubBlock::setHeader |
( |
int |
wordId, |
|
|
int |
version, |
|
|
int |
format, |
|
|
int |
seqno, |
|
|
int |
crate, |
|
|
int |
module, |
|
|
int |
slices2, |
|
|
int |
slices1 |
|
) |
| |
◆ setStatus()
void ZdcSubBlock::setStatus |
( |
uint32_t |
failingBCN, |
|
|
bool |
glinkTimeout, |
|
|
bool |
glinkDown, |
|
|
bool |
upstreamError, |
|
|
bool |
daqOverflow, |
|
|
bool |
bcnMismatch, |
|
|
bool |
glinkProtocol, |
|
|
bool |
glinkParity |
|
) |
| |
◆ setStreamed()
void ZdcSubBlock::setStreamed |
( |
| ) |
|
|
inline |
Set continuous bit streaming for compressed formats.
Definition at line 350 of file ZdcSubBlock.h.
◆ setUnpackErrorCode()
void ZdcSubBlock::setUnpackErrorCode |
( |
int |
code | ) |
|
|
inline |
◆ slice()
int ZdcSubBlock::slice |
( |
| ) |
const |
|
inline |
◆ slices1()
int ZdcSubBlock::slices1 |
( |
| ) |
const |
|
inline |
◆ slices2()
int ZdcSubBlock::slices2 |
( |
| ) |
const |
|
inline |
◆ subStatus()
uint32_t ZdcSubBlock::subStatus |
( |
| ) |
const |
|
inline |
◆ unpacker()
uint32_t ZdcSubBlock::unpacker |
( |
int |
nbits | ) |
|
Unpack given number of bits of data.
Definition at line 309 of file ZdcSubBlock.cxx.
317 int nbitsDone = nbits;
322 for (
int i = 1;
i < nbitsDone; ++
i)
mask |= (
mask << 1);
334 const int bitsLeft = nbits - nbitsDone;
341 for (
int i = 1;
i < bitsLeft; ++
i)
mask |= (
mask << 1);
◆ unpackerInit()
void ZdcSubBlock::unpackerInit |
( |
| ) |
|
◆ 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.
395 if (pin >= 0 && pin < s_maxPins && nbits > 0
397 for (
int bit = 0; bit < nbits; ++bit) {
◆ unpackerNeutralParityError()
bool ZdcSubBlock::unpackerNeutralParityError |
( |
int |
pin | ) |
|
Unpack and test G-Link parity bit for given pin.
Definition at line 408 of file ZdcSubBlock.cxx.
415 error = !(bit == parity);
◆ unpackErrorCode()
int ZdcSubBlock::unpackErrorCode |
( |
| ) |
const |
|
inline |
◆ unpackErrorMsg()
std::string ZdcSubBlock::unpackErrorMsg |
( |
| ) |
const |
Return the unpacking error message for printing.
Definition at line 206 of file ZdcSubBlock.cxx.
214 msg =
"Unsupported Data Version";
217 msg =
"Unsupported Data Format";
220 msg =
"Unsupported Compression Version";
223 msg =
"Unsupported Number of Slices for Compression Version";
226 msg =
"Premature End of Sub-block Data";
229 msg =
"Invalid Source ID in Sub-block Data";
232 msg =
"Invalid Word ID in Sub-block Data";
235 msg =
"Unknown Error Code";
◆ unpackerSuccess()
bool ZdcSubBlock::unpackerSuccess |
( |
| ) |
const |
|
inline |
◆ upstreamError()
bool ZdcSubBlock::upstreamError |
( |
| ) |
const |
|
inline |
◆ version()
int ZdcSubBlock::version |
( |
| ) |
const |
|
inline |
◆ wordId() [1/2]
int ZdcSubBlock::wordId |
( |
| ) |
const |
|
inline |
◆ 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.
◆ wordType()
◆ write()
Output complete packed sub-block to ROD vector.
Definition at line 147 of file ZdcSubBlock.cxx.
151 std::vector<uint32_t>::const_iterator
pos;
153 theROD->push_back(*
pos);
◆ m_bitword
uint32_t ZdcSubBlock::m_bitword |
|
private |
◆ 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 |
◆ m_currentPinBit
std::vector<int> ZdcSubBlock::m_currentPinBit |
|
private |
◆ m_data
std::vector<uint32_t> ZdcSubBlock::m_data |
|
private |
◆ m_dataPos
std::vector<uint32_t>::const_iterator ZdcSubBlock::m_dataPos |
|
private |
◆ m_dataPosEnd
std::vector<uint32_t>::const_iterator ZdcSubBlock::m_dataPosEnd |
|
private |
◆ m_dataWords
int ZdcSubBlock::m_dataWords |
|
private |
◆ m_header
uint32_t ZdcSubBlock::m_header |
|
private |
◆ m_maxBits
int ZdcSubBlock::m_maxBits |
|
private |
◆ m_maxMask
uint32_t ZdcSubBlock::m_maxMask |
|
private |
◆ m_oddParity
std::vector<int> ZdcSubBlock::m_oddParity |
|
private |
◆ m_trailer
uint32_t ZdcSubBlock::m_trailer |
|
private |
◆ m_unpackerFlag
bool ZdcSubBlock::m_unpackerFlag |
|
private |
◆ m_unpackError
int ZdcSubBlock::m_unpackError |
|
private |
◆ s_bcnMismatchBit
const int ZdcSubBlock::s_bcnMismatchBit = 2 |
|
staticprivate |
◆ s_crateBit
const int ZdcSubBlock::s_crateBit = 12 |
|
staticprivate |
◆ s_crateMask
const uint32_t ZdcSubBlock::s_crateMask = 0xf |
|
staticprivate |
◆ s_daqOverflowBit
const int ZdcSubBlock::s_daqOverflowBit = 3 |
|
staticprivate |
◆ s_failingBcnBit
const int ZdcSubBlock::s_failingBcnBit = 22 |
|
staticprivate |
◆ s_failingBcnMask
const uint32_t ZdcSubBlock::s_failingBcnMask = 0x3f |
|
staticprivate |
◆ s_formatBit
const int ZdcSubBlock::s_formatBit = 22 |
|
staticprivate |
◆ s_formatMask
const uint32_t ZdcSubBlock::s_formatMask = 0x7 |
|
staticprivate |
◆ s_glinkDavSet
const uint32_t ZdcSubBlock::s_glinkDavSet = 0x400000 |
|
staticprivate |
◆ s_glinkDownBit
const int ZdcSubBlock::s_glinkDownBit = 6 |
|
staticprivate |
◆ s_glinkParityBit
const int ZdcSubBlock::s_glinkParityBit = 0 |
|
staticprivate |
◆ s_glinkProtocolBit
const int ZdcSubBlock::s_glinkProtocolBit = 1 |
|
staticprivate |
◆ s_glinkTimeoutBit
const int ZdcSubBlock::s_glinkTimeoutBit = 7 |
|
staticprivate |
◆ 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 |
◆ s_headerVal
const uint32_t ZdcSubBlock::s_headerVal = 0x3 |
|
staticprivate |
◆ s_maxPins
const int ZdcSubBlock::s_maxPins = 20 |
|
staticprivate |
◆ s_maxStreamedBits
const int ZdcSubBlock::s_maxStreamedBits = 31 |
|
staticprivate |
◆ s_maxStreamedMask
const uint32_t ZdcSubBlock::s_maxStreamedMask = 0x7fffffff |
|
staticprivate |
◆ s_maxWordBits
const int ZdcSubBlock::s_maxWordBits = 32 |
|
staticprivate |
◆ s_maxWordMask
const uint32_t ZdcSubBlock::s_maxWordMask = 0xffffffff |
|
staticprivate |
◆ s_moduleBit
const int ZdcSubBlock::s_moduleBit = 8 |
|
staticprivate |
◆ s_moduleMask
const uint32_t ZdcSubBlock::s_moduleMask = 0xf |
|
staticprivate |
◆ s_seqnoBit
const int ZdcSubBlock::s_seqnoBit = 16 |
|
staticprivate |
◆ s_seqnoMask
const uint32_t ZdcSubBlock::s_seqnoMask = 0x3f |
|
staticprivate |
◆ s_slices1Bit
const int ZdcSubBlock::s_slices1Bit = 0 |
|
staticprivate |
◆ s_slices1Mask
const uint32_t ZdcSubBlock::s_slices1Mask = 0x7 |
|
staticprivate |
◆ s_slices2Bit
const int ZdcSubBlock::s_slices2Bit = 3 |
|
staticprivate |
◆ s_slices2Mask
const uint32_t ZdcSubBlock::s_slices2Mask = 0x1f |
|
staticprivate |
◆ s_statusBit
const int ZdcSubBlock::s_statusBit = 28 |
|
staticprivate |
◆ s_statusMask
const uint32_t ZdcSubBlock::s_statusMask = 0x1 |
|
staticprivate |
◆ s_statusVal
const uint32_t ZdcSubBlock::s_statusVal = 0x1 |
|
staticprivate |
◆ s_upstreamErrorBit
const int ZdcSubBlock::s_upstreamErrorBit = 4 |
|
staticprivate |
◆ s_versionBit
const int ZdcSubBlock::s_versionBit = 25 |
|
staticprivate |
◆ s_versionMask
const uint32_t ZdcSubBlock::s_versionMask = 0x7 |
|
staticprivate |
◆ s_wordIdBit
const int ZdcSubBlock::s_wordIdBit = 28 |
|
staticprivate |
◆ s_wordIdMask
const uint32_t ZdcSubBlock::s_wordIdMask = 0xf |
|
staticprivate |
The documentation for this class was generated from the following files:
uint32_t m_trailer
Sub-Block Status Trailer.
bool glinkTimeout() const
std::vector< uint32_t > m_data
Sub-Block data.
bool glinkProtocol() const
std::vector< uint32_t >::const_iterator m_dataPosEnd
static const uint32_t s_seqnoMask
static const uint32_t s_glinkDavSet
static const int s_wordIdBit
uint32_t unpackerNeutral(int pin, int nbits)
Unpack given number of bits of neutral data for given pin.
int m_bunchCrossing
Bunch Crossing number (neutral format only)
static const int s_formatBit
static const int s_maxStreamedBits
static const uint32_t s_maxStreamedMask
static const int s_upstreamErrorBit
static const uint32_t s_maxWordMask
bool upstreamError() const
static const uint32_t s_statusMask
static const int s_statusBit
std::vector< int > m_oddParity
static const int s_glinkTimeoutBit
int m_dataWords
Current number of data words.
std::vector< int > m_currentPinBit
static const int s_glinkParityBit
static const int s_slices1Bit
static SubBlockWordType wordType(uint32_t word)
Word identification.
static const uint32_t s_crateMask
static const uint32_t s_versionMask
static const int s_versionBit
const DataType * PointerType
static const uint32_t s_failingBcnMask
uint32_t m_header
Sub-Block Header.
@ UNPACK_COMPRESSION_VERSION
static const uint32_t s_headerVal
static const int s_bcnMismatchBit
void setStatus(uint32_t failingBCN, bool glinkTimeout, bool glinkDown, bool upstreamError, bool daqOverflow, bool bcnMismatch, bool glinkProtocol, bool glinkParity)
Store error status trailer.
static const uint32_t s_statusVal
int m_unpackError
Unpacking error code.
@ UNPACK_COMPRESSION_SLICES
static const int s_slices2Bit
static const int s_glinkProtocolBit
static const int s_crateBit
static const int s_maxPins
void packerNeutral(int pin, uint32_t datum, int nbits)
Pack given neutral data from given pin.
uint32_t failingBCN() const
def init(v_theApp, v_rootStream=None)
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;...
static const int s_daqOverflowBit
static const uint32_t s_slices2Mask
static const uint32_t s_moduleMask
static const int s_maxWordBits
static const uint32_t s_slices1Mask
static const int s_moduleBit
std::vector< uint32_t >::const_iterator m_dataPos
static const int s_glinkDownBit
static int parityBit(int init, uint32_t datum, int nbits)
Return the parity bit for given data.
static const uint32_t s_formatMask
static const int s_seqnoBit
static const uint32_t s_wordIdMask
static const int s_failingBcnBit
static const uint32_t s_headerMask