GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QEMP / V1-1-2

Constituent: qemp     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QASC.c File Reference

Expand and access routines to the ACD Software Counters. More...

#include "QEMP/QASC.h"
#include "QEMP/QEMP.h"
#include "QEMP/QASC_pubdefs.h"
#include "QASC_pvtdefs.h"
#include "QEMP_pvtdefs.h"
#include "QSE/QSE_acdMap.h"
#include "EMP/ASC_ascCtb.h"
#include "EMP/ASC_ids.h"
#include "ZLIB/zlib.h"
#include "PBS/BSWP.h"
#include "PBI/Endianness.h"
#include "PBI/Check.h"
#include "PBI/Ofs.h"
#include <string.h>
#include <stdio.h>

Include dependency graph for QASC.c:


Defines

#define NULL   ((void *)0)

Functions

static QEMP_STATUS expand_raw0 (QASC *qasc, const ASC_ascBdy_Raw0 *asc, unsigned int size)
 Expand the ASC data in the raw format to QASC format.
static QEMP_STATUS expand_gzip0 (QASC *qasc, const ASC_ascBdy_Gzip0 *asc, unsigned int size)
 Expand the ASC data in the raw format to QASC format.
static int do_inflate (const void *src, unsigned int srcSize, void *dst, unsigned int dstSize)
 Decompress the source buffer to the destination buffe.
QEMP_status QASC_expand (QASC *qasc, const LSF_contribution *ctb)
 Routine to check integrity and swap/uncompress input data into a 2nd buffer.
const QEMP_hdrQASC_qempHdrLocate (const QASC *qasc)
 Get pointer to QEMP_hdr structure.
unsigned int QASC_numProcessedEvts (const QASC *qasc)
 Get the number of processed events in sample (after prescale).
const QASC_statsQASC_statsLocate (const QASC *qasc)
 Get a pointer to the QASC performance monitoring statistics.
const QASC_summaryQASC_summaryLocate (const QASC *qasc)
 Get a pointer to the QASC summary structure.
const QASC_cnoHistogramQASC_cnoHistogramLocate (const QASC *qasc, unsigned int board_pair)
 Returns a pointer to the requested CNO histogram.
int QASC_idxGemGet (int list, int channel)
 Maps an ACD GEM list and channel into a universal index.
int QASC_idxAemGet (int board, int channel)
 Maps an ACD AEM board number and channel into a universal index.
const QASC_tileHistogramQASC_tileHistogramLocate (const QASC *qasc, unsigned int idx)
 Returns a pointer to the specified tile histogram.
static __inline int inflater (const void *src, unsigned int srcSize, void *dst, unsigned int dstSize)
 Decompress the source buffer to the destination buffe.
static void __inline stats_transfer (QASC_stats *dst, const ASC_stats *src, unsigned int nsampled)
 Transfers the contents of an ASC_stats structure plus the number of events sampled to a QASC_stats structure.

Detailed Description

Expand and access routines to the ACD Software Counters.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: QASC.c,v 1.2 2007/04/03 20:06:14 russell Exp $

Function Documentation

static int do_inflate const void *  src,
unsigned int  srcSize,
void *  dst,
unsigned int  dstSize
[static]
 

Decompress the source buffer to the destination buffe.

Return values:
0 Success
-1 Failure
Parameters:
src The source buffer of compressed data
srcSize The size, in bytes, of the source buffer of compressed data
dst The destination buffer for decompressed data
dstSize The available space, in bytes, of the destination buffer

static QEMP_STATUS expand_gzip0 QASC qasc,
const ASC_ascBdy_Gzip0 *  asc,
unsigned int  size
[static]
 

Expand the ASC data in the raw format to QASC format.

Return values:
QEMP_STATUS_SUCCESS,if successful (0)
QEMP_STATUS_CTB_BAD_LEN32,if the contributor length is inconsistent with the data.
QEMP_STATUS_CTB_INFLATE_FAIL,indicates inflate failed
Parameters:
qasc The data access handle to be filled
asc The source data
size The size, in bytes, of the source data.

static QEMP_STATUS expand_raw0 QASC qasc,
const ASC_ascBdy_Raw0 *  asc,
unsigned int  size
[static]
 

Expand the ASC data in the raw format to QASC format.

Return values:
QEMP_STATUS_SUCCESS,if successful (0)
QEMP_STATUS_CTB_BAD_LEN32,if the contributor length is inconsistent with the data.
Parameters:
qasc The data access handle to be filled
asc The source data
size The size, in bytes, of the source data.

static __inline int inflater const void *  src,
unsigned int  srcSize,
void *  dst,
unsigned int  dstSize
[static]
 

Decompress the source buffer to the destination buffe.

Return values:
0 Success
-1 Failure
Parameters:
src The source buffer of compressed data
srcSize The size, in bytes, of the source buffer of compressed data
dst The destination buffer for decompressed data
dstSize The available space, in bytes, of the destination buffer

const QASC_cnoHistogram* QASC_cnoHistogramLocate const QASC qasc,
unsigned int  board_pair
 

Returns a pointer to the requested CNO histogram.

Return values:
Non-NULL,a pointer to the requested CNO histogram
NULL,the board_pair was not within the range 0-5
Parameters:
qasc The access handle
board_pair board (0-5)

QEMP_status QASC_expand QASC qasc,
const LSF_contribution *  ctb
 

Routine to check integrity and swap/uncompress input data into a 2nd buffer.

Return values:
QEMP_STATUS_SUCCESS,if successful (0)
QEMP_STATUS_CTB_BAD_LEN32,if the contributor length is inconsistent with the data.
QEMP_STATUS_CTB_UNKNOWN_VER,if the encoding/data format version is unknown.
QEMP_STATUS_CTB_INFLATE_FAIL,for compressed formats, indicates the failure to inflate the data
Parameters:
qasc The data access handle to be filled
ctb Input buffer
The check routine does integrity checks on the given LSF contributor packet and then decompress/swaps data into the output buffer. THe size of the output buffer is determined by QEMP_sizeof(). The output buffer can then be used as input with the QASC_xxxxLocate routines.

This routine assumes the contributor has been byte-swapped.

int QASC_idxAemGet int  board,
int  channel
 

Maps an ACD AEM board number and channel into a universal index.

Return values:
>=0,The universal index for the specifed ACD AEM board and channel
< 0, Invalid board or channel number
Parameters:
board This is a value between 0 and 11 corresponding to the the 12 AEM FREE board/cable numbers
  • 0 1LA, 1 1RB
  • 2 2LA, 3 2LB
  • 4 2RA, 5 2RB
  • 6 3LA, 7 3RB
  • 8 4LA, 9 4LB
  • 9 4RA, 10 4RB
channel The channel, 0-18, within each FREE board/cable.

int QASC_idxGemGet int  list,
int  channel
 

Maps an ACD GEM list and channel into a universal index.

Return values:
>=0,The universal index for the specifed ACD list and channel
< 0, Invalid list or channel number
Parameters:
list This is a value between 0 and 3 corresponding to the 4 words in the GEM record -0 XZ plane -1 YZ plane -2 XY plane -3 RU plane
channel The channel, 0-31, within each list. The bits are numbered from least significant bit to most significant bit

unsigned int QASC_numProcessedEvts const QASC qasc  ) 
 

Get the number of processed events in sample (after prescale).

Return values:
The number of processed events (after prescaling)
Parameters:
qasc The access handle
----------------------------------------------------------------------

const QEMP_hdr* QASC_qempHdrLocate const QASC qasc  ) 
 

Get pointer to QEMP_hdr structure.

Return values:
Pointer to the QEMP_hdr structure
Parameters:
qasc Access handle

const QASC_stats* QASC_statsLocate const QASC qasc  ) 
 

Get a pointer to the QASC performance monitoring statistics.

Returns:
A pointer to the QASC performance monitoring statistics
Parameters:
qasc The access handle

const QASC_summary* QASC_summaryLocate const QASC qasc  ) 
 

Get a pointer to the QASC summary structure.

Returns:
A pointer to the QASC summary structure
Parameters:
qasc The access handle

const QASC_tileHistogram* QASC_tileHistogramLocate const QASC qasc,
unsigned int  idx
 

Returns a pointer to the specified tile histogram.

Return values:
Non-NULL,a pointer to the specified histogram
NULL,an invalid index, geo_idx, was specified. This must be in the range 0-128
Parameters:
qasc The access handle
idx The index, set QASC_tileHistogramGeoIdx;

static __inline void stats_transfer QASC_stats dst,
const ASC_stats *  src,
unsigned int  nsampled
[static]
 

Transfers the contents of an ASC_stats structure plus the number of events sampled to a QASC_stats structure.

Parameters:
dst The destination QASC_stats structure
src The source ASC_stats structure
nsampled The number of events sampled
The QASC_stats structure is not a mirror of an ASC_stats, having the number of events sampled as an additional member. Because of this a formalized transfer method is needed.


Generated on Thu Apr 17 01:17:24 2008 by  doxygen 1.4.4