GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSEC / dev > qsec_wb / rhel5-64
#include <expand_p.h>
#include <decode.h>
#include <decompress.h>
#include <raw.h>
#include <QSEC_ctx_p.h>
#include <EDS/EBF_ctb.h>
#include <EDS/EBF_gem.h>
#include <EDS/EBF_tem.h>
#include <EDS/EBF_cal.h>
#include <EDS/EBF_tkr.h>
#include <QSE/QSE_ebf.h>
#include <QSE/QSE_aemRepack.h>
#include <QSE/QSE_aem.h>
#include <PBI/Endianness.h>
#include <PBI/PTR.h>
#include <LCBD/LATP.h>
#include <string.h>
Classes | |
struct | QSEC_acdRaw |
Private structure holding raw data for an ACD contribution. More... | |
struct | QSEC_calRaw |
Private structure holding "raw" data for a CAL event. More... | |
Defines | |
#define | N_INT_BITS 32 |
Functions | |
static __inline void | fixCtbHdr (EBF_ctbHdr *hdr) |
When the ACD is not included in the output stream (as it is now), the final TEM contribution (if present) must have its response bit removed. | |
static __inline void | genCtbHdr (int twr, unsigned int dMap, const EBF_ctbHdr *gHdr, EBF_ctbHdr *tHdr) |
Generate a TEM contribution header from the GEM header. | |
static __inline void * | roundUpPtr (void *ptr, int r) |
Round the specified pointer up to a specified binary boundary. | |
static __inline unsigned int | roundUpInt (unsigned int ui, int r) |
Round the specified integer up to a binary boundary. | |
static __inline unsigned short * | decodeShorts (unsigned short *us, int cnt, QSEC_decompression *dcmp, APD_dtx *dtx) |
Decode the required number of symbols from the compressed stream and stores them as shorts. | |
static __inline unsigned int | getWord (int leng, const unsigned int **bufp, int *boff) |
Get an arbitrary length word from an integer buffer. | |
static __inline void | setWord (int leng, unsigned int value, unsigned int **bufp, int *boff) |
Set an arbitrary length word into an integer buffer. | |
static __inline unsigned int | getBit (int index, const unsigned int *buff) |
Get a bit from an integer buffer. | |
static __inline unsigned int | getNib (int index, const unsigned int *buff) |
Get a nibble from an integer buffer. | |
static unsigned int * | copyContrib (const unsigned char **ctb, unsigned int *evt) |
static unsigned int * | decodeAcd (QSEC_expansion *exp, const EBF_ctbHdr *aHdr, const QSEC_acdRaw *raw, unsigned int *evt) |
static unsigned int * | decodeCal (QSEC_expansion *exp, const EBF_ctbHdr *gHdr, const unsigned char *ibuf, unsigned int *evt) |
static unsigned int * | decodeCalV3 (QSEC_expansion *exp, const EBF_ctbHdr *tHdr, const QSEC_calRaw *raw, unsigned int *evt) |
static unsigned int * | decodeCalV2 (QSEC_expansion *exp, const EBF_ctbHdr *tHdr, unsigned int *evt) |
static unsigned int * | decodeCalV1 (QSEC_expansion *exp, const EBF_ctbHdr *tHdr, unsigned int *evt) |
static unsigned int * | decodeGem (QSEC_expansion *exp, const EBF_ctbHdr *gHdr, unsigned int *evt) |
static unsigned int * | decodeTkr (QSEC_expansion *exp, const EBF_ctbHdr *gHdr, const unsigned char *ibuf, unsigned int *evt) |
static unsigned int * | decodeTkrV1 (QSEC_expansion *exp, const EBF_ctbHdr *tHdr, unsigned int *evt) |
static unsigned int * | decodeTkrTots (unsigned char *tot, int ntots, QSEC_decompression *tots, APD_dtx *dtx) |
static void | expandGem (QSEC_expansion *exp, EBF_gem *gem) |
void | QSEC_update (QSEC_expansion *exp, EBF_gem *gem, unsigned int *seq, const unsigned int *ievt) |
Decode the GEM contribution and extract the 17 bit event sequence. | |
unsigned int | QSEC_decode (QSEC_expansion *exp, QSE_ebfEvt *oevt, const unsigned int *ievt) |
Decode the event held in the expansion structure into the QSE_evt structure. |
static __inline unsigned short* decodeShorts | ( | unsigned short * | us, | |
int | cnt, | |||
QSEC_decompression * | dcmp, | |||
APD_dtx * | dtx | |||
) | [static] |
Decode the required number of symbols from the compressed stream and stores them as shorts.
us | The pointer to the unsigned short storeage array | |
cnt | The number of symbols to decode and store as short integer | |
dcmp | The decompression context | |
dtx | The compressed bit stream |
References QSEC_decompress().
static __inline void fixCtbHdr | ( | EBF_ctbHdr * | hdr | ) | [static] |
When the ACD is not included in the output stream (as it is now), the final TEM contribution (if present) must have its response bit removed.
hdr | The contribution header to patch |
static __inline void genCtbHdr | ( | int | twr, | |
unsigned int | dMap, | |||
const EBF_ctbHdr * | gHdr, | |||
EBF_ctbHdr * | tHdr | |||
) | [static] |
Generate a TEM contribution header from the GEM header.
twr | The tower (TEM) number. | |
dMap | The map of TEMs with diagnostics, TEM 0 = MSB. | |
gHdr | The address of the GEM header. | |
tHdr | The address of the TEM contribution header to generate. |
static __inline unsigned int getBit | ( | int | index, | |
const unsigned int * | buff | |||
) | [static] |
Get a bit from an integer buffer.
The bits are numbered from low to high order within each integer.
index | The index of the bit to be obtained. | |
buff | Address of the integer buffer. |
static __inline unsigned int getNib | ( | int | index, | |
const unsigned int * | buff | |||
) | [static] |
Get a nibble from an integer buffer.
The bits are numbered from low to high order within each integer.
index | The index of the nibble to be obtained. | |
buff | Address of the integer buffer. |
static __inline unsigned int getWord | ( | int | leng, | |
const unsigned int ** | bufp, | |||
int * | boff | |||
) | [static] |
Get an arbitrary length word from an integer buffer.
leng | The length, in bits, of the word to get. | |
bufp | Pointer to a pointer to the current location in the buffer. The latter is updated whenever the requested word reaches or crosses an integer boundary. | |
boff | Pointer to the bit offset, from high order to low within the current (32-bit) integer in the buffer. The offset is updated to just beyond the fetched word. |
unsigned int QSEC_decode | ( | QSEC_expansion * | exp, | |
QSE_ebfEvt * | oevt, | |||
const unsigned int * | ievt | |||
) |
Decode the event held in the expansion structure into the QSE_evt structure.
exp | Pointer to the expansion structure holding the histograms and encoder context | |
oevt | Pointer to the location to output the decoded event | |
ievt | Pointer to the location to input the encoded event |
References QSEC_summary::aem, QSEC_expansion_::dtx, QSEC_summary::gem, QSEC_expansion_::gem, QSEC_expansion_::mode, QSEC_CURRENT_VERSION, QSEC_unpackRaw(), QSEC_VERS_FIXED_CAL, QSEC_VERS_NEW_SCHEME, QSEC_VERS_NEWER, QSEC_gemDecompress::raw, QSEC_summary::tem, and QSEC_expansion_::ver.
Referenced by QSEC_expand().
void QSEC_update | ( | QSEC_expansion * | exp, | |
EBF_gem * | gem, | |||
unsigned int * | seq, | |||
const unsigned int * | ievt | |||
) |
Decode the GEM contribution and extract the 17 bit event sequence.
exp | Pointer to the expansion structure holding the histograms and encoder context | |
gem | Pointer to the location to place the decoded GEM contribution | |
seq | Pointer to the location to place the 17-bit event sequence number | |
ievt | Pointer to the location to input the encoded event number for use in QSE_ctxUpdateAtEvent |
References QSEC_expansion_::dtx, QSEC_expansion_::gem, QSEC_expansion_::mode, QSEC_unpackRaw(), QSEC_VERS_FIXED_CAL, QSEC_VERS_ORIGINAL, QSEC_gemDecompress::raw, and QSEC_expansion_::ver.
Referenced by QSEC_updateAtRecord().
static __inline unsigned int roundUpInt | ( | unsigned int | ui, | |
int | r | |||
) | [static] |
Round the specified integer up to a binary boundary.
ui | The integer to round | |
r | The boundary to round to. This must be a power of 2, i.e. 1, 2, 4, 8 etc |
static __inline void* roundUpPtr | ( | void * | ptr, | |
int | r | |||
) | [static] |
Round the specified pointer up to a specified binary boundary.
ptr | The pointer to round | |
r | The boundary to round to. This must be a power of 2, i.e. 1, 2, 4, 8 etc |
static __inline void setWord | ( | int | leng, | |
unsigned int | value, | |||
unsigned int ** | bufp, | |||
int * | boff | |||
) | [static] |
Set an arbitrary length word into an integer buffer.
leng | The length, in bits, of the word to set. | |
value | The value of the word to set. | |
bufp | Pointer to a pointer to the current location in the buffer. The latter is updated whenever the set word reaches or crosses an integer boundary. | |
boff | Pointer to the bit offset, from high order to low within the current (32-bit) integer in the buffer. The offset is updated to just beyond the set word. |