GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LSE / V1-3-6
Constituent: lsew     Tag: rad750
#include "LSE/CDF_cal.h"
#include "LSE/CDF_cal_ped.h"
#include "CDF_cal_def.h"
#include "dprintf.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_cal.h"
#include "EDS/ECR_cal.h"
#include "LDT/BFP.h"
#include "LDT/APE.h"
#include "LDT/HUFF.h"
#include "LDT/HDE.h"
#include "EDS/FFS.h"
#include <stdio.h>
Include dependency graph for CDF_cal_ped.c:
Data Structures | |
struct | _HistLimits |
Min and Max indices of a histogram. More... | |
Defines | |
#define | RNGS_COMPOSE(_beg) |
Composes an array of 2 bit range values in the order specified. For example, specifying RNG_COMPOSE(0) means that one expects the four range readout to occur in the order range 0,1,2,3, while specifying RNG_COMPOSE(1) results in an expected order of range 1,2,3,0. This is used to predict the range when processing the layer pairs in the four range readout order. | |
#define | LYR_OFFSETS(_lyr, _rng) |
Computes the offsets to the specified layer and range when all the logs in a tower are struck. | |
#define | RNG_OFFSETS(_rng) |
Creates a comma separated list of the offsets to the 8 layers for the specified range when all the logs in a tower are struck. | |
Typedefs | |
typedef _HistLimits | HistLimits |
Typedef for struct _HistLimits. | |
Functions | |
static __inline unsigned int | cal_ped1_evaluate (const EBF_dir *dir, int *rngP) |
Evaluates the CAL data to see if it is in a form that the compression routines understand. | |
static __inline unsigned int | cal_ped1_evaluate_layer (const EBF_calLogData *logs, int cnt, int twr, int lyr, int rng) |
Checks that the column numbers are as expected and that all the ranges are 0. | |
static __inline int | cal_ped1_process (short int *cidx, unsigned short int *hist, const EBF_dir *dir, const ECR_cal *calib) |
Creates the histograms and the array of pedestal subtracted indices used to compress the CAL portion of the event that is specific to single-range readout. | |
static __inline const unsigned int * | cal_ped1_process_layer (short int *cidx, unsigned short int *hist, const ECR_calLayer *clyr, const unsigned int *logs, int cnt, int twr, int lyr) |
Accumulates the histograms used in compressing the CAL data for one layer. | |
static __inline unsigned int | cal_ped1_compress (CDF_cal *cdf, unsigned int *buf, unsigned int pos, const EBF_dir *dir, const ECR_cal *calib) |
Makes a compressed copy of the CAL data when it is single range, non-zero suppressed. | |
static __inline unsigned int | cal_ped4_evaluate (const EBF_dir *dir, int *rngP) |
Evaluates the 4-range CAL data to see if it is in a form that the compression routines understand. | |
static __inline unsigned int | cal_ped4_evaluate_layer (const EBF_calLogData *logs, int cnt, int twr, int lyr, int rng) |
Checks 4-range CAL data for
| |
static __inline unsigned int | cal_ped4_compress (CDF_cal *cdf, unsigned int *buf, unsigned int pos, const EBF_dir *dir, const ECR_cal *calib) |
Makes a compressed copy of the CAL data when it is four-range, non-zero suppressed. | |
static __inline int | cal_ped4_process (short int *cidx, unsigned short int *hist, const EBF_dir *dir, const ECR_cal *calib, int rng) |
Creates the histograms and the array of pedestal subtracted indices used to compress the CAL portion of the event that is specific to single-range readout. | |
static __inline unsigned int | cdf_cal_ped_copy (CDF_cal *cdf, unsigned int *buf, unsigned int pos, const EBF_dir *dir) |
Puts out a copy of the CAL data, prefacing it with a style header and tower map. | |
static unsigned int | cal_ped_hdr_encode (unsigned int *buf, unsigned int pos, unsigned int fmt, unsigned int map) |
Encodes the CAL pedestal header information. This consists of a formatting style (currently 0 = copy, 1 = compress) plus the map of towers that have a CAL contribution. | |
unsigned int | CDF_cal_ped_compress (CDF_cal *cdf, unsigned int *buf, unsigned int pos, const EBF_dir *dir, const ECR_cal *calib) |
Makes a compressed copy of the CAL data if the data is in a form that this routine understands. If not, a straight copy of the data is made. |
CVS $Id: CDF_cal_ped.c,v 1.4 2007/04/08 20:35:19 russell Exp $
The encoding for the CAL pedestal data is
Object Number of Bits Description Format 2 0 = copy, 1 = standard compress
ADC = encoded_value - this_offset + pedestal
1 2 0 3 4 5 0 0 7 6 5
The longest run length is 3. This takes 2 bits to hold so this distribution would be encoded 10b, 01b, 11b, 10b, 11b, 00b.
|
Value: (((_lyr) >> 1) * EDA_CAL_K_LOGS_PER_TOWER + \ ((_lyr) & 0x1) * EDA_CAL_K_LOGS_PER_LAYER + \ (_rng) * EDA_CAL_K_LOGS_PER_LAYER * 2)
|
|
Value: LYR_OFFSETS(0, _rng), \ LYR_OFFSETS(1, _rng), \ LYR_OFFSETS(2, _rng), \ LYR_OFFSETS(3, _rng), \ LYR_OFFSETS(4, _rng), \ LYR_OFFSETS(5, _rng), \ LYR_OFFSETS(6, _rng), \ LYR_OFFSETS(7, _rng)
|
|
Value: ( ((((_beg) + 3) & 3) << 14) | ((((_beg) + 3) & 3) << 12) | \ ((((_beg) + 2) & 3) << 10) | ((((_beg) + 2) & 3) << 8) | \ ((((_beg) + 1) & 3) << 6) | ((((_beg) + 1) & 3) << 4) | \ ((((_beg) + 0) & 3) << 2) | ((((_beg) + 0) & 3) << 0) )
|
|
Makes a compressed copy of the CAL data when it is single range, non-zero suppressed.
|
|
Evaluates the CAL data to see if it is in a form that the compression routines understand.
|
|
Checks that the column numbers are as expected and that all the ranges are 0.
|
|
Creates the histograms and the array of pedestal subtracted indices used to compress the CAL portion of the event that is specific to single-range readout.
|
|
Accumulates the histograms used in compressing the CAL data for one layer.
|
|
Makes a compressed copy of the CAL data when it is four-range, non-zero suppressed.
|
|
Evaluates the 4-range CAL data to see if it is in a form that the compression routines understand.
|
|
Checks 4-range CAL data for
|
|
Creates the histograms and the array of pedestal subtracted indices used to compress the CAL portion of the event that is specific to single-range readout. const unsigned short int off_buf[8]; |
|
Encodes the CAL pedestal header information. This consists of a formatting style (currently 0 = copy, 1 = compress) plus the map of towers that have a CAL contribution.
|
|
Makes a compressed copy of the CAL data if the data is in a form that this routine understands. If not, a straight copy of the data is made.
|
|
Puts out a copy of the CAL data, prefacing it with a style header and tower map.
|