GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-0-2 > lsew / sun-gcc
#include "LSE/CDF_dgn_ped_cal.h"
#include "CDF_dgn_def.h"
#include "EDS/EBF_dir.h"
#include "EDS/FFS.h"
#include "LDT/BFP.h"
#include "LDT/BWP.h"
#include "LDT/BW.h"
#include "dprintf.h"
Functions | |
static __inline unsigned int | dgn_ped_cal_twr_extract (CDF_dgn_ped_cal_twr *cdgn, const unsigned int *dgn) |
Extracts the 8 12-bit log accept maps for the two log ends into 3 32-bit values. | |
static int | dgn_ped_cal_encode32 (unsigned int *buf, unsigned int pos, unsigned int p, unsigned int n) |
Compresses the positive and negative maps of 32 bits of which CAL logs where over-threshold (from the diagnostic data). This routine will typically be called 3 times for the 3 sets of maps representing the 96 logs. | |
static __inline unsigned int | dgn_ped_cal_compress (unsigned int *buf, unsigned int pos, CDF_dgn_ped_cal_twr *dgn, int cnt) |
Encodes the CAL log accept data for all towers. | |
int | CDF_dgn_ped_cal_cfg_sizeof (int level) |
Returns the size, in bytes of the DGN compression configuration needed to support the specified level. | |
int | CDF_dgn_ped_cal_cfg_construct (CDF_dgn_ped_cal_cfg *cfg, int level, void **mem) |
Constructs the CDF_dgnCalCfg compression configuration. | |
int | CDF_dgn_ped_cal_sizeof (int level, const CDF_dgn_ped_cal_cfg *cfg) |
Returns the size, in bytes of the CAL DGN compression structure needed to support the specified level. | |
int | CDF_dgn_ped_cal_construct (CDF_dgn_ped_cal *cdf, int level, const CDF_dgn_ped_cal_cfg *cfg, const LSEW_dgmFw *dgmFw, void **mem) |
Constructs the CAL standard diagnostic compression context. | |
unsigned int | CDF_dgn_ped_cal_prepare (CDF_dgn_ped_cal *cdf, unsigned int map, unsigned int amap, unsigned int emap, const unsigned **dgns, const EBF_dirCtbDsc *dscs) |
Prepares the cal diagnostic data for compression. | |
unsigned int | CDF_dgn_ped_cal_compress (CDF_dgn_ped_cal *cdf, unsigned int *buf, unsigned int pos) |
Compresses the CAL diagnostic data when data is taken with standard physics triggers. |
CVS $Id: CDF_dgn_ped_cal.c,v 1.1 2009/04/30 18:21:08 russell Exp $
int CDF_dgn_ped_cal_cfg_construct | ( | CDF_dgn_ped_cal_cfg * | cfg, | |
int | level, | |||
void ** | mem | |||
) |
Constructs the CDF_dgnCalCfg compression configuration.
Status |
cfg | Target specific configuration | |
level | The maximum compression level that needs to be supported | |
mem | Pointer to free memory pointer, return as the the updated pointer. If cfg is equal to the current contents of mem, then mem will be advanced by the size of CDF_dgnCfg else this routine will believe that the only the variable allocation of cdf needs to be allocated. |
int CDF_dgn_ped_cal_cfg_sizeof | ( | int | level | ) |
Returns the size, in bytes of the DGN compression configuration needed to support the specified level.
level | The maximum compression level to support |
unsigned int CDF_dgn_ped_cal_compress | ( | CDF_dgn_ped_cal * | cdf, | |
unsigned int * | buf, | |||
unsigned int | pos | |||
) |
Compresses the CAL diagnostic data when data is taken with standard physics triggers.
cdf | The CAL diagnostic context | |
buf | The output bit buffer | |
pos | The output bit index |
These are encoded in two separate blocks on a per tower basis, that is the trigger information for all towers is encoded first, followed by the log accept data for all towers.
int CDF_dgn_ped_cal_construct | ( | CDF_dgn_ped_cal * | cdf, | |
int | level, | |||
const CDF_dgn_ped_cal_cfg * | cfg, | |||
const LSEW_dgmFw * | dgmFw, | |||
void ** | mem | |||
) |
Constructs the CAL standard diagnostic compression context.
cdf | The CAL standard diagnostic compression context to construct | |
level | The compression level | |
cfg | The CAL standard diagnostic compression configuration information. Currently this is unused, but is provided for future usage if necessary. | |
dgmFw | The datagram framework. This would be used if the compression of the CAL standard diagnostic data needed to store any context information in the datagram header. | |
mem | A pointer to the memory to allocate any variable length structures the CDF_dgn_ped_cal context may need. Currently there are none. If this pointer is the same as cdf, the memory pointer is advanced by the size of the CDF_dgn_ped_cal structure before allocating any new memory. This routine updates the memory pointer to the next available address. |
unsigned int CDF_dgn_ped_cal_prepare | ( | CDF_dgn_ped_cal * | cdf, | |
unsigned int | map, | |||
unsigned int | amap, | |||
unsigned int | emap, | |||
const unsigned ** | dgns, | |||
const EBF_dirCtbDsc * | dscs | |||
) |
Prepares the cal diagnostic data for compression.
cdf | The context for CAL standard diagnostics | |
map | A left justified map indicating which towers have a CAL contribution. | |
amap | A left justified map indicating which towers have only an accept contribution. | |
emap | A left justified map of towers with errors | |
dgns | An array of pointers, indexed by tower number, giving the address of that tower's diagnostic block. | |
dscs | The array of pointers to the tower contribution descriptors. |
int CDF_dgn_ped_cal_sizeof | ( | int | level, | |
const CDF_dgn_ped_cal_cfg * | cfg | |||
) |
Returns the size, in bytes of the CAL DGN compression structure needed to support the specified level.
level | The maximum compression level to support | |
cfg | Target specific configuration |
static __inline unsigned int dgn_ped_cal_compress | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
CDF_dgn_ped_cal_twr * | dgn, | |||
int | cnt | |||
) | [static] |
Encodes the CAL log accept data for all towers.
buf | The output bit buffer | |
pos | The output bit index | |
dgn | The prepared diagnostic data for the list of towers with non-empty diagnostic data | |
cnt | The count of dgn |
static int dgn_ped_cal_encode32 | ( | unsigned int * | buf, | |
unsigned int | pos, | |||
unsigned int | p, | |||
unsigned int | n | |||
) | [static] |
Compresses the positive and negative maps of 32 bits of which CAL logs where over-threshold (from the diagnostic data). This routine will typically be called 3 times for the 3 sets of maps representing the 96 logs.
buf | The output buffer | |
pos | The current bit position in the output buffer | |
p | The 32-bit map of which logs contributed to the positive end diagnostic accepts. | |
n | The 32-bit map of which logs contributed to the negative end diagnostic accepts. |
static __inline unsigned int dgn_ped_cal_twr_extract | ( | CDF_dgn_ped_cal_twr * | cdgn, | |
const unsigned int * | dgn | |||
) | [static] |
Extracts the 8 12-bit log accept maps for the two log ends into 3 32-bit values.
cdgn | The structure to receive the 2x3x32-bit log accepts | |
dgn | The CAL diagnostic data |