GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > GRBP / V1-0-0
Constituent: grbpsiu     Tag: rad750
#include "GRBP_clusterList.h"
#include "GRBP_cluster.h"
#include "GRBP_photon.h"
#include "GRBP_probCalculate.h"
#include "round.h"
#include "touch.h"
#include "wrap.h"
#include "tmr.h"
#include "dprintf.h"
#include "GRBP_DB/GRBP_DB_clusterList.h"
#include "EDS/FFS.h"
#include <math.h>
#include <string.h>
#include <stdio.h>
Include dependency graph for GRBP_clusterList.c:
Defines | |
#define | report_timing() |
#define | hist_timing(_hist, _tbeg, _tend) |
#define | clear_timing() |
#define | report_declare(statement) |
#define | report_newline() |
#define | report_photon_header(_cut_distance) |
#define | report_photon_add_0(_list,_cur,_jp,_distance) |
#define | report_photon_add_replace(_list,_cur,_jp,_nxt) ; |
#define | report_photon_ignore_retire(_bl,_cur) |
#define | report_photon_add_last(_pointer,_new_cnt) |
#define | report_photon_last_probabilities(_log10_pdts,_rsumlog10_pdists,_rsumlog10_pdts) |
#define | report_photon_probabilities(_new_cnt,_log10_pdist,_log10_pdts,_rsumlog10_pdists,_rsumlog10_pdts) |
Functions | |
static __inline void | cluster_reset (GRBP_cluster *cluster, int cnt) |
Resets this cluster's stored context. | |
static __inline int | bit_list_sizeof (int cluster_count) |
Computes the size, in bytes, for the bit list containing the list of neighbors. | |
static __inline void | bit_list_init (unsigned int *bl, int cluster_count, int cur) |
Initializes the bit list by clearing all the bits and setting bit cur. Note that full 32-bits are cleared, so more bits may actually be cleared than specified. | |
static __inline void | bit_list_clear (unsigned int *bl, int beg, int end, int max) |
Clears the exclusive bits from beg to end. If beg is greater than end, the list is cleared in a wrap-around sense using max as the wrap point. | |
static __inline int | neighbor_list_sizeof (int cluster_count, int photon_count) |
Computes the size, in bytes, for the variable sized portion of a neighbor list containing a maximum cluster_count neighbors. and a cross reference index of maximum photon_count. | |
static __inline float | calc_spatial (const GRBP_probSpatialCtl *ctl, double costhetamax, double log10_costhetamax, double distance) |
Wrapper routine to centralize the calculation of the log of the spatial probability. | |
static __inline float | calc_temporal (const GRBP_probTemporalCtl *ctl, double background_rate, double delta_time) |
Wrapper routine to centralize the calculation of the log of the temporal probability. | |
int | GRBP_clusterListSizeof (int cluster_count, int photon_count) |
Calculates the size, in bytes, to hold a cluster list with cluster_count clusters and a cross-reference array of for photon_count photons. | |
unsigned char * | GRBP_clusterListConstruct (GRBP_clusterList *clusterList, const GRBP_DB_clusterList *cfg, int photonCount, unsigned char *ptr) |
Constructs the cluster list according to the specified values. | |
void | GRBP_clusterListAdd (GRBP_clusterList *clusterList, const GRBP_clusterPrms *prms, double time, double energy, double dx, double dy, double dz) |
Adds photon to the clusterList using prms as the source of the parameters which control the calculation of the probabilities, both temporal and spatial, as well as the admittance criteria to call a photon a neighbor of another photon. | |
void | GRBP_clusterListReset (GRBP_clusterList *clusterList) |
Resets the specified cluster list. |
CVS $Id: GRBP_clusterList.c,v 1.4 2007/10/10 23:59:47 russell Exp $
This contains the heart of the GRB detection code and, in order to avoid N**2 behaviour, it is also the trickiest piece of code. A cluster is formed around each new photon. In addition, all other clusters are updated, retiring the oldest photon and replacing it with the new photon. In order to support multiple windows, the detection variable, the total probability of a cluster, is keep as a running sum. By doing this, the probability of a cluster of any size, up to a configurable maximum size, can be computed simple by subtracting the values associated with oldest and newest photon.
The maximum size of the cluster affects not only the maximum depth one can look, but also has a large impact on the number of CPU cycles used. This is because every new photon must be used to establish its own cluster (proportional to the maximum depth) and to update each existing cluster (again proportional to the maximum depth.) It is expected that values up to around 100 can be supported if the rate of new photons is around 200Hz.
|
Clears the exclusive bits from beg to end. If beg is greater than end, the list is cleared in a wrap-around sense using max as the wrap point.
|
|
Initializes the bit list by clearing all the bits and setting bit cur. Note that full 32-bits are cleared, so more bits may actually be cleared than specified.
|
|
Computes the size, in bytes, for the bit list containing the list of neighbors.
|
|
Wrapper routine to centralize the calculation of the log of the spatial probability.
|
|
Wrapper routine to centralize the calculation of the log of the temporal probability.
|
|
Resets this cluster's stored context.
|
|
Adds photon to the clusterList using prms as the source of the parameters which control the calculation of the probabilities, both temporal and spatial, as well as the admittance criteria to call a photon a neighbor of another photon.
|
|
Constructs the cluster list according to the specified values.
|
|
Resets the specified cluster list.
|
|
Calculates the size, in bytes, to hold a cluster list with cluster_count clusters and a cross-reference array of for photon_count photons.
|
|
Computes the size, in bytes, for the variable sized portion of a neighbor list containing a maximum cluster_count neighbors. and a cross reference index of maximum photon_count.
|