GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LSEC / V6-0-0

Constituent: lsec_wb     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

compact.c File Reference

Compaction implementation. More...

#include "LSEC/LSEC_msgs.h"
#include "LSEC/LSEC_ctx.h"
#include "compact_p.h"
#include "encode.h"
#include "compress.ic"
#include "acdraw.h"
#include "gemraw.h"
#include "LDT/APE.h"
#include "LDT/APD.h"
#include "EDS/EBF_siv.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_cal.h"
#include "EDS/FFS.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/MBA.h"
#include "PBS/WCT.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

Include dependency graph for compact.c:


Defines

#define _printf(msg, format, args...)
 Provide printf-like functionality using MSG information message.
#define CHECK_CALL(FUNC)
 Call a function and check the return value.

Enumerations

enum  { PRINTSIZE = 256 }

Functions

LSEC_compactionLSEC_newCompaction (unsigned cap)
 Allocate memory for an LSEC_compaction structure and all the substructures.
void LSEC_deleteCompaction (LSEC_compaction *cpc)
 Free memory previously allocated with a call to LSEC_newCompaction.
void LSEC_clearCompaction (LSEC_compaction *cpc)
 Clear away any context from a previous cycle.
void LSEC_reportCompaction (LSEC_compaction *cpc, FILE *fp)
 Write formatted ASCII output to a file.
void LSEC_setMode (LSEC_compaction *cpc, unsigned mode)
 Set the calibration mode.
void LSEC_setFourRange (LSEC_compaction *cpc, unsigned range)
 Set the four-range value.
unsigned LSEC_checkCompaction (LSEC_compaction *cpc)
 Check the substructures for errors.
unsigned LSEC_monitorCompaction (LSEC_compaction *cpc, unsigned mon)
 Set the monitoring level for the compaction.
unsigned int sizeofUserGem (LSEC_compaction *cpc)
 Calculate the number of 32-bit words required to hold the tables against which the GEM contributions will be encoded.
static unsigned int sizeofUserAcd (LSEC_compaction *cpc)
 Calculate the number of 32-bit words required to hold the tables against which the ACD contributions will be encoded.
static unsigned int sizeofUserCal (LSEC_compaction *cpc)
 Calculate the number of 32-bit words required to hold the tables against which the CAL contributions will be encoded.
static unsigned int sizeofUserTkr (LSEC_compaction *cpc)
 Calculate the number of 32-bit words required to hold the tables against which the TKR contributions will be encoded.
unsigned int * consignUserGem (LSEC_compaction *cpc, unsigned int *buf)
 Pack the tables against which the GEM contributions will be encoded into the buffer.
static unsigned int * consignUserAcd (LSEC_compaction *cpc, unsigned int *buf)
 Pack the tables against which the ACD contributions will be encoded into the buffer.
static unsigned int * consignUserCal (LSEC_compaction *cpc, unsigned int *buf)
 Pack the tables against which the CAL contributions will be encoded into the buffer.
static unsigned int * consignUserTkr (LSEC_compaction *cpc, unsigned int *buf)
 Pack the tables against which the TKR contributions will be encoded into the buffer.
unsigned processGem (LSEC_compaction *cpc)
 Process the GEM compression structure.
unsigned LSEC_processAcd (LSEC_compaction *cpc)
 Process ACD compaction data.
void LSEC_calculateCalMeans (LSEC_compaction *cpc)
 Calculate the mean value for each CAL log end.
unsigned LSEC_processCalMeans (LSEC_compaction *cpc)
 Process the mean values for each CAL log end.
unsigned LSEC_processCal (LSEC_compaction *cpc)
 Process the CAL compression structures.
unsigned LSEC_processTkr (LSEC_compaction *cpc)
 Process the TKR compression structures.
unsigned LSEC_encode (LSEC_compaction *cpc, EBF_dir *dir)
 Encode the next event from the collection.
unsigned int * LSEC_consignEvt (LSEC_compaction *cpc, unsigned int *buf)
 Copy a single encoded event into the datagram.
unsigned LSEC_sizeofUser32 (LSEC_compaction *cpc)
 Calculate the number of 32-bit words required to hold tables against which the events will be encoded.
unsigned int * LSEC_consignUser (LSEC_compaction *cpc, unsigned int *buf)
 Pack the tables against which the events will be encoded into the buffer.

Detailed Description

Compaction implementation.

Author:
James Swain & Owen Saxton
Id
compact.c,v 1.11 2007/06/13 17:15:22 saxton Exp

Define Documentation

#define _printf msg,
format,
args...   ) 
 

Value:

{ \
   char buffer[PRINTSIZE];\
   sprintf(buffer, format, ## args); \
   _msg_report(msg, 0, 1, buffer); \
 }
Provide printf-like functionality using MSG information message.

#define CHECK_CALL FUNC   ) 
 

Value:

{ \
  unsigned status = FUNC;\
  if (_msg_failure(status)) return status;\
}
Call a function and check the return value.


Function Documentation

unsigned int * consignUserAcd LSEC_compaction cpc,
unsigned int *  buf
[inline, static]
 

Pack the tables against which the ACD contributions will be encoded into the buffer.

Parameters:
buf Pointer to the buffer where the context should be placed
cpc Pointer to the structure containing the tables (a compaction)
Returns:
Pointer to the next output location to be filled.

unsigned int * consignUserCal LSEC_compaction cpc,
unsigned int *  buf
[inline, static]
 

Pack the tables against which the CAL contributions will be encoded into the buffer.

Parameters:
buf Pointer to the buffer where the context should be placed.
cpc Pointer to the structure containing the tables (a compaction)
Returns:
Pointer to the next output location to be filled.

unsigned int * consignUserGem LSEC_compaction cpc,
unsigned int *  buf
 

Pack the tables against which the GEM contributions will be encoded into the buffer.

Parameters:
buf Pointer to the buffer where the context should be placed.
cpc Pointer to the structure containing the tables (a compaction)
Returns:
Pointer to the next output location to be filled.

unsigned int * consignUserTkr LSEC_compaction cpc,
unsigned int *  buf
[inline, static]
 

Pack the tables against which the TKR contributions will be encoded into the buffer.

Parameters:
buf Pointer to the buffer where the context should be placed.
cpc Pointer to the structure containing the tables (a compaction)
Returns:
Pointer to the next output location to be filled.

void LSEC_calculateCalMeans LSEC_compaction cpc  ) 
 

Calculate the mean value for each CAL log end.

Parameters:
cpc Pointer to an LSEC_compaction structure

unsigned LSEC_checkCompaction LSEC_compaction cpc  ) 
 

Check the substructures for errors.

Parameters:
cpc Pointer to a compaction object
Returns:
The last error from the first substrcture to be found in error or LSEC_SUCCESS if there are no errors.

void LSEC_clearCompaction LSEC_compaction cpc  ) 
 

Clear away any context from a previous cycle.

Parameters:
cpc Pointer to a compaction object

unsigned int* LSEC_consignEvt LSEC_compaction cpc,
unsigned int *  buf
 

Copy a single encoded event into the datagram.

Parameters:
cpc Pointer to the compaction structure holding the encoded event
buf Pointer to the location to place the encoded event
Returns:
Pointer to the next output location

unsigned int* LSEC_consignUser LSEC_compaction cpc,
unsigned int *  buf
 

Pack the tables against which the events will be encoded into the buffer.

Parameters:
buf Pointer to the buffer where the context should be placed.
cpc Pointer to the structure containing the tables (a compaction)
Returns:
Pointer to the next output location to be filled.

void LSEC_deleteCompaction LSEC_compaction cpc  ) 
 

Free memory previously allocated with a call to LSEC_newCompaction.

Parameters:
cpc Pointer to a compaction structure previously created by a call to LSEC_newCompaction

unsigned LSEC_encode LSEC_compaction cpc,
EBF_dir *  dir
 

Encode the next event from the collection.

Parameters:
cpc Pointer to an LSEC_compaction structure
dir Pointer to the event to encode
Returns:
Size of the compressed event, or 0 if there is an error

unsigned LSEC_monitorCompaction LSEC_compaction cpc,
unsigned  mon
 

Set the monitoring level for the compaction.

Parameters:
cpc Pointer to an initialised compaction
mon Monitoring level to set
Returns:
The previous monitoring level.

LSEC_compaction* LSEC_newCompaction unsigned  cap  ) 
 

Allocate memory for an LSEC_compaction structure and all the substructures.

Parameters:
cap Capacity of the calibration task, the maximum number of events that can be collected each cycle
Returns:
Pointer to an allocated, initialise, LSEC_compaction structure

unsigned LSEC_processAcd LSEC_compaction cpc  ) 
 

Process ACD compaction data.

Parameters:
cpc Pointer to an LSEC_compaction structure

unsigned LSEC_processCal LSEC_compaction cpc  ) 
 

Process the CAL compression structures.

Parameters:
cpc Pointer to an LSEC_compaction structure

unsigned LSEC_processCalMeans LSEC_compaction cpc  ) 
 

Process the mean values for each CAL log end.

Parameters:
cpc Pointer to an LSEC_compaction structure
Returns:
Size of the calorimeter log context.

unsigned LSEC_processTkr LSEC_compaction cpc  ) 
 

Process the TKR compression structures.

Parameters:
cpc Pointer to an LSEC_compaction structure

void LSEC_reportCompaction LSEC_compaction cpc,
FILE *  fp
 

Write formatted ASCII output to a file.

Parameters:
cpc Pointer to a compaction object
fp Pointer to the destination file

void LSEC_setFourRange LSEC_compaction cpc,
unsigned  range
 

Set the four-range value.

Parameters:
cpc Pointer to a compaction structure
range Flag indicating 4-range or auto-range

void LSEC_setMode LSEC_compaction cpc,
unsigned  mode
 

Set the calibration mode.

Parameters:
cpc Pointer to a compaction structure
mode The calibration mode

unsigned LSEC_sizeofUser32 LSEC_compaction cpc  ) 
 

Calculate the number of 32-bit words required to hold tables against which the events will be encoded.

Parameters:
cpc Pointer to the compaction structure
Returns:
Number of 32-bit words required to hold the context information

unsigned processGem LSEC_compaction cpc  ) 
 

Process the GEM compression structure.

Parameters:
cpc Pointer to an LSEC_compaction structure

unsigned sizeofUserAcd LSEC_compaction cpc  )  [inline, static]
 

Calculate the number of 32-bit words required to hold the tables against which the ACD contributions will be encoded.

Parameters:
cpc Pointer to the compaction structure
Returns:
Number of 32-bit words required to hold the packed tables used to encode the ACD contribution

unsigned sizeofUserCal LSEC_compaction cpc  )  [inline, static]
 

Calculate the number of 32-bit words required to hold the tables against which the CAL contributions will be encoded.

Parameters:
cpc Pointer to the compaction structure
Returns:
Number of 32-bit words required to hold the packed tables used to encode the CAL contribution

unsigned sizeofUserGem LSEC_compaction cpc  ) 
 

Calculate the number of 32-bit words required to hold the tables against which the GEM contributions will be encoded.

Parameters:
cpc Pointer to the compaction structure
Returns:
Number of 32-bit words required to hold the packed tables used to encode the GEM contribution

unsigned sizeofUserTkr LSEC_compaction cpc  )  [inline, static]
 

Calculate the number of 32-bit words required to hold the tables against which the TKR contributions will be encoded.

Parameters:
cpc Pointer to the compaction structure
Returns:
Number of 32-bit words required to hold the packed tables used to encode the TKR contribution


Generated on Wed Dec 5 02:49:40 2007 by  doxygen 1.4.4