GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSEC / V2-0-0

Constituent: qsec     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

decode.c File Reference

Routines to decode the event data. More...

#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_aemRepack.h"
#include "QSE/QSE_aem.h"
#include "PBI/Endianness.h"
#include <string.h>

Include dependency graph for decode.c:


Data Structures

struct  QSEC_acdRaw
 Private structure holding raw data for an ACD contribution. More...

Functions

static __inline void fixupCtbHdr (EBF_ctbHdr *hdr)
 When the ACD is not included in the output stream (as it is now), the final TEM contribution must have its response bit removed.
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 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 unsigned int * decodeGem (QSEC_expansion *exp, const QSEC_summary *sum, unsigned int *evt)
 Decode the GEM contribution.
static unsigned int * decodeAcd (QSEC_expansion *exp, const QSEC_summary *sum, unsigned int *evt)
 Decode an ACD event.
static unsigned int * decodeCal (QSEC_expansion *exp, const QSEC_summary *sum, unsigned int *evt)
 Decode a CAL event.
static unsigned int * decodeTkr (QSEC_expansion *exp, const QSEC_summary *sum, unsigned int *evt)
 Decode a tracker event.
static unsigned int * decodeTkrTots (unsigned char *tot, int ntots, QSEC_decompression *tots, APD_dtx *dtx)
 Decompress the tracker TOTS.
static void expandGem (QSEC_expansion *exp, EBF_gem *gem)
 Populate the data portion of a GEM contribution.
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, void *oevt, const unsigned int *ievt)
 Decode the event held in the expansion structure into the QSE_evt structure.
static __inline void decodeCalDiag (EBF_temDiag *diag[LSEC_N_TWR], unsigned int map, QSEC_decompression *dcmp, APD_dtx *dtx)
 Decode the CAL portion of the diagnostic block.
static __inline unsigned char * calcTkrTotAdr (unsigned char *ptr, int nstrips)
 Encapsulate the calculation of the TOT storage address.
static __inline void decodeTkrDiag (EBF_temDiag *diag[LSEC_N_TWR], unsigned int map, QSEC_decompression *dcmp, APD_dtx *dtx)
 Decode the tracker portion of the diagnostic block.

Detailed Description

Routines to decode the event data.

Author:
James Swain & Owen Saxton
Id
decode.c,v 1.17 2007/04/05 22:58:24 saxton Exp

Function Documentation

static __inline unsigned char* calcTkrTotAdr unsigned char *  ptr,
int  nstrips
[static]
 

Encapsulate the calculation of the TOT storage address.

Parameters:
ptr The address of the end of the last 12-byte block of strips
nstrips The number of strips stored in this 12-byte block
Returns:
The byte address to begin storing the TOTs

unsigned int * decodeAcd QSEC_expansion exp,
const QSEC_summary sum,
unsigned int *  evt
[static]
 

Decode an ACD event.

Parameters:
exp Expansion structure
sum Pointer to the collection of contribution headers
evt Pointer to the event to fill
Returns:
Pointer to the end of the space occupied by this contribution

unsigned int * decodeCal QSEC_expansion exp,
const QSEC_summary sum,
unsigned int *  evt
[static]
 

Decode a CAL event.

Parameters:
exp Expansion structure
sum Pointer to the collection of contribution headers
evt Pointer to the event to fill

static __inline void decodeCalDiag EBF_temDiag *  diag[LSEC_N_TWR],
unsigned int  map,
QSEC_decompression dcmp,
APD_dtx *  dtx
[static]
 

Decode the CAL portion of the diagnostic block.

Parameters:
diag An array of pointers to each towers diagnostic block
map The map of struck towers, MSB = Tower 0
dcmp The decoding tables
dtx The bit stream to be decoded

unsigned int * decodeGem QSEC_expansion exp,
const QSEC_summary sum,
unsigned int *  evt
[static]
 

Decode the GEM contribution.

Parameters:
exp Expansion structure
sum Pointer to the collection of contribution headers
evt Pointer to the event to fill.
Returns:
Pointer to the end of the space occupied by this contribution

static 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.

Parameters:
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
Returns:
The pointer to the next storage location

unsigned int * decodeTkr QSEC_expansion exp,
const QSEC_summary sum,
unsigned int *  evt
[static]
 

Decode a tracker event.

Parameters:
exp Expansion structure
sum Pointer to the collection of contribution headers
evt Pointer to the event to be filled.

static __inline void decodeTkrDiag EBF_temDiag *  diag[LSEC_N_TWR],
unsigned int  map,
QSEC_decompression dcmp,
APD_dtx *  dtx
[static]
 

Decode the tracker portion of the diagnostic block.

Parameters:
diag An array of pointers to each towers diagnostic block
map The map of struck towers, MSB = Tower 0
dcmp The decoding tables
dtx The bit stream to be decoded

unsigned int * decodeTkrTots unsigned char *  tot,
int  ntots,
QSEC_decompression tots,
APD_dtx *  dtx
[static]
 

Decompress the tracker TOTS.

Parameters:
tot Pointer to where to store the decoded tots
ntots The number of TOTs to decode and fill
tots The decompression context for the TOTs
dtx The compressed bit stream descriptor
Returns:
Pointer to the next 32-bit word to be filled in

void expandGem QSEC_expansion exp,
EBF_gem *  gem
[static]
 

Populate the data portion of a GEM contribution.

Parameters:
exp Pointer to the expansion structure
gem Pointer to the GEM structure to populate

static __inline void fixupCtbHdr EBF_ctbHdr *  hdr  )  [static]
 

When the ACD is not included in the output stream (as it is now), the final TEM contribution must have its response bit removed.

Parameters:
hdr The contribution header to patch

unsigned int QSEC_decode QSEC_expansion exp,
void *  oevt,
const unsigned int *  ievt
 

Decode the event held in the expansion structure into the QSE_evt structure.

Parameters:
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
Returns:
Length, in bytes, of the event data

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.

Parameters:
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

static __inline unsigned int roundUpInt unsigned int  ui,
int  r
[static]
 

Round the specified integer up to a binary boundary.

Parameters:
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
Returns:
The rounded integer

static __inline void* roundUpPtr void *  ptr,
int  r
[static]
 

Round the specified pointer up to a specified binary boundary.

Parameters:
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
Returns:
The rounded pointer


Generated on Fri Apr 6 01:48:52 2007 by  doxygen 1.4.4