|
ATLAS Offline Software
|
Go to the documentation of this file.
59 m_unpackError(UNPACK_NONE),
60 m_bitword(0), m_currentBit(0),
61 m_maxBits(s_maxWordBits),
62 m_maxMask(s_maxWordMask),
63 m_unpackerFlag(false),
64 m_currentPinBit(s_maxPins),
65 m_oddParity(s_maxPins, 1),
100 const int format,
const int seqno,
101 const int crate,
const int module,
102 const int slices2,
const int slices1)
126 for (;
pos != pose; ++
pos)
144 const int id =
wordId(word);
151 else if (
wordId() == 0xc) badId = (((
id & 0xc) != 0x4) &&
152 ((
id & 0xc) != 0x8));
154 else badId = ((
id & 0xc) != 0);
169 std::vector<uint32_t>::const_iterator
pos;
172 theROD->push_back(*
pos);
180 const bool glinkTimeout,
const bool glinkDown,
const bool upstreamError,
181 const bool daqOverflow,
const bool bcnMismatch,
182 const bool glinkProtocol,
const bool glinkParity)
211 else setStatus(0,
false,
false,
false,
true,
false,
false,
false);
222 else setStatus(0,
false,
false,
false,
false,
false,
false,
true);
237 msg =
"Unsupported Data Version";
240 msg =
"Unsupported Data Format";
243 msg =
"Unsupported Compression Version";
246 msg =
"Unsupported Number of Slices for Compression Version";
249 msg =
"Premature End of Sub-block Data";
252 msg =
"Excess Data in Sub-block";
255 msg =
"Invalid Source ID in Sub-block Data";
258 msg =
"Excess TOBs in Sub-block Data";
261 msg =
"Invalid word ID in Sub-block Data";
264 msg =
"Unknown Error Code";
276 const int maxBits = 32;
278 for (
int i = 0;
i < maxBits; ++
i)
292 const int nbits)
const
296 for (
int bit = 0; bit < nbits; ++bit) parity ^= (datum >> bit) & 0x1;
355 int nbitsDone = nbits;
375 const int bitsLeft = nbits - nbitsDone;
416 if (pin >= 0 && pin < s_maxPins && nbits > 0)
423 for (
int bit = 0; bit < nbits; ++bit)
448 if (pin >= 0 && pin < s_maxPins && nbits > 0
451 for (
int bit = 0; bit < nbits; ++bit)
472 error = !(bit == parity);
static const int s_moduleBit
static const int s_bcnMismatchBit
static const int s_daqOverflowBit
@ UNPACK_COMPRESSION_VERSION
void clear()
Clear all data.
static const uint32_t s_wordIdMask
void packerNeutral(int pin, uint32_t datum, int nbits)
Pack given neutral data from given pin.
static const int s_failingBcnBit
std::vector< uint32_t >::const_iterator m_dataPosEnd
static const int s_formatBit
static const int s_glinkParityBit
static const uint32_t s_glinkDavSet
void setGlinkParity(int bit=1)
Set G-Link Parity bit in Sub-status word.
void unpackerInit()
Initialise unpacker.
int minBits(uint32_t datum) const
Return the minimum number of bits needed for given data.
static const int s_glinkDownBit
void write(FullEventAssembler< L1CaloSrcIdMap >::RODDATA *theROD) const
Output complete packed sub-block to ROD vector.
static const uint32_t s_slices1Mask
static const uint32_t s_failingBcnMask
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.
void setHeader(int wordId, int version, int format, int seqno, int crate, int module, int slices2, int slices1)
Store header data.
static const uint32_t s_headerVal
static const uint32_t s_slices2Mask
static const uint32_t s_statusVal
void packerFlush()
Flush the current data word padded with zeros.
bool upstreamError() const
static const uint32_t s_seqnoMask
static const uint32_t s_moduleMask
const DataType * PointerType
static const int s_upstreamErrorBit
void packer(uint32_t datum, int nbits)
Pack given data into given number of bits.
uint32_t failingBCN() const
std::vector< uint32_t > m_data
Sub-Block data.
@ UNPACK_COMPRESSION_SLICES
bool glinkTimeout() const
static const int s_statusBit
static const int s_ppmCrates
void setDaqOverflow(int bit=1)
Set DAQ FIFO Overflow bit in Sub-status word.
std::vector< int > m_currentPinBit
bool unpackerNeutralParityError(int pin)
Unpack and test G-Link parity bit for given pin.
int m_unpackError
Unpacking error code.
int m_bunchCrossing
Bunch Crossing number (neutral format only)
uint32_t unpacker(int nbits)
Unpack given number of bits of data.
static const uint32_t s_maxStreamedMask
static const int s_maxWordBits
bool glinkProtocol() const
static SubBlockWordType wordType(uint32_t word)
Word identification.
std::vector< int > m_oddParity
std::string unpackErrorMsg() const
Return the unpacking error message for printing.
static const int s_glinkProtocolBit
static const uint32_t s_versionMask
static const uint32_t s_maxWordMask
static const int s_slices1Bit
static const uint32_t s_formatMask
uint32_t m_trailer
Sub-Block Status Trailer.
static const int s_seqnoBit
std::vector< uint32_t >::const_iterator m_dataPos
static const int s_headerBit
uint32_t m_header
Sub-Block Header.
static const int s_maxPins
def init(v_theApp, v_rootStream=None)
static const uint32_t s_statusMask
static const int s_maxStreamedBits
static const uint32_t s_headerMask
std::vector< uint32_t > m_unpackingMasks
Unpacking masks.
int parityBit(int init, uint32_t datum, int nbits) const
Return the parity bit for given data.
static const int s_wordIdBit
static const int s_crateBit
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
uint32_t unpackerNeutral(int pin, int nbits)
Unpack given number of bits of neutral data for given pin.
static const int s_slices2Bit
static const uint32_t s_crateMask
int m_dataWords
Current number of data words.
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 int s_versionBit
void packerNeutralParity(int pin)
Pack current G-Link parity bit for given pin.
static const int s_glinkTimeoutBit