156 const int flag)
const
158 unsigned int hits = 0;
169 const int flag)
const
192 const unsigned int map)
204 const int loc,
const int energy,
const int isol,
225 if (
chip < chipOld) {
240 const unsigned int hits,
const int error)
322 unsigned int ix =
cpm - 1;
340 const int flag)
const
342 unsigned int ix = (source<<1)|flag;
351 unsigned int ix = source;
391 const int cpm = pin + 1;
469 std::vector<uint32_t>::const_iterator pos;
486 int fifoOverflow = 0;
525 int error = parityMerge;
531 const int cpm = pin + 1;
static const int s_isolationBits
static const uint32_t s_tobChipMask
bool unpackNeutral()
Unpack neutral data.
unsigned int hits(int slice, int source, int flag) const
Return hit/topo counts for given source ID and HL flag.
static const int s_parityErrorMask
static const int s_parityErrorBits
int roiOverflow(int slice, int source) const
Return RoI overflow for given source ID.
static const int s_threshErrorBit
static const int s_tobIsolationBit
static const int s_tobOverflowBit
static const int s_tobChipBit
static const int s_bunchCrossingBits
static const int s_threshBit
bool packUncompressed()
Pack uncompressed data.
static const int s_tobsPerModule
void clear()
Clear all data.
bool unpackUncompressed()
Unpack uncompressed data.
static const uint32_t s_sourceIdMask
static const int s_tobWordId
static const int s_hlFlagBit
int energy(int slice, int cpm, int tob) const
Return energy for given cpm and tob.
static const int s_sourceIdBit
static const int s_hitsErrorBits
static const uint32_t s_tobCoordMask
bool unpack()
Unpack data.
std::vector< int > m_overflow
RoI overflows for neutral data.
static const int s_fifoOverflowBits
static const int s_glinkPins
static const uint32_t s_hlFlagMask
std::vector< uint32_t > m_tobData
TOB data.
static const int s_energyBits
static const int s_topoChecksumBits
static const int s_tobEnergyBit
static const uint32_t s_threshMask
static const int s_tobCoordBit
void setPresenceMap(int slice, int cpm, unsigned int map)
Store presence map.
int sourceId(uint32_t word) const
static const int s_topoPaddingBits
unsigned int tobIndex(int slice, int cpm, int tob) const
static const int s_coordBits
int hitsError(int slice, int source, int flag) const
Return hit error for given source ID and HL flag.
static const uint32_t s_dataWordIdMask
bool packNeutral()
Pack neutral data.
static const int s_modules
static const int s_roiOverflowBits
static const int s_tobCpmBit
std::vector< int > m_cpmTobCount
CPM TOB count vector for unpacking.
static const uint32_t s_tobCpmMask
static const int s_muxPhases
unsigned int mapIndex(int slice, int cpm) const
unsigned int presenceMap(int slice, int cpm) const
Return presence map for given CPM.
unsigned int ovfIndex(int slice, int source) const
static const int s_presenceBits
static const int s_hitsBits
int dataWordId(uint32_t word) const
static const uint32_t s_tobEnergyMask
std::vector< uint32_t > m_hitsData
Hits and topo data.
static const int s_wordLength
Data word length.
static const int s_threshWordId
void setHits(int slice, int source, int flag, unsigned int hits, int error)
Store hit counts for given source ID and HL flag.
void setRoiOverflow(int slice, int source, int overflow)
Store RoI overflow for given source ID.
int chip(int slice, int cpm, int tob) const
Return chip for given cpm and tob.
static const int s_paddingBits
int localCoord(int slice, int cpm, int tob) const
Return Local coordinate for given cpm and tob.
int isolation(int slice, int cpm, int tob) const
Return isolation for given cpm and tob.
static const uint32_t s_errorMask
int hlFlag(uint32_t word) const
static const int s_topoCountsBits
int tobError(int slice, int cpm, int tob) const
Return error bits for given cpm and tob.
static const int s_dataWordIdBit
static const int s_topoMapBits
std::vector< unsigned int > m_presenceMaps
Presence maps.
static const int s_tobErrorBit
int cpm(uint32_t word) const
void setTob(int slice, int cpm, int chip, int loc, int energy, int isol, int error)
Store TOB (RoI) data for given CPM, chip, local coord.
static const uint32_t s_tobIsolationMask
static const uint32_t s_tobErrorMask
unsigned int hitIndex(int slice, int source, int flag) const
void setDaqOverflow(int bit=1)
Set DAQ FIFO Overflow bit in Sub-status word.
void setGlinkParity(int bit=1)
Set G-Link Parity bit in Sub-status word.
void packer(uint32_t datum, int nbits)
Pack given data into given number of bits.
uint32_t unpacker(int nbits)
Unpack given number of bits of data.
void setUnpackErrorCode(int code)
Set the unpacking error code.
bool unpackerSuccess() const
Return unpacker success flag.
bool unpackerNeutralParityError(int pin)
Unpack and test G-Link parity bit for given pin.
void clear()
Clear all data.
void packerNeutralParity(int pin)
Pack current G-Link parity bit for given pin.
void packerFlush()
Flush the current data word padded with zeros.
uint32_t unpackerNeutral(int pin, int nbits)
Unpack given number of bits of neutral data for given pin.
int bunchCrossing() const
Return the Bunch Crossing number (neutral format only)
void unpackerInit()
Initialise unpacker.
void packerNeutral(int pin, uint32_t datum, int nbits)
Pack given neutral data from given pin.
void setBunchCrossing(int bc)
Set the Bunch Crossing number (neutral format only)
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Extra patterns decribing particle interation process.