GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / dev > qse / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

QDF_dgn_ped.c File Reference

Decodes the DGN data when in the encoded in for pedestal events. More...

#include <QSE/QDF_dgn.h>
#include <QSE/QDF_gem.h>
#include <QSE/QDF_exc.h>
#include <QDF_dgn_def.h>
#include <QDF_esb_def.h>
#include <QDF_exc_def.h>
#include <QDF_err_def.h>
#include <QDF_cal_def.h>
#include <QDF_tkr_def.h>
#include <dprintf.h>
#include <LDT/RLD.h>
#include <LDT/BTD.h>
#include <LDT/BFU.h>
#include <LDT/BWU.h>
#include <LDT/BIT.h>
#include <EDS/EBF_gem.h>
#include <PBI/FFS.ih>

Defines

#define NULL   ((void *)(0))

Functions

static __inline BFU dgn_ped_cal_accept_set_decode (unsigned int(*accepts)[2], const unsigned int *src, unsigned int max, BFU bfu)
 Decodes the CAL accept bits portion of the diagnostic data for one set of 32 log accept bits for each of log end.
static __inline BFU dgn_ped_cal_accept_twr_decode (unsigned int(*accepts)[3][2], unsigned int const *src, unsigned int max, BFU bfu)
 Decodes the CAL accept bits portion of the diagnostic data for one tower.
static __inline BFU dgn_ped_cal_accept_decode (QDF_dgnCalAccept *accept, unsigned int map, unsigned int err_map, QDF_calPedEvt const *cal, unsigned int const *src, unsigned int max, BFU bfu)
 Decodes the CAL accept bits portion of the diagnostic data for all towers with non-zero CAL diagnostic accept data.
BFU QDF_dgnPedDecode (QDF_dgnCtx *ctx, QDF_dgnEvt *evt, unsigned int const *src, unsigned int max, BFU bfu)
 Decodes the DGN.


Detailed Description

Decodes the DGN data when in the encoded in for pedestal events.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: QDF_dgn_ped.c,v 1.2 2011/03/27 01:45:44 russell Exp $

Function Documentation

static __inline BFU dgn_ped_cal_accept_decode ( QDF_dgnCalAccept accept,
unsigned int  map,
unsigned int  err_map,
QDF_calPedEvt const *  cal,
unsigned int const *  src,
unsigned int  max,
BFU  bfu 
) [static]

Decodes the CAL accept bits portion of the diagnostic data for all towers with non-zero CAL diagnostic accept data.

Returns:
The updated BFU (current word being decoded and the current bit position).
Parameters:
accept Array of the 192 accept bits for each tower
map The map of towers that have encoded accept bits
err_map The map of erroring CAL towers.
cal The CAL data. The encoded data are the exceptions and must be XOR'ed with the CAL accept bits found in the data to produce the CAL diagnostic accept bits.
src The input bit stream to be decoded
max The maximum number of bits in the bit stream
bfu The value of the current 32-bit word being decoded and the current bit position.

References dgn_ped_cal_accept_twr_decode(), _QDF_dgnCalAccept::map, and _QDF_dgnCalAccept::twrs.

Referenced by QDF_dgnPedDecode().

static __inline BFU dgn_ped_cal_accept_set_decode ( unsigned int(*)  accepts[2],
const unsigned int *  src,
unsigned int  max,
BFU  bfu 
) [static]

Decodes the CAL accept bits portion of the diagnostic data for one set of 32 log accept bits for each of log end.

Returns:
The updated BFU (current word being decoded and the current bit position).
Parameters:
accepts The 192 accept bits for the tower being decoded
src The input bit stream to be decoded
max The maximum number of bits in the bit stream
bfu The value of the current 32-bit word being decoded and the current bit position.
Decompression Details
Ths compression method works on the assumption that not many log accept bits are set for pedestal events. The 64 bits of log accept bits, 32 bits for each log end, in the following 3 blocks of data
  • The OR of the 32 bits from either end. This may be encoded either by the run length method, good when only a few bits are set or as is, good when many bits are set. A flag bit indicates which method is used.

  • The collapsed XOR of the 32 bits from either end. The XOR is chosen because the assumption is that the accept bits from the two ends are very similar, meaning the XOR has very few bits set. The collapsed XOR is used because the only bits one must consider are those from the OR of the two ends. Once reexpanded, the XOR and the OR yields can be manipulated to yield two sets of bits
    • The set of bits common to both ends
    • The set of bits not common to both ends (i.e. in one or the other end, but not both)

  • If collapsed version of the P end against the XOR. Reexpanding this gives the log accepts unique to the P end. ORing in the bits common to both yields the P end accept bits. XORing the P end accept bits with the XOR yields the N end accept bits. Two things to note
    • The chose of which end, the P and N end, to encode is arbitrary, all that is important is that both sides agree.
    • If the XOR is 0, then there are no bits unique to one of the ends. Therefore, P and N ends accept bits are just the original OR.

Referenced by dgn_ped_cal_accept_twr_decode().

static __inline BFU dgn_ped_cal_accept_twr_decode ( unsigned int(*)  accepts[3][2],
unsigned int const *  src,
unsigned int  max,
BFU  bfu 
) [static]

Decodes the CAL accept bits portion of the diagnostic data for one tower.

Returns:
The updated BFU (current word being decoded and the current bit position).
Parameters:
accepts The 192 accept bits for the tower being decoded
src The input bit stream to be decoded
max The maximum number of bits in the bit stream
bfu The value of the current 32-bit word being decoded and the current bit position.

References dgn_ped_cal_accept_set_decode().

Referenced by dgn_ped_cal_accept_decode().

BFU QDF_dgnPedDecode ( QDF_dgnCtx ctx,
QDF_dgnEvt evt,
unsigned int const *  src,
unsigned int  max,
BFU  bfu 
)

Decodes the DGN.

Returns:
The updated bit position and current deblocked 32-bit buffer
Parameters:
ctx The compressed data decoding context
evt The DGN 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
Overview
This routine acts as a driver to decode the diagnostic contributions of pedestal events.
Details
For the purposes of data compression, the diagnostic contribution is viewed as being composed of 3 separate data structures
  • The CAL LO and CAL HI trigger bits from each layer
  • The CAL accept bits from each log end
  • The TKR accept bits from each layer

In addition there is a summary structure yielding 3 bit maps indicating which of the above structures have towers that differ from the /e expected values for that particular data structure. For
  • The CAL LO and CAL HI trigger bits, the map indicates which tower's diagnostic contribution differs from the equivalent map given by the GEM data. This can differ in two ways, either
    • The GEM map indicates that the tower has non-zero diagnostic trigger bits, but the diagnostic data is all zero, or
    • The GEM map indicates that the tower has all zero diagnostic trigger bits, but is in fact non-zero.

  • The CAL accept bits, the map indicates which towers have non-zero diagnostic log accept bits. Note that the CAL data cannot be used to provide a template of the expected log accept bits in the case of pedestal data. This is because all logs are present, independent of whether their ADC value is above threshold or not.

  • The TKR accept map, the map indicates which tower's diagnostic contribution differs from the equivalent map formed from the TKR data accept bits. In this case, each tower's layer accept map can be used as a template for the expected value of the equivalent bits in the TKR's diagnostic data.

References _QDF_dgnTkrDat::accept, _QDF_dgnCalDat::accept, _QDF_dgnPedEvt::cal, _QDF_dgnDat::cal, _QDF_errEvt::cal_map, _QDF_maps::calHiLo, _QDF_maps::ctids, _QDF_dgnEvt::dat, _QDF_esbEvt::dgn_ids, dgn_ped_cal_accept_decode(), _QDF_dgnHdrEvt::err, _QDF_dgnHdrEvt::esb, _QDF_dgnPedEvt::gem, _QDF_dgnPedEvt::hdr, _QDF_dgnStdEvt::hdr, _QDF_tkrEvt::map, _QDF_dgnEvt::ped, QDF_dgn_gen_cal_trg_decode(), QDF_dgn_gen_hdr_decode(), QDF_dgn_gen_tkr_accept_decode(), _QDF_dgnEvt::std, _QDF_dgnDat::tkr, _QDF_dgnStdEvt::tkr, _QDF_errEvt::tkr_map, and _QDF_dgnCalDat::trg.


Generated on Fri Nov 30 10:25:29 2012 by  doxygen 1.5.8