GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LSEP / V1-0-1

Constituent: lsepw     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

CDF_gem_acd.c File Reference

Implementation to produce Compressed Data Format for the ACD and GEM contributors. More...

#include "LSEP/CDF.h"
#include "LSEP/CDF_gem_acd.h"
#include "LSEP/CDF_vector.h"
#include "LSEP/BFP.h"
#include "LSEP/LSEP_evtBdy0.h"
#include "EDS/EDR_acd.h"
#include "EDS/EDA_acd.h"
#include "EDS/EBF_gem.h"
#include "EDS/FFS.h"
#include "dprintf.h"

Include dependency graph for CDF_gem_acd.c:


Functions

static __inline unsigned int prepare (unsigned int w)
 Prepares the initial word of being used in the formation of the pattern word.
static __inline unsigned int form (unsigned int v, unsigned int hb, unsigned int ha, unsigned int pb, unsigned int pa, int bit)
 Forms the 5 bit pattern word from the bits in column left and appropriately shifts the pattern word so that it may be used directly as a byte offset into the correct statistics counters.
static __inline unsigned int pack_adr_acd (unsigned int *buffer, unsigned int position, unsigned int adr, unsigned int v, unsigned int hb, unsigned int ha, unsigned int pb, unsigned int pa)
 Packs the ACD addressing information.
static __inline int pack_pha_acd (unsigned int *buffer, int position, const unsigned int paccepts[2][4], const unsigned short int *phas, int shift, int width)
 Packs the ACD Pha values.
static __inline unsigned int acd_add (unsigned int *buffer, unsigned int position, const EBF_gem *gem, const EDR_acd *acd)
 Adds the ACD record proper and the ACD portion of the GEM.
static __inline unsigned int gem_add (unsigned int *buffer, unsigned int position, const EBF_gem *gem)
 Adds the GEM record.
unsigned int CDF_gem_acd_compress (CDF_vector *bpv, const EBF_gem *gem, const EDR_acd *acd)
 Compresses the ACD/GEM data.

Detailed Description

Implementation to produce Compressed Data Format for the ACD and GEM contributors.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: CDF_gem_acd.c,v 1.3 2005/12/05 18:24:40 russell Exp $


Function Documentation

static __inline unsigned int acd_add unsigned int *  buffer,
unsigned int  position,
const EBF_gem *  gem,
const EDR_acd *  acd
[static]
 

Adds the ACD record proper and the ACD portion of the GEM.

Returns:
The next available bit position in the output buffer
Parameters:
buffer The output buffer
position The current bit offset
gem The input EBF_gem record
acd The input EDR_acd record
The only error condition that this routine can deal with is PHA parity errors.

unsigned int CDF_gem_acd_compress CDF_vector bpv,
const EBF_gem *  gem,
const EDR_acd *  acd
 

Compresses the ACD/GEM data.

Parameters:
bpv Output context
gem The GEM contribution
acd The unpacked ACD contribution
Returns:
Size, in bits of the compressed combined ACD/GEM data

unsigned int form unsigned int  v,
unsigned int  hb,
unsigned int  ha,
unsigned int  pb,
unsigned int  pa,
int  left
[static]
 

Forms the 5 bit pattern word from the bits in column left and appropriately shifts the pattern word so that it may be used directly as a byte offset into the correct statistics counters.

Returns:
A word that can be used to increment the statistics pattern counter.
Parameters:
v The GEM list of veto bits
hb The ACD hit bits for side b
ha The ACD hit bits for side a
pb The ACD pulse height accept bits for side b
pa The ACD pulse height accept bits for side a
left The bit number of the channel (counting from the left or MSB)

static __inline unsigned int gem_add unsigned int *  buffer,
unsigned int  position,
const EBF_gem *  gem
[static]
 

Adds the GEM record.

Returns:
The next available bit position in the output buffer
Parameters:
buffer The output buffer
position The current bit offset
gem The input EBF_gem record

static __inline unsigned int pack_adr_acd unsigned int *  buffer,
unsigned int  position,
unsigned int  adr,
unsigned int  v,
unsigned int  hb,
unsigned int  ha,
unsigned int  pb,
unsigned int  pa
[static]
 

Packs the ACD addressing information.

Parameters:
buffer The output buffer
position The current bit offset
adr Starting address
v The GEM list of veto bits
hb The ACD hit bits for side b
ha The ACD hit bits for side a
pb The ACD pulse height accept bits for side b
pa The ACD pulse height accept bits for side a

static __inline int pack_pha_acd unsigned int *  buffer,
int  position,
const unsigned int  paccepts[2][4],
const unsigned short int *  phas,
int  shift,
int  width
[static]
 

Packs the ACD Pha values.

Returns:
The new bit index
Parameters:
buffer The output buffer
position The bit index into the output buffer
paccepts The PHA accepts
phas The array of pha values
shift The number of bits to shift the PHA value
width The number of bits per PHA to store

unsigned int prepare unsigned int  w  )  [static]
 

Prepares the initial word of being used in the formation of the pattern word.

Returns:
The prepared word
Parameters:
w The word to prepare
On the PowerPC, 1 instruction in the accumulation loop is saved by preshifting the intial word used in the formation of the pattern word. All other platforms do the straightforward thing of shifting and oring each bit and this routine is a NOOP. By doing defining this routine, the bulk of the code is portable across platforms.


Generated on Tue Dec 6 20:25:40 2005 by  doxygen 1.4.4