GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-12-1 > eds / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

EDR_tkrUnpack.h File Reference

Defines the interface to the TKR LAT unpacking routine. More...


Typedefs

typedef enum _EDR_TKRUNPACK_M EDR_TKRUNPACK_M
 Typedef for enum _EDR_TKRUNPACK_M.

Enumerations

enum  _EDR_TKRUNPACK_M {
  EDR_TKRUNPACK_M_STRIPS_ALL = 0xffff0000,
  EDR_TKRUNPACK_M_TOTS_ALL = 0x0000ffff,
  EDR_TKRUNPACK_M_ALL = 0xffffffff
}
 Convenience symbols for unpacking all strip, TOT or both from all towers with data. More...

Functions

static unsigned int __inline EDR__tkrUnpackTowerBitStrips (int tower)
 Constructs the bit mask indicating to unpack the strip data for the specified tower number.
static unsigned int __inline EDR__tkrUnpackTowerBitTots (int tower)
 Constructs the bit mask indicating to unpack the TOT data for the specified tower number.
int EDR_tkrUnpack (EDR_tkr *tlr, const EBF_dir *dir, unsigned int stripsTots)
 Driver routine to unpack the specified TKR towers.
int EDR_tkrUnpackInit (EDR_tkr *tlr)
 Performs one time initialization of a Track LAT record.
int EDR_tkrUnpackSizeof (void)
 Returns the size, in bytes, of a EDR_tkr.
void EDR_tkrUnpackReset (EDR_tkr *tlr)
 Resets the tlr record, preparing it to receive another unpacked event.


Detailed Description

Defines the interface to the TKR LAT unpacking routine.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: EDR_tkrUnpack.h,v 1.4 2005/10/13 22:00:55 russell Exp $

These routines unpack the EBF TKR data into the EDR_tkr record. The basic usage outline is
      int   nbytes = EDR_tkrUnpackSizeof ();
      EDR_tkr *tkr = (EDR_tkr *)malloc (nbytes);

      // Initialize the data structure
      EDR_tkrUnpackInit (tkr);

      for_each_event
      {

          EBF_dirCompose     (dir, evt);
          EDR_tkrUnpackReset (tkr);

          // .. assuming tower 1 looks interesting
          EDR_tkrUnpack (tkr, dir, EDR__tkrUnpackStripsTowerBit(1));

          // .. maybe towers 6 & 7 look interesting
          EDR_tkrUnpack (tkr, dir, EDR__tkrUnpackStripsTowerBit(6)
                                  |EDR__tkrUnpackStripsTowerBit(7));

         // .. perhaps one has a routine that looks for interesting towers
         towers = look_for_something_interest (...);
         EDR_tkrUnpack (tkr, dir, towers);

      }

      // At some time latter, one may wish to grab the TOTs
      EDR_tkrUnpack (tkr, dir, EDR__tkrUnpackTotsTowerBit (6));

      // ..or may wish every tower that has data to be completely unpacked
      EDR_tkrUnpack (tkr, dir, -1);

Note that by separating out the reset functionality from the basic unpacking, one can repeatedly call the unpacking routines, restricting the unpacking to only those towers that are interesting at that time. This is important given that the TKR is the most expensive data to unpack.

Enumeration Type Documentation

Convenience symbols for unpacking all strip, TOT or both from all towers with data.

Enumerator:
EDR_TKRUNPACK_M_STRIPS_ALL  Unpack the strip data on all towers with data
EDR_TKRUNPACK_M_TOTS_ALL  Unpack the TOT data on all towers with data
EDR_TKRUNPACK_M_ALL  Unpack both the strip and TOT data on all towers with data


Function Documentation

static unsigned int __inline EDR__tkrUnpackTowerBitStrips ( int  tower  )  [static]

Constructs the bit mask indicating to unpack the strip data for the specified tower number.

Returns:
The bit mask for the specified tower
Parameters:
tower The tower number to construct the bit mask for
This is the most modular way of constructing a bit mask for the specified tower. These values can be OR'd together and passed as the tmsk parameter to EDR_tkrUnpack function.

static unsigned int __inline EDR__tkrUnpackTowerBitTots ( int  tower  )  [static]

Constructs the bit mask indicating to unpack the TOT data for the specified tower number.

Returns:
The bit mask for the specified tower
Parameters:
tower The tower number to construct the bit mask for
This is the most modular way of constructing a bit mask for the specified tower. These values can be OR'd together and passed as the tmsk parameter to EDR_tkrUnpack function.

int EDR_tkrUnpack ( EDR_tkr tlr,
const EBF_dir dir,
unsigned int  stripsTots 
)

Driver routine to unpack the specified TKR towers.

Parameters:
tlr The TKR LAT record structure to receive the unpacked data
dir The standard directory structure allowing the routine to traverse the LAT event record.
stripsTots A 32-bit word composed of two 16-bit masks. The upper 16-bit mask represents towers to unpack the strip data, the lower towers to unpack the TOT data. In both cases the MSB of the mask = Tower 0.
Returns:
Status, currently always success.
Warning:
It is very difficult to unpack the TOTs without unpacking the strips. Currently the design decision is to unpack the OR of these two masks. One, however, should not count on future implementations to unpack the towers. All that is guaranteed by this interface is that all towers specified to be unpack will be unpacked, and all towers specified to have their TOTs unpacked will have their TOTs unpacked.
Note the call
      status = EDR_tkrUnpack (tlr, tkr, -1);

Will completely unpack both the strip data and the TOT data from all towers that have data. Also note that when examining the structure field member, twrMap, that it will always be a proper subset of those towers that have data.

int EDR_tkrUnpackInit ( EDR_tkr tlr  ) 

Performs one time initialization of a Track LAT record.

Returns:
Status, currently always SUCCESS
Parameters:
tlr Pointer to the structure to initialize
This function should be called only once to initialize the record. After that, TFC_latReset should be called to reset the structure before each unpack.

Referenced by initIxbObjTbl().

void EDR_tkrUnpackReset ( EDR_tkr tlr  ) 

Resets the tlr record, preparing it to receive another unpacked event.

Parameters:
tlr Pointer to the structure to reset.
This function should be called prior to unpacking a new event. It performs the minimal work needed to prepare the structure to receive a new event. Separating this piece of work from the unpacking routine proper allows the unpacker to be called repeatedly with different tower masks. For example, one could unpack a tower at a time using the following sequence
    EDR_tkrUnpackReset (tkr);
    EDR_tkrUnpack      (tkr, dir, EDR__tkrUnpackTowerNum(1));
    EDR_tkrUnpack      (tkr, dir, EDR__tkrUnpackTowerNum(4));
    EDR_tkrUnpack      (tkr, dir, EDR__tkrUnpackTowerNum(8)
                                | EDR__tkrUnpackTowerNum(9));

References _EDR_tkrLayer::beg, _EDR_tkrLayer::cnt, and EDR_TKR_K_CLUSTERS_PER_LAYER_MAX.

Referenced by initIxbObjTbl().

int EDR_tkrUnpackSizeof ( void   ) 

Returns the size, in bytes, of a EDR_tkr.

Returns:
The size, in bytes, of a EDR_tkr.
This function should be called to determine the size of an EDR_tkr structure. This allows the calling program to avoid including the structure definition an EDR_tkr.

After allocating an EDR_tkr structure, the structure should be initialized using EDR_tkrUnpackInit().


Generated on Thu Sep 27 13:51:03 2012 by  doxygen 1.5.8