GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > GRBP / V0-2-0

Constituent: grbpsiu     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

GRBP_gammaList.c File Reference

Implementation of the routines maintaining the list of gammas. More...

#include "GRBP_gammaList.h"
#include "GRBP_cache.h"
#include "GRBP_gamma.h"
#include "GRBP_photon.h"
#include "GRBP_location.h"
#include "GRBP_probCalculate.h"
#include "wrap.h"
#include "round.h"
#include "GRBP_DB/GRBP_DB_gammaList.h"
#include "PBS/FFS.ih"
#include <math.h>
#include <string.h>

Include dependency graph for GRBP_gammaList.c:


Functions

static __inline GRBP_gammainsert (GRBP_gammaAux *aux, GRBP_gamma *gammas, int cur, int max, double time)
 Locates the insertion point and makes room for a gamma with the specified time.
int GRBP_gammaListSizeof (const GRBP_DB_gammaList *cfg)
 Computes the number of bytes needed for a gamma list of the specified configuration.
unsigned char * GRBP_gammaListConstruct (GRBP_gammaList *list, const GRBP_DB_gammaList *cfg, unsigned char *ptr)
 Constructs the gamma list.
int GRBP_gammaListMerge (GRBP_gammaList *list, unsigned short int nrange, const GRBP_cluster *clusters, signed short int min_idx, unsigned short int max, const unsigned int *masks, unsigned short int nmasks)
 Fills the list of photons used to localization using the parent photon from the specified list of clusters.
int GRBP_gammaListSeed (GRBP_gammaList *list, GRBP_probabilityLogs *plog, float dx0, float dy0, float dz0, float distance_cut, const GRBP_probabilityPrms *prob, const GRBP_photon *photon, int cnt)
 Populates a gamma list with all the photons in the specified range that are within the distance_cut of the the GRB location.
void GRBP_gammaListReset (GRBP_gammaList *list)
 Resets the gamma list to an empty list.

Detailed Description

Implementation of the routines maintaining the list of gammas.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: GRBP_gammaList.c,v 1.3 2007/08/02 17:24:59 russell Exp $

Function Documentation

unsigned char* GRBP_gammaListConstruct GRBP_gammaList list,
const GRBP_DB_gammaList *  cfg,
unsigned char *  ptr
 

Constructs the gamma list.

Returns:
Pointer to the next available memory location
Parameters:
list The list to construct
cfg The configuration of the gamma list
ptr The memory to carve the list from

int GRBP_gammaListMerge GRBP_gammaList list,
unsigned short int  nrange,
const GRBP_cluster *  clusters,
signed short int  min_idx,
unsigned short int  max,
const unsigned int *  masks,
unsigned short int  nmasks
 

Fills the list of photons used to localization using the parent photon from the specified list of clusters.

printf (" Photon #: %3u:%3u ", which, jp);

printf ("ListCur:Cnt %4u:4u", listCur, listCnt);

void GRBP_gammaListReset GRBP_gammaList list  ) 
 

Resets the gamma list to an empty list.

Parameters:
list The gamma list to reset

int GRBP_gammaListSeed GRBP_gammaList list,
GRBP_probabilityLogs plog,
float  dx0,
float  dy0,
float  dz0,
float  distance_cut,
const GRBP_probabilityPrms prob,
const GRBP_photon photon,
int  cnt
 

Populates a gamma list with all the photons in the specified range that are within the distance_cut of the the GRB location.

Returns:
The number of photons entered
Parameters:
list The list to populate.
plog Filled in with logs of the spatial and temporal probabilities
dx0 The normalized X direction cosine of the seed location
dy0 The normalized Y direction cosine of the seed location
dz0 The normalized Z direction cosine of the seed location
distance_cut The distance cut to use. Only photons with 1 - cos (theta) are admitted to the list, where cos (theta) is the dot product of the photon's direction with the GRB location.
prob The parameters used in determining the spatial and temperal probabilities.
photon The first photon in the linked list to use
cnt The number of photons to use

int GRBP_gammaListSizeof const GRBP_DB_gammaList *  cfg  ) 
 

Computes the number of bytes needed for a gamma list of the specified configuration.

Returns:
The number of bytes needed for a gamma list of cfg elements
Parameters:
cfg The configuration of the gamma list

static __inline GRBP_gamma * insert GRBP_gammaAux aux,
GRBP_gamma gammas,
int  cur,
int  max,
double  time
[static]
 

Locates the insertion point and makes room for a gamma with the specified time.

Returns:
The insert point
Parameters:
aux The auxilliary data of the gammas to scan
gammas The list of gammas to scan
cur The next available slot. This implies that the latest arriving photon is logically one slot earlier.
max The maximum number of photons in photons, i.e. the size of the circular list of photons
time The time of the photon to insert
The list of gammas is scanned backwards in time order, looking for the first gamma with a time less than time. The information for each gamma failing this test is moved up a slot, thus creating an empty slot for either the new photon to be inserted or the next gamma in the list to be moved up.


Generated on Fri Aug 3 03:47:14 2007 by  doxygen 1.4.4