GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBP / V1-0-4 > grbpsiu / rhel6-64
#include <GRBP_cache.h>
#include <GRBP_photon.h>
#include <GRBP_DB/GRBP_DB_cache.h>
#include <round.h>
#include <math.h>
Defines | |
#define | report_prms(_costwosigdist) |
Functions | |
static __inline void | clusterPrmsPrepare (GRBP_clusterPrms *prms, const GRBP_DB_cluster *cfg) |
Fills the prms with the derived constants used to add a photon to the candidate list. | |
int | GRBP_cacheSizeof (const GRBP_DB_cache *cfg) |
Determines the sizeof of a photon cache specified by cfg. | |
unsigned char * | GRBP_cacheConstruct (GRBP_cache *cache, const GRBP_DB_cache *cfg, unsigned char *ptr) |
Constructs the input photon cache. | |
void | GRBP_cacheReset (GRBP_cache *cache) |
Resets the photon cache. This routine is generally called after a GRB has been detected, clearing the cache and thus making it ready for a new round of detection. | |
void | GRBP_cacheAdd (GRBP_cache *cache, unsigned int lid, double time, double energy, double dx, double dy, double dz) |
Adds the photon to the cache and updates all the data structures associated with adding this new photon and, potentially, retiring old photons. |
CVS $Id: GRBP_cache.c,v 1.3 2011/03/30 22:11:50 russell Exp $
This is mainly a set of convenience routines, packaging all the calls needed to maintain the input set of photons. There are two different data structures that are involved in with the input photons
The criteria to become a neighbor of a parent photon is captured by the GRBP_clusterPrms data structure. It is write-once structure that contains the various cuts. In this way, it acts as the gate-keeper between the raw photons maintained by GRBP_photonList and the clusters, maintained by GRBP_clusterList.
static __inline void clusterPrmsPrepare | ( | GRBP_clusterPrms * | prms, | |
const GRBP_DB_cluster * | cfg | |||
) | [static] |
Fills the prms with the derived constants used to add a photon to the candidate list.
prms | The parameter block to prepare | |
cfg | The configuration structure to use as the source information |
References _GRBP_clusterPrms::costwosigdist, GRBP_probabilityPrmsSet(), and _GRBP_clusterPrms::probability.
Referenced by GRBP_cacheConstruct().
void GRBP_cacheAdd | ( | GRBP_cache * | cache, | |
unsigned int | lid, | |||
double | time, | |||
double | energy, | |||
double | dx, | |||
double | dy, | |||
double | dz | |||
) |
Adds the photon to the cache and updates all the data structures associated with adding this new photon and, potentially, retiring old photons.
cache | The photon cache to add the new photon to | |
lid | The photon's local index. This is the count of photons received | |
time | The time associated with the photon | |
energy | The energy, in Mev, of the photon | |
dx | The x direction cosine | |
dy | The y direction cosine | |
dz | The y direction cosine |
References _GRBP_cache::clusterList, GRBP__photonListAdd(), GRBP_clusterListAdd(), _GRBP_cache::photonList, and _GRBP_cache::prms.
Referenced by GRBP_clientProcess().
unsigned char * GRBP_cacheConstruct | ( | GRBP_cache * | cache, | |
const GRBP_DB_cache * | cfg, | |||
unsigned char * | ptr | |||
) |
Constructs the input photon cache.
cache | The photon cache to construct | |
cfg | The photon cache configuration | |
ptr | The pointer to the memory to carve the dynamically allcated arrays from. |
References _GRBP_cache::clusterList, clusterPrmsPrepare(), GRBP_clusterListConstruct(), GRBP_photonListConstruct(), _GRBP_cache::photonList, and _GRBP_cache::prms.
Referenced by GRBP_clientConstruct().
void GRBP_cacheReset | ( | GRBP_cache * | cache | ) |
Resets the photon cache. This routine is generally called after a GRB has been detected, clearing the cache and thus making it ready for a new round of detection.
cache | The photon cache to reset |
References _GRBP_cache::clusterList, GRBP_clusterListReset(), GRBP_photonListReset(), and _GRBP_cache::photonList.
Referenced by latReset().
int GRBP_cacheSizeof | ( | const GRBP_DB_cache * | cfg | ) |
Determines the sizeof of a photon cache specified by cfg.
cfg | The photon cache configuration |
References GRBP_clusterListSizeof(), and GRBP_photonListSizeof().
Referenced by GRBP_clientSizeof().