GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDST / V1-2-1 > ebf_fes / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

EDST_compareList.h File Reference

Routines to create and access a compare buffer structure. More...

#include <EDS/EBF_dir.h>
#include <EDS/io/EBF_stream.h>

Classes

struct  _EDST_CompareEvt
 struct to save info for a quick compare of a single event there will be a list of these structures More...

Typedefs

typedef struct _EDST_CompareEvt EDST_CompareEvt
 Typedef for struct _EDST_CompareEvt.

Functions

unsigned int EDST_compareInit (EBF_streamType type, const char *name, int firstEvtNum, unsigned int verbose)
 Reads in EBF file and preprocesses it into a structure of contigous events used in a compare test.
unsigned int EDST_compareFind (int gemFileSeqNum, int *fileSeqNum, int *retMissingEvts, int *evtLen32, unsigned int **gemPtr)
 Finds event with given fileSeqNum starting with last evt accessed, return info on it.
unsigned int EDST_compareNextCtb (int numInt32, unsigned int **evtPtr32, int *evtLen32, int *contribOff32, int *contribId)
 find next contributor or partial contributor in compare list
unsigned int EDST_compareCtbById (int id, unsigned int **evtPtr32, int *evtLen32)
 return next whole contributor by id
void EDST_compareClose ()
 closes up compare structure and deallocates memory
int EDST_compareReady ()
 indicated EDST_compareInit() has been run
int EDST_expectedFileSeqNum ()
 return the next fileSeqNum expeccted based on last evt accessed
int EDST_reset ()
 reset compare list to beginning


Detailed Description

Routines to create and access a compare buffer structure.

Author:
Ed Bacho - ebacho@slac.stanford.edu
    CVS $Id: EDST_compareList.h,v 1.5 2011/03/30 20:37:49 russell Exp $

Function Documentation

unsigned int EDST_compareCtbById ( int  id,
unsigned int **  evtPtr32,
int *  evtLen32 
)

return next whole contributor by id

Parameters:
id requested contrib id
evtPtr32 pointer to contributor in compare list
evtLen32 len of contributor in compare list
This routine is called a number of times after EDST_compareFind() to process thru the evt it finds.It is used to process that evt returning pointers to data to compare with. THe state of which evt is stored internally.

References _EDST_CompareEvt::contribIds, _EDST_CompareEvt::contribLen32, and _EDST_CompareEvt::contribPtrs.

unsigned int EDST_compareFind ( int  gemFileSeqNum,
int *  fileSeqNum,
int *  retMissingEvts,
int *  evtLen32,
unsigned int **  gemPtr32 
)

Finds event with given fileSeqNum starting with last evt accessed, return info on it.

Parameters:
gemFileSeqNum 11 bit tag from GEM to use to find evt in file
fileSeqNum returns index of found event in the file
retMissingEvts returns number of events skipped before found (indicates dead time), ret=-1 means cannot find,ret=0=found immediate,ret=N found after skip N evt
evtLen32 returns length of found event in ints
gemPtr32 returns ptr to found evt, the first contribution is always the gem
Returns:
status
Find the next event in list starting at the last evt returned. Matych occurs when given fileSeqNum matches the index of list. Best case is that it will be the next event. (i.e.no missing events) If might skip one or more evts before finding fileSeqNum (i.e. missing events). Worst case is that it will not find it at all. (dataset mismatch)

The caller should get the fileSeqNum from the GEM header of its data. THis routine will return the matching evt from the EBF file which the caller will compare its evt data with.

References _EDST_CompareEvt::evtLen32, and _EDST_CompareEvt::evtPtr.

unsigned int EDST_compareInit ( EBF_streamType  type,
const char *  name,
int  firstEvtNum,
unsigned int  verbose 
)

Reads in EBF file and preprocesses it into a structure of contigous events used in a compare test.

Parameters:
type The type of stream to open 0=FILE, 1=DATA
name The file name or address of the data section
firstEvtNum number of evts in file to skip from beginning of file
verbose Print lots of info
create a compare structure by: reading in a EBF file recombine contributors into contigous packets pull contributors together for a contigous event

References EDST_compareClose().

Referenced by main().

unsigned int EDST_compareNextCtb ( int  numInt32,
unsigned int **  evtPtr32,
int *  evtLen32,
int *  contribOff32,
int *  contribId 
)

find next contributor or partial contributor in compare list

Parameters:
numInt32 ints requested, this is length of buffer that caller has with data
evtPtr32 returns pointer with data that caller compares his data with
evtLen32 len of this segment, may be <= numInt32 requested
contribOff32 offset of evtPtr32 into a contrbutor,0 indicates start
contribId contrib ID of data pointer to by evtPtr32 THis routine is called a number of times after EDST_compareFind() to process thru the evt it finds.It is used to process that evt returning pointers to data to compare with. THe state of which evt and where within evt is stored internally.

References _EDST_CompareEvt::contribIds, _EDST_CompareEvt::contribLen32, _EDST_CompareEvt::contribNum, and _EDST_CompareEvt::contribPtrs.

int EDST_expectedFileSeqNum (  ) 

return the next fileSeqNum expeccted based on last evt accessed

Returns:
fileSeqNum of next evt in list

int EDST_reset (  ) 

reset compare list to beginning

Returns:
old place in compare list


Generated on Wed Nov 21 22:29:20 2012 by  doxygen 1.5.8