|
ATLAS Offline Software
|
Go to the documentation of this file.
68 m_unpackError(UNPACK_NONE),
69 m_bitword(0), m_currentBit(0),
70 m_maxBits(s_maxWordBits),
71 m_maxMask(s_maxWordMask),
72 m_unpackerFlag(false),
73 m_currentPinBit(s_maxPins),
74 m_oddParity(s_maxPins, 1),
103 const int format,
const int seqno,
104 const int crate,
const int module,
105 const int slices2,
const int slices1)
129 for (;
pos != pose; ++
pos) {
151 std::vector<uint32_t>::const_iterator
pos;
153 theROD->push_back(*
pos);
161 const bool glinkTimeout,
const bool glinkDown,
const bool upstreamError,
162 const bool daqOverflow,
const bool bcnMismatch,
163 const bool glinkProtocol,
const bool glinkParity)
190 else setStatus(0,
false,
false,
false,
true,
false,
false,
false);
200 else setStatus(0,
false,
false,
false,
false,
false,
false,
true);
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";
247 const int maxBits = 32;
249 for (
int i = 0;
i < maxBits; ++
i) {
250 if ( !(datum >>
i)) {
265 for (
int bit = 0; bit < nbits; ++bit) parity ^= (datum >> bit) & 0x1;
275 for (
int i = 1;
i < nbits; ++
i)
mask |= (
mask << 1);
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);
367 if (pin >= 0 && pin < s_maxPins && nbits > 0) {
372 for (
int bit = 0; bit < nbits; ++bit) {
395 if (pin >= 0 && pin < s_maxPins && nbits > 0
397 for (
int bit = 0; bit < nbits; ++bit) {
415 error = !(bit == parity);
uint32_t m_trailer
Sub-Block Status Trailer.
bool glinkTimeout() const
void unpackerInit()
Initialise unpacker.
std::vector< uint32_t > m_data
Sub-Block data.
void setDaqOverflow(int bit=1)
Set DAQ FIFO Overflow bit in Sub-status word.
bool glinkProtocol() const
std::vector< uint32_t >::const_iterator m_dataPosEnd
static const uint32_t s_seqnoMask
void write(FullEventAssembler< ZdcSrcIdMap >::RODDATA *theROD) const
Output complete packed sub-block to ROD vector.
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
void setHeader(int wordId, int version, int format, int seqno, int crate, int module, int slices2, int slices1)
Store header data.
bool upstreamError() const
static int minBits(uint32_t datum)
Return the minimum number of bits needed for given data.
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
bool unpackerNeutralParityError(int pin)
Unpack and test G-Link parity bit for given pin.
void packerFlush()
Flush the current data word padded with zeros.
static SubBlockWordType wordType(uint32_t word)
Word identification.
static const int s_slices1Bit
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.
void packerNeutralParity(int pin)
Pack current G-Link parity bit for given pin.
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)
uint32_t unpacker(int nbits)
Unpack given number of bits of data.
void packer(uint32_t datum, int nbits)
Pack given data into given number of bits.
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
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.
static const uint32_t s_slices2Mask
static const uint32_t s_moduleMask
static const int s_maxWordBits
void setGlinkParity(int bit=1)
Set G-Link Parity bit in Sub-status word.
static const uint32_t s_slices1Mask
static const int s_moduleBit
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
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
void clear()
Clear all data.
std::string unpackErrorMsg() const
Return the unpacking error message for printing.