GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LSEP / V1-0-2
Constituent: lsepw     Tag: linux-gcc
#include "dprintf.h"
#include "LSEP/CDF.h"
#include "LSEP/CDF_vector.h"
#include "LSEP/CDF_cal.h"
#include "LSEP/BFP.h"
#include "EDS/ECR_cal.h"
#include "EDS/EDR_calUnpack.h"
#include "EDS/EDR_cal.h"
#include "EDS/EBF_cal.h"
#include "EDS/EBF_dir.h"
#include "EDS/EDS_endianness.h"
#include "EDS/FFS.h"
#include "LDT/BTE.h"
#include <string.h>
Include dependency graph for CDF_cal.c:
Data Structures | |
struct | Lz |
Describes the two log end readings in a leading 0 (pseudo-floating) manner. More... | |
struct | _Vn |
A structure containing two fields, one with the bit pattern of a packed PHA value and one with the number of bits in the bit pattern. More... | |
struct | _Lzs |
Structure to hold the minimum of all the maximum ADC values and the minimum of differences. More... | |
Defines | |
#define | DEBUG_1 |
#define | STYLE_0 0 |
Indicates CAL encoding by style 0. | |
#define | STYLE_1 1 |
Indicates CAL encoding by style 1. | |
Typedefs | |
typedef _Vn | Vn |
Typedef for struct _Vn. | |
typedef _Lzs | Lzs |
Typedef for _struct Lzs. | |
Functions | |
static unsigned int | compress0_raw_adr (unsigned int *buffer, unsigned int position, const EDR_cal *cal) |
Compresses the CAL address data. | |
static unsigned int | compress0_raw_pha (unsigned int *buffer, unsigned int position, const EDR_cal *cal, const ECR_cal *calCal) |
Compresses the CAL pha data. | |
unsigned int | CDF_cal0Compress (CDF_vector *bpv, const EDR_cal *cal, const ECR_cal *calCal) |
Gathers the statistics on the CAL data. | |
static __inline unsigned int | join (unsigned int colMap0, unsigned int colMap1) |
Combines to 12 bit column masks into 1 24 left justified mask. | |
static unsigned int | prepare (unsigned int colMap0, unsigned int colMap1) |
Transforms the the 2 12-bit column masks into 4 groups of 2 rows x 3 columns masks packed into the least significant bits of a 32-bit word One 24-bit mask arranged as 4 groups of 2 rows x 3 columns. | |
static unsigned int | analyze (unsigned int pattern) |
Analyzes the 2 12-bit column masks as 4 groups of 2 rows x 3 columns masks. | |
static __inline unsigned int | pack_adrs_1 (unsigned int *buffer, unsigned int position, unsigned int biase, unsigned int stop, unsigned int colMap) |
Packs the column addresses associated with the specified column mask. | |
static __inline unsigned int | pack_adrs (unsigned int *buffer, unsigned int position, unsigned int colMapx01, unsigned int colMapx23, unsigned int colMapy01, unsigned int colMapy23) |
Packs the addresses associated with the hit columns. | |
static __inline unsigned int | collapse_24x6 (unsigned int pat) |
Collapses the 4 groups of 6 consecutive bits in a 24 bit number to a 4 bit mask. | |
static __inline unsigned int | collapse_4x4 (unsigned int pat) |
Collapses the 4 bits in a 4 bit pattern to a single bit, indicating whether the value is 0 or non-zero. | |
static __inline unsigned int | compose_qmapn (unsigned int r0, unsigned int r1) |
Compose the bit pattern for the negative quadtree encoding. | |
static __inline unsigned int | compose_qmapp (unsigned int r0, unsigned int r1) |
Compose the bit pattern for the positive quadtree encoding. | |
static __inline unsigned int | compose_qmap (unsigned int scheme, unsigned int patternx01, unsigned int patternx23, unsigned int patterny01, unsigned int patterny23) |
Composes a representation of the level 0 and level quad tree map of the 96 bits specified by the 4 24 bit masks. | |
static __inline unsigned int | pack_blks (unsigned int *buffer, unsigned int position, int map, unsigned int pattern) |
Packs the non-zero 6 bit groups in the specified 24-bit pattern. | |
static __inline unsigned int | pack_qtree (unsigned int *buffer, unsigned int position, unsigned int qmap, unsigned int patternx01, unsigned int patternx23, unsigned int patterny01, unsigned int patterny23) |
Packs the complete quad tree representation for the specified patterns. | |
static void | increment (unsigned int stats[64], unsigned int pattern) |
Increments the pattern statistics tables. | |
static __inline unsigned int | compress0_twr_adr (unsigned int *buffer, unsigned int position, unsigned int nhits, unsigned int colMapx0, unsigned int colMapx1, unsigned int colMapx2, unsigned int colMapx3, unsigned int colMapy0, unsigned int colMapy1, unsigned int colMapy2, unsigned int colMapy3) |
Compresses the addresses for this tower. | |
static __inline unsigned int | gather_twr_adr_stats (CDF_calStatsAdr *stats, unsigned int nhits, unsigned int colMapx0, unsigned int colMapx1, unsigned int colMapx2, unsigned int colMapx3, unsigned int colMapy0, unsigned int colMapy1, unsigned int colMapy2, unsigned int colMapy3) |
Gathers the address statistics for this tower. | |
static __inline unsigned int | pha_exp_compose (const struct Lz *lz, int ndif, unsigned char mappings[2][14]) |
Composes the bit pattern to encode the exponents. | |
static __inline Vn | pha_val_compose (const struct Lz *lz, int cutoff_max, int cutoff_dif) |
Composes the packed bit pattern from the leading zero representation of a PHA value. | |
static unsigned int | pha_pack0 (unsigned int *buffer, int position, const struct Lz *lz, int lzcnt, unsigned short int min_max, unsigned short int min_dif) |
Packs each PHA value into the output structure, uses full 8 bit exponent. | |
static unsigned int | pha_pack1 (unsigned int *buffer, int position, const struct Lz *lz, int lzcnt, unsigned short int min_max, unsigned short int min_dif, unsigned short int cutoff_max, unsigned short int cutoff_dif, unsigned int present, unsigned int ntot, unsigned int ndif, unsigned char mappings[2][14]) |
Packs each PHA value into the output structure. | |
static __inline unsigned int | lz_limit (unsigned int present, unsigned int cutoff_max, unsigned int cutoff_dif) |
Eliminates the low probability states from the present mask. | |
static unsigned int | lz_reduce (struct Lz *lz, int lz_cnt, unsigned short int min_max, unsigned short int min_dif) |
Reduces the PHA values and transforms the CAL PHA values from EBF format to the leading zero representation. | |
static Lzs | lz_fill (struct Lz *lz, const EDR_cal *cal, const ECR_cal *calCal) |
Transforms the CAL PHA values from EBF format to the leading zero representation. |
CVS $Id: CDF_cal.c,v 1.4 2005/12/05 18:24:40 russell Exp $
|
Analyzes the 2 12-bit column masks as 4 groups of 2 rows x 3 columns masks.
+----+----+--------+--------+--------+ | q+ | q- | unused | size+ | size- | +----+----+--------+--------+--------+ where q+/- = quad map of + or - images size +/- = size of the + or - images
|
|
Gathers the statistics on the CAL data.
|
|
Collapses the 4 groups of 6 consecutive bits in a 24 bit number to a 4 bit mask.
|
|
Composes a representation of the level 0 and level quad tree map of the 96 bits specified by the 4 24 bit masks.
33 2222 2222 2211 1111 1111 10 9876 5432 1098 7654 3210 9 87654 3210 +--+----+----+----+----+----+-+-----+----+ |ss|MapA|Map0|Map1|Map2|Map3|0| Ng6s|NmpA| +--+----+----+----+----+----+-+-----+----+ Where ss = Scheme 10 for + image, 11 for - image Mapa = Bit map of which of pattern words are non-zero Equivalently, it indicates the which of the following maps are present. Map0 = Bit map of which groups of 6 from the 1rst hit group are hit Map1 = Bit map of which groups of 6 from the 2nd hit group are hit Map2 = Bit map of which groups of 6 from the 3rd hit group are hit Map3 = Bit map of which groups of 6 from the 4rth hit group are hit 0 = MBZ Ng6s = Number of 6 that are hit (ie bit count of Map0-Map3) (0-4) Nqmap = Number of bits in the qmap (0-16) In the maps, 0 is never a valid number. |
|
Compresses the CAL address data.
|
|
Compresses the CAL pha data.
|
|
Increments the pattern statistics tables.
|
|
Combines to 12 bit column masks into 1 24 left justified mask.
|
|
Transforms the CAL PHA values from EBF format to the leading zero representation.
|
|
Eliminates the low probability states from the present mask.
|
|
Reduces the PHA values and transforms the CAL PHA values from EBF format to the leading zero representation.
|
|
Packs the addresses associated with the hit columns.
|
|
Packs the column addresses associated with the specified column mask.
|
|
Packs the non-zero 6 bit groups in the specified 24-bit pattern.
|
|
Packs the complete quad tree representation for the specified patterns.
|
|
Composes the bit pattern to encode the exponents.
|
|
Packs each PHA value into the output structure, uses full 8 bit exponent.
|
|
Packs each PHA value into the output structure.
|
|
Composes the packed bit pattern from the leading zero representation of a PHA value.
|
|
Transforms the the 2 12-bit column masks into 4 groups of 2 rows x 3 columns masks packed into the least significant bits of a 32-bit word One 24-bit mask arranged as 4 groups of 2 rows x 3 columns.
|