GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / V2-3-0 > qse / sun-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_err_def.h"
#include "QDF_esb_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"

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.
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_tkrLyr
tower_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_tkrSplits *splits, QDF_tkrEvt *tkr)
 Uses the split point 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_tkrSplitsLimit limit, int twr, int lyr, QDF_exc *exc)
 Finds the split point for the given set of clusters.
BFU QDF_tkrStdDecode (QDF_tkrCtx *ctx, QDF_tkrEvt *evt, const unsigned int *src, const unsigned int max, BFU bfu)
 Decodes the TKR.


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.6 2009/05/01 01:21:38 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_tkrSplits splits,
QDF_tkrEvt evt 
) [static]

Uses the split point 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:
splits The split points
evt The tracker event so far

static __inline int find_split_point ( const QDF_tkrCluster *  clusters,
int  nclusters,
int  lo,
QDF_tkrSplitsLimit  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
lo A status word indicating whether there are LO hits
limit The lo and hi limits for the split points
twr The tower number, used for error reporting
lyr The layer number, used for error reporting
exc Exception handling context
Independent of the state of the lo hits flag, the clusters must be scanned from first to last looking for a strip that is above the high end of the low range.

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

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

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 Thu Sep 2 14:54:55 2010 by  doxygen 1.5.3