GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSE / V1-5-2

Constituent: qse     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QDF_tkr_std.c File Reference

Decodes the TKR data when in the encoded in standard fashion. More...

#include "QSE/QDF_tkr.h"
#include "QSE/QDF_exc.h"
#include "QSE/QSE_tkr.h"
#include "QDF_tkr_def.h"
#include "QDF_exc_def.h"
#include "EDS/FFS.h"
#include "LDT/BFU.h"
#include "LDT/BWU.h"
#include "LDT/BIT.h"
#include "dprintf.h"
#include "qdf_tkr_std_dbg.h"

Include dependency graph for QDF_tkr_std.c:


Defines

#define _get_strip(_bfu, _src, _pos, _strip, _nbits)
 Gets the next strip from the input stream.

Functions

static __inline BFU tkr_std_unpack_twr_maps (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR tower map and the tower class map.
static __inline BFU tkr_std_unpack_lyr_maps (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR layer maps.
static __inline BFU tkr_std_unpack_cnts (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR layer hit count.
static __inline BFU tkr_std_unpack_hits (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR hit strips.
static __inline BFU tkr_std_unpack_cwidths (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR cluster widths.
static __inline BFU tkr_std_unpack_tots (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR TOT values.
BFU QDF_tkrStdDecode (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR.
static __inline BFU layer_map_unpack (unsigned int *map, const unsigned int *src, unsigned int max, BFU bfu)
 Unpacks the 18-bit X and Y layer maps.
static __inline QSE_tkrLyrtower_and_layer_init (QDF_tkrTwr *twr, int twrNum, QSE_tkrLyr *lyr)
 Initializes portions of the tower and layer structures mainly concerned with the hit layers.
static __inline BFU layer_unpack_cmaps (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR layer hit count.
static __inline BFU layer_unpack_cnts_serial (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the number of counts in the layers where the count is not derivable from either the tower class or the strip ordering. The counts are represented as a number of consecutive 1s.
static __inline BFU layer_unpack_cnts_field (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the number of counts in the layers where the count is not derivable from either the tower class or the strip ordering. The counts are represented as a bit field. The first 3 bits gives the width of the bit field as a power of 2.
static __inline int establish_split_points (const QDF_tkrLimits *limits, QDF_tkrEvt *tkr)
 Uses the limits array to establish the lo and hi layer maps and count of layer ends, and hence, the number of TOTs.
static __inline int find_split_point (const QDF_tkrCluster *clusters, int nclusters, int hiLo, QDF_tkrLimitsLoHi limit, int twr, int lyr, QDF_exc *exc)
 Finds the split point for the given set of clusters.

Detailed Description

Decodes the TKR data when in the encoded in standard fashion.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: QDF_tkr_std.c,v 1.2 2006/11/10 23:07:49 russell Exp $

Define Documentation

#define _get_strip _bfu,
_src,
_pos,
_strip,
_nbits   ) 
 

Value:

(  _strip   = _bfu_extractBR (_bfu, _src, _pos),                 \
                                                                          \
            /* If the MSB is set, the next bit most be a 0 */             \
            _nbits   =  10 - _strip,                                      \
            (_strip <<10) | _bfu_extractR (_bfu, _src, _pos, _nbits))
Gets the next strip from the input stream.

Returns:
The strip number
Parameters:
_bfu The bit stream context
_src The data source, i.e. the bit stream
_pos The current bit position
_strip Returned as the fetched strip number
_nbits The number of bits that were read to get the strip number


Function Documentation

static __inline int establish_split_points const QDF_tkrLimits limits,
QDF_tkrEvt evt
[static]
 

Uses the limits array to establish the lo and hi layer maps and count of layer ends, and hence, the number of TOTs.

Returns:
The count of layer ends, and hence, the number of TOTs
Parameters:
limits The split point limits
evt The tracker event so far

static __inline int find_split_point const QDF_tkrCluster *  clusters,
int  nclusters,
int  hiLo,
QDF_tkrLimitsLoHi  limit,
int  twr,
int  lyr,
QDF_exc exc
[static]
 

Finds the split point for the given set of clusters.

Returns:
The cluster number of the first cluster in the high end.
  • If there are only LO end hits, this will be nclusters
  • If there are only HI end hits, this will be 0
  • If there are both LO and HI hits, this will be some number between [0, nsplits),
Parameters:
clusters The list of clusters
nclusters The number of clusters
hiLo A status word indicating whether there are LO and/or HI end hits
limit The lo and hi limits (both are inclusive.
twr The tower number, used for error reporting
lyr The layer number, used for error reporting
exc Exception handling context

static __inline BFU layer_map_unpack unsigned int *  map,
const unsigned int *  src,
unsigned int  max,
BFU  bfu
[static]
 

Unpacks the 18-bit X and Y layer maps.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
map Returned as a right justified bit map of the layers struck (bit 0 = layer 0)
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
The encoding of this is fairly involved, consisting of encoding
  • The OR of the X and Y maps. This may be encoded either 'asis' or as binary tree over the 18 bits as determined by the value of the first bit in the bit stream
  • The XOR of the X and Y maps (collapsed to only those layers that
  • The hits that are unique to only the X map.

After reconstituting these three values, the value of the X and Y layer maps can be recovered by first

  • Getting the hits common to the X and Y layers. This is just the OR of X and Y XOR with the XOR of the X and Y layers.
  • To get the X map, the common hits are OR'd into the unique X map.
  • To get the Y map, the X map is XOR'd into the XOR of the X and Y maps.

Warning:
Since this routine always pulls 1 bit from the input bit stream, it must not be called on empty towers. Such towers never emitted this bit.

static __inline BFU layer_unpack_cmaps QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR layer hit count.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU layer_unpack_cnts_field QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the number of counts in the layers where the count is not derivable from either the tower class or the strip ordering. The counts are represented as a bit field. The first 3 bits gives the width of the bit field as a power of 2.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU layer_unpack_cnts_serial QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the number of counts in the layers where the count is not derivable from either the tower class or the strip ordering. The counts are represented as a number of consecutive 1s.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

BFU QDF_tkrStdDecode QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
 

Decodes the TKR.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU tkr_std_unpack_cnts QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR layer hit count.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU tkr_std_unpack_cwidths QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR cluster widths.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
Warning:
This routine is not protected against 0 TKR clusters. It is the caller responsibility to screen these events out.

static __inline BFU tkr_std_unpack_hits QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR hit strips.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
Warning:
This routine is not protected against 0 TKR hits. It is the caller responsibility to screen these events out.

static __inline BFU tkr_std_unpack_lyr_maps QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR layer maps.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline BFU tkr_std_unpack_tots QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR TOT values.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer
Warning:
This routine is not protected against 0 TKR hits. It is the caller responsibility to screen these events out.

static __inline BFU tkr_std_unpack_twr_maps QDF_tkrCtx ctx,
QDF_tkrEvt evt,
const unsigned int *  src,
const unsigned int  max,
BFU  bfu
[static]
 

Decodes the TKR tower map and the tower class map.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The TKR compressed data decoding context
evt The TKR event block to fill in
src The data source, i.e. the bit stream
max The maximum bit position
bfu The current bit position and temporary buffer

static __inline QSE_tkrLyr * tower_and_layer_init QDF_tkrTwr *  twr,
int  twrNum,
QSE_tkrLyr lyrs
[static]
 

Initializes portions of the tower and layer structures mainly concerned with the hit layers.

Returns:
The next layer structure to use
Parameters:
twr The parent tower structure
twrNum The parent tower number
lyrs The next layer structure to assign


Generated on Tue Nov 21 01:30:02 2006 by  doxygen 1.4.4