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


Interface   Data Structures   File List   Data Fields   Globals  

GRBP_cluster.c File Reference

GRB clustering. More...

#include <GRBP_cluster.h>
#include <GRBP_cache.h>
#include <dprintf.h>
#include <PBI/FFS.ih>

Defines

#define report_prms(_min_idx,_max_idx,_max,_pdists,_hi_pdists, _lo_pdists,_pdts,_hi_pdts,_lo_pdts,_j,_logP_sum,_threshold)
#define report_masks(_title, _masks, _nmasks)
#define report_newline()
#define NULL   ((void *)0)

Functions

static __inline int find (const unsigned int *bl, int idx, unsigned int mask, int max)
 Finds the first set bit in the bit list.
static __inline unsigned int * copy (unsigned int *dst, const unsigned int *src, int beg, int cnt, int max)
 Copies cnt 32-bit words starting at offset beg in src to dst. src is treated as a circular array of length max. Note that dst is not treated as a circular array.
static __inline unsigned int * copy_or (unsigned int *dst, const unsigned int *src, int beg, int cnt, int max)
 Or's in cnt 32-bit words starting at offset beg in src to dst. src is treated as a circular array of length max. Note that dst is not treated as a circular array.
int GRBP_clusterGammasGather (const GRBP_cluster *clusters, int beg, int end, int max, const unsigned short int *list, int cnt, double contrast, double threshold, unsigned int *bl, GRBP_probabilityLogs *plog_max)
 Scans the circular list of clusters looking for clusters that are over the probability threshold. A list of photons that are members of such clusters is accumulated (in the form of a bit list) and returned in masks.


Detailed Description

GRB clustering.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: GRBP_cluster.c,v 1.6 2011/03/30 22:11:50 russell Exp $

The cluster is the object used to detect a GRB. It has almost no role in locating a GRB. It is really a pattern recognition object. Each input photon acts a the parent of a cluster. A cluster is formed around that parent photon by photons that are within a configurable angular distance from the parent. When a new photon arrives, the previous N photons are checked. When a new photon arrives, the oldest photon in the cluster is retired and replaced with the new photon. This continues until the parent photon itself is retired.

When a photon is added to the cluster, its probability of being within the specified angular distance and within the time (based on the background rate) is computed. The sum of all the spatial and temporal probabilities gives a measure of the likelihood that this photon and its neighbors are from a GRB.


Function Documentation

static __inline unsigned int * copy ( unsigned int *  dst,
const unsigned int *  src,
int  beg,
int  cnt,
int  max 
) [static]

Copies cnt 32-bit words starting at offset beg in src to dst. src is treated as a circular array of length max. Note that dst is not treated as a circular array.

Returns:
The next destination address
Parameters:
dst The destination address
src The source address
beg The index of the first word in src to copy
cnt The number of 32-bit words to copy
max The size of the circular array src

References wrap_hi().

Referenced by GRBP_clusterGammasGather().

static __inline unsigned int * copy_or ( unsigned int *  dst,
const unsigned int *  src,
int  beg,
int  cnt,
int  max 
) [static]

Or's in cnt 32-bit words starting at offset beg in src to dst. src is treated as a circular array of length max. Note that dst is not treated as a circular array.

Returns:
The next destination address
Parameters:
dst The destination address
src The source address
beg The index of the first word in src to copy
cnt The number of 32-bit words to copy
max The size of the circular array src

References wrap_hi().

Referenced by GRBP_clusterGammasGather().

static __inline int find ( const unsigned int *  bl,
int  idx,
unsigned int  mask,
int  max 
) [static]

Finds the first set bit in the bit list.

Returns:
The bit number of the first set bit
Parameters:
bl The bit list
idx The index of the first 32 bit word
mask Used to mask off the relevant bits from the first word This is effectively allows the search to start at the right bit.
max The number of 32 bit words in the circular bit list

References wrap_hi().

Referenced by GRBP_clusterGammasGather().

int GRBP_clusterGammasGather ( const GRBP_cluster *  clusters,
int  beg,
int  end,
int  max,
const unsigned short int *  list,
int  cnt,
double  contrast,
double  threshold,
unsigned int *  bl,
GRBP_probabilityLogs plog_max 
)

Scans the circular list of clusters looking for clusters that are over the probability threshold. A list of photons that are members of such clusters is accumulated (in the form of a bit list) and returned in masks.

Returns:
The number of masks that need to be scanned
Parameters:
clusters The circular list of clusters
beg The index of the first cluster to consider
end The index of the last cluster to consider. Note that this is the actual last cluster, not one past it.
max The number of clusters in the circular list. This determines the wrap-around point
list A list of all clusters, by index, that have had photons added to their neighbor list. These are the only clusters that need to be checked, and of these only those in the beg,end interval are valid for the window being considered. This list is ordered from oldest to newest photon.
cnt The number of indices in list.
contrast The temporal contrast factor. The log of the temporal probability will be multiplied by this factor when computing the sum of the spatial and temporal probabilities
threshold The cluster threshold
bl The bit list to fill in with the gammas
plog_max Argument to receive the logs of spatial and temporal probabilities from the cluster with the largest total probability. This is filled if and only if the total probability exceeds threshold.

References _GRBP_neighborList::bl, copy(), copy_or(), find(), _GRBP_neighborList::info, _GRBP_neighborList::rsumlog10pdists, _GRBP_neighborList::rsumlog10pdts, _GRBP_probabilityLogs::spatial, _GRBP_neighborInfo::sum_log10_pdists, _GRBP_neighborInfo::sum_log10_pdts, and _GRBP_probabilityLogs::temporal.

Referenced by GRBP_windowTier1LatUpdate().


Generated on Tue Nov 29 17:07:16 2011 by  doxygen 1.5.8