GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBP / V1-0-4 > grbpsiu / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

GRBP_photonList.c File Reference

Routines to manage the list of input photons. More...

#include <GRBP_photonList.h>
#include <GRBP_DB/GRBP_DB_photonList.h>
#include <round.h>

Functions

int GRBP_photonListSizeof (int count)
 Returns the size, in bytes, of the memory needed to hold the variable sized portion of a GRBP_photonList.
unsigned char * GRBP_photonListConstruct (GRBP_photonList *photonList, const GRBP_DB_photonList *cfg, unsigned char *ptr)
 Constructs a photon list with count photons.
void GRBP_photonListReset (GRBP_photonList *photonList)
 Resets the specified photon list to the empty state.


Detailed Description

Routines to manage the list of input photons.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: GRBP_photonList.c,v 1.3 2011/03/30 22:11:51 russell Exp $

Function Documentation

unsigned char* GRBP_photonListConstruct ( GRBP_photonList photonList,
const GRBP_DB_photonList *  cfg,
unsigned char *  ptr 
)

Constructs a photon list with count photons.

Returns:
A pointer to the next available memory location after allocating space to count photons.
Parameters:
photonList The target photon list to construct
cfg The photon list configuration
ptr The current memory pointer. Memory for the storage of the photons will be carved from here. Note that it is assumed the user has called GRBP_photonListSizeof to properly size and then allocate enough memory
Warning:
This routine assumes that the control structure, photonList has already been allocated.

References GRBP_photonListReset(), GRBP_photonListSizeof(), _GRBP_photonList::max, _GRBP_photonList::photon_end, and _GRBP_photonList::photons.

Referenced by GRBP_cacheConstruct().

void GRBP_photonListReset ( GRBP_photonList photonList  ) 

Resets the specified photon list to the empty state.

Parameters:
photonList The photon list to reset
This function is generally used at startup and to clear the context after a GRB has been closed out.

References _GRBP_photon::dx, _GRBP_photon::dy, _GRBP_photon::dz, _GRBP_photon::energy, _GRBP_photon::lid, _GRBP_photonList::max, _GRBP_photon::nxt, _GRBP_photonList::pbeg, _GRBP_photonList::pcur, and _GRBP_photonList::photons.

Referenced by GRBP_cacheReset(), and GRBP_photonListConstruct().

int GRBP_photonListSizeof ( int  count  ) 

Returns the size, in bytes, of the memory needed to hold the variable sized portion of a GRBP_photonList.

Returns:
The size, in bytes, of the memory needed to hold the variable sized portion of a GRBP_photonList.
Parameters:
count The number of photons this list will support
Warning:
This routine does not allocate space for the fixed portion of the GRBP_photonList structure.

Referenced by GRBP_cacheSizeof(), and GRBP_photonListConstruct().


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