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


Interface   Data Structures   File List   Data Fields   Globals  

GRBP_probCalculate.h File Reference

The calculation routines. More...

#include <GRBP_math.h>
#include <EDS/TMR.h>
#include <PBI/PTR.h>

Classes

struct  _GRBP_probTemporalCtl
 The temporal probability control handle. More...
struct  _GRBP_probSpatialCtl
 The temporal probability control handle. More...

Typedefs

typedef struct
_GRBP_probTemporalCtl 
GRBP_probTemporalCtl
 Typedef for struct _GRBP_probTemporalCtl.
typedef struct _GRBP_probSpatialCtl GRBP_probSpatialCtl
 Typedef for struct _GRBP_probSpatialCtl.

Enumerations

enum  GRBP_probTemporalDef {
  TEMPORAL_LOW_EXP = 28,
  TEMPORAL_NBITS_EXP = 5,
  TEMPORAL_NBITS_MAN = 8,
  TEMPORAL_NBITS = (TEMPORAL_NBITS_EXP + TEMPORAL_NBITS_MAN),
  TEMPORAL_SIZE = (1 << TEMPORAL_NBITS),
  TEMPORAL_SHIFT = (FLOAT_V_EXP - TEMPORAL_NBITS_MAN),
  TEMPORAL_INC = (1 << TEMPORAL_SHIFT),
  TEMPORAL_BEG,
  TEMPORAL_ZERO_IDX,
  TEMPORAL_ZERO_OFFSET = (TEMPORAL_ZERO_IDX * sizeof (float))
}
enum  GRBP_probSpatialDef {
  SPATIAL_LOW_EXP = 21,
  SPATIAL_NBITS_EXP = 5,
  SPATIAL_NBITS_MAN = 8,
  SPATIAL_NBITS = (SPATIAL_NBITS_EXP + SPATIAL_NBITS_MAN),
  SPATIAL_SIZE,
  SPATIAL_SHIFT = (FLOAT_V_EXP - SPATIAL_NBITS_MAN),
  SPATIAL_INC = (1 << SPATIAL_SHIFT),
  SPATIAL_BEG,
  SPATIAL_ZERO_IDX = (((127<<FLOAT_V_EXP)-(SPATIAL_BEG)) >> SPATIAL_SHIFT),
  SPATIAL_ZERO_OFFSET = (SPATIAL_ZERO_IDX * sizeof (float))
}

Functions

const GRBP_probTemporalCtlGRBP_probTemporalConstruct (void)
 Constructs the lookup table for the time probability calculation.
float GRBP_probTemporalCalculate (const GRBP_probTemporalCtl *ctl, float delta_time)
 Returns the log, base 10, of the temporal probability for the specified time difference delta_time.
static __inline float GRBP__probTemporalCalculate (const GRBP_probTemporalCtl *ctl, float delta_time)
 Computes the temporal probability via a table lookup method.
const GRBP_probSpatialCtlGRBP_probSpatialConstruct (double log10_costhetamax)
 Constructs the control structure use to when computing the spatial probability.
float GRBP_probSpatialCalculate (const GRBP_probSpatialCtl *ctl, float distance)
 Returns the log, base 10, of the spatial probability for the angular distance distance.
static __inline float GRBP__probSpatialCalculate (const GRBP_probSpatialCtl *ctl, float distance)
 Computes the spatial probability via a table lookup method.
static __inline double calculate_spatial_probability (double distance, double costhetamax)
 Calculate the spatial probabilty.
static __inline double calculate_spatial_log10P (double distance, double costhetamax, double log10_costhetamax)
 Calculate the -log10 (spatial probabilty).
static __inline double calculate_temporal_probability (double delta_time, double background_rate)
 Calculates the temporal probablity for the given delta time.
static __inline double calculate_temporal_log10P (double delta_time, double background_rate)
 Calculates the temporal probablity for the given delta time.
static __inline float calculate (const float *t, float val, int beg, int nman, int nshift, int o_offset)
 Workhorse lookup + optional linear correction routine.


Detailed Description

The calculation routines.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: GRBP_probCalculate.h,v 1.2 2011/03/30 22:11:51 russell Exp $

Function Documentation

static __inline float calculate ( const float *  t,
float  val,
int  beg,
int  nman,
int  nshift,
int  o_offset 
) [static]

Workhorse lookup + optional linear correction routine.

Returns:
The calculated value
Parameters:
t The function lookup table
val The value to feed the lookup table
beg The lowest value that can be looked up. Values less than this return 0
nman The number of bits of lookup in the mantissa
nshift The shift amount needed to extract the lookup index from val
o_offset The offset of the high end of the table. Values giving offsets larger than this will be returned as the t[o_offset]

References FLOAT_V_EXP, _Float::sl, _Float::ul, and _Float::v.

Referenced by GRBP__probSpatialCalculate(), and GRBP__probTemporalCalculate().

static __inline double calculate_spatial_log10P ( double  distance,
double  costhetamax,
double  log10_costhetamax 
) [static]

Calculate the -log10 (spatial probabilty).

)

Parameters:
distance The inter-photon distance expressed as 1 - cos (theta)
costhetamax The maximum that 1 - cos (theta) can be. This is set by the largest angle track that the LAT can accomodate.
log10_costhetamax Precalculated value, log10 (costhetamax)
If FLATTEN is defined, an ad hoc polynomial will be used that will flatten out the spatial probability. This polynomial fit would have to be determined in orbit with real background. It does not change the verification that we need to do...

static __inline double calculate_spatial_probability ( double  distance,
double  costhetamax 
) [static]

Calculate the spatial probabilty.

Parameters:
distance The inter-photon distance expressed as 1 - cos (theta)
costhetamax The maximum that 1 - cos (theta) can be. This is set by the largest angle track that the LAT can accomodate.
If FLATTEN is defined, an ad hoc polynomial will be used that will flatten out the spatial probability. This polynomial fit would have to be determined in orbit with real background. It does not change the verification that we need to do...

static __inline double calculate_temporal_log10P ( double  delta_time,
double  background_rate 
) [static]

Calculates the temporal probablity for the given delta time.

Returns:
The temporal probability
Parameters:
delta_time The time difference
background_rate The background rate expected in the cone defining the cluster

References calculate_temporal_probability().

static __inline double calculate_temporal_probability ( double  delta_time,
double  background_rate 
) [static]

Calculates the temporal probablity for the given delta time.

Returns:
The temporal probability
Parameters:
delta_time The time difference
background_rate The background rate expected in the cone defining the cluster

Referenced by calculate_temporal_log10P().

static __inline float GRBP__probSpatialCalculate ( const GRBP_probSpatialCtl ctl,
float  distance 
) [static]

Computes the spatial probability via a table lookup method.

Returns:
The log, base 10, of the spatial probability for the angular distance, distance.
Parameters:
ctl The spatial probability control structure
distance The angular distance, specified as 1 - dot_product to compute the spatial probability for.

References calculate(), and _GRBP_probSpatialCtl::table.

Referenced by calc_spatial(), and GRBP_probSpatialCalculate().

static __inline float GRBP__probTemporalCalculate ( const GRBP_probTemporalCtl ctl,
float  delta_time 
) [static]

Computes the temporal probability via a table lookup method.

Returns:
The log, base 10, of the temporal probability for the time difference, delta_time.
Parameters:
ctl The temporal probability control structure
delta_time The value to compute the temporal probability for

References calculate(), and _GRBP_probTemporalCtl::table.

Referenced by calc_temporal(), and GRBP_probTemporalCalculate().

float GRBP_probSpatialCalculate ( const GRBP_probSpatialCtl ctl,
float  distance 
)

Returns the log, base 10, of the spatial probability for the angular distance distance.

Returns:
The log, base 10, of the spatial probability.
Parameters:
ctl The control handle for calculating the spatial probability.
distance The angular separation expressed as 1 - dot_product.

References GRBP__probSpatialCalculate().

Referenced by GRBP_gammaListSeed(), and GRBP_windowTier2Update().

const GRBP_probSpatialCtl* GRBP_probSpatialConstruct ( double  log10_costhetamax  ) 

Constructs the control structure use to when computing the spatial probability.

Returns:
Pointer to the control structure
Parameters:
log10_costhetamax The log, base 10, of the cosine of the maximum opening angle, in radians. The maximum opening angle is the acceptance and is generally the equivalent of about ~115 degrees.

References _GRBP_probSpatialCtl::table, _Float::ul, and _Float::v.

Referenced by GRBP_probabilityPrmsEstablish().

float GRBP_probTemporalCalculate ( const GRBP_probTemporalCtl ctl,
float  delta_time 
)

Returns the log, base 10, of the temporal probability for the specified time difference delta_time.

Returns:
The log, base 10, of the spatial probability
Parameters:
ctl The control handle for calculating the temporal probability
delta_time The time difference

References GRBP__probTemporalCalculate().

Referenced by GRBP_gammaListSeed(), and GRBP_windowTier2Update().


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