GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > GRBP / V1-0-1

Constituent: grbpsiu     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

GRBP_client.c File Reference

The client side (SIU) of the GRB algorithm. More...

#include "GRBP/GRBP_client.h"
#include "GRBP_msgdef.h"
#include "GRBP_cache.h"
#include "GRBP_probability.h"
#include "GRBP_window.h"
#include "GRBP_message.h"
#include "GRBP_grb.h"
#include "GRBP_windowList.h"
#include "GRBP_windowState.h"
#include "GRBP_gbmMsg.h"
#include "GRBP_gbmRepoint.h"
#include "round.h"
#include "tmr.h"
#include "GRBP_DB/GRBP_DB_clientSchema.h"
#include "GRB/GRB_siu.h"
#include "GRB/GRB_gbmMsg.h"
#include "ATT/ATT.h"
#include "MSG/MSG_macdefs.h"
#include <string.h>
#include <stdio.h>

Include dependency graph for GRBP_client.c:


Data Structures

struct  _GRBP_clientStats
 Statistics gathered. More...
struct  _GRBP_clientSequence
 Summarizes the current message sequence activity. More...
struct  _GRBP_client
 The client for the SIU side of the GRB algorithm. More...

Typedefs

typedef enum _GRBP_clientState GRBP_clientState
 Typedef for enum _GRBP_clientState.
typedef _GRBP_clientStats GRBP_clientStats
 Typedef for struct _GRBP_clientStats.
typedef enum _GRBP_clientSequence_k GRBP_clientSequence_k
typedef enum _GRBP_clientSequence_m GRBP_clientSequence_m
 Typedef for enum _GRBP_clientSequence_m.
typedef _GRBP_clientSequence GRBP_clientSequence
 Typedef for enum _GRBP_clientSequence.
typedef _GRBP_client GRBP_client
 Typedef for struct _GRBP_client.

Enumerations

enum  _GRBP_clientState {
  GRBP_CLIENTSTATE_K_INACTIVE = -1,
  GRBP_CLIENTSTATE_K_GRB_LAT = 0,
  GRBP_CLIENTSTATE_K_GRB_GBM = 1
}
 Captures the processing state. This is applies only to the type of GRBP window being processed, not the type of message sequence that may be in progress
  1. No GRB active, just entering photons looking for one
  2. LAT GRB active, a LAT triggered GRB is active
  3. GBM GRB active, a GBM triggered GRB is active.
More...
enum  _GRBP_clientSequence_k {
  GRBP_CLIENTSEQUENCE_K_LAT = 0,
  GRBP_CLIENTSEQUENCE_K_GBM = 1
}
 Enumerates the types of message sequences
  1. LAT GRB message sequence
  2. GBM GRB message sequence.
More...
enum  _GRBP_clientSequence_m {
  GRBP_CLIENTSEQUENCE_M_LAT = 1 << GRBP_CLIENTSEQUENCE_K_LAT,
  GRBP_CLIENTSEQUENCE_M_GBM = 1 << GRBP_CLIENTSEQUENCE_K_GBM
}
 Enumerates the types of message sequences as bit masks
  1. LAT GRB message sequence
  2. GBM GRB message sequence.
More...

Functions

void GRBP_clientConstruct (GRBP_client *client, const GRBP_DB_clientSchema *cfg)
 Constructs a GRBP client-side (SIU) context using the parameters specified in the configuration, cfg. It is assumed that the user has called GRBP_clientSizeof using the same configuration structure to determine the number of bytes needed to support the specified configuration and that the user has allocated those bytes in the memory pointed to by client.
void GRBP_clientProcess (GRBP_client *client, unsigned long long int id, unsigned long long int time, unsigned int energy, int dx, int dy, int dz)
 Driver function used to detect a GRB.
void GRBP_clientMsgProcess (GRBP_client *client, const GRBP_msg *msg)
 Driver function used to detect a GRB.
static __inline void statsReset (GRBP_clientStats *stats)
 Resets the client statistics block. This routine is generally cleared after a GRB closeout has been issued.
static __inline void latReset (GRBP_client *client)
 Resets the LAT portion of the client context. This routine is generally called after a LAT GRB closeout has been issued, thus preparing it for a new round of detection.
static __inline void reset (GRBP_client *client)
 Resets the client context. This routine is generally called after a GRB closeout has been issued, thus preparing it for a new round of detection.
static void start (GRBP_client *client)
 Called when GRB processing is started.
static void stop (GRBP_client *client)
 Called when GRB processing is stopped.
static __inline unsigned int xform (ATT_Control *att, unsigned long long int time, int dx, int dy, int dz, double q[4], double dsky[3])
 Does the LAT relative to absolute coordinate transformation.
static __inline void grbDeclare (GRBP_client *client, GRBP_window *window, double current_time)
 Checks, if a GRB suspected message should be declared and if, so, delivers one.
static __inline int confirmCheck (GRBP_client *client)
 Checks, if a GRB confirmation message should be declared and if, so, delivers one.
static __inline int updateCheck (GRBP_client *client, int added, double current_time)
 Checks if an update or closeout message needs to be issued. If so, one is issued.
static void gbmRepointHandler (GRBP_client *client, GRB_gbmRptMsg *msg)
 Function to handle an incoming GBM repoint message.
static void gbmInterruptHandler (GRBP_client *client)
 Function to handle an incoming GBM interrupt signal.
static void gbmCalculateHandler (GRBP_client *client, GRB_gbmCalcMsg *msg)
 Function to handle an incoming GBM interrupt signal.
static int gbmCloseoutHandler (GRBP_client *client, GRB_gbmCloseMsg *msg)
 Function to handle an incoming GBM closeout message.
static __inline void sequenceReset (GRBP_clientSequence *sequence)
 Resets the sequence state information.
static __inline int sequenceCloseout (GRBP_clientSequence *sequence, unsigned int which)
 Updates the sequence information for a closeout occuring on the indicate message sequence, which.
int GRBP_clientSizeof (const GRBP_DB_clientSchema *cfg)
 Computes the number of bytes needed to support the specified configuration, cfg.
const GRB_siuServices * GRBP_clientServicesGet (GRBP_client *client, GRBP_DB_clientSchema *schema, const GRB_latMsgServices *msgServices)
 Constructs the client context and returns the services table.

Detailed Description

The client side (SIU) of the GRB algorithm.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: GRBP_client.c,v 1.9 2008/09/01 22:05:02 russell Exp $

Enumeration Type Documentation

enum _GRBP_clientSequence_k
 

Enumerates the types of message sequences

  1. LAT GRB message sequence
  2. GBM GRB message sequence.

Enumerator:
GRBP_CLIENTSEQUENCE_K_LAT  LAT message sequence
GRBP_CLIENTSEQUENCE_K_GBM  GBM message sequence

enum _GRBP_clientSequence_m
 

Enumerates the types of message sequences as bit masks

  1. LAT GRB message sequence
  2. GBM GRB message sequence.

Enumerator:
GRBP_CLIENTSEQUENCE_M_LAT  LAT message sequence
GRBP_CLIENTSEQUENCE_M_GBM  GBM message sequence

enum _GRBP_clientState
 

Captures the processing state. This is applies only to the type of GRBP window being processed, not the type of message sequence that may be in progress

  1. No GRB active, just entering photons looking for one
  2. LAT GRB active, a LAT triggered GRB is active
  3. GBM GRB active, a GBM triggered GRB is active.

Enumerator:
GRBP_CLIENTSTATE_K_INACTIVE  No GRB active
GRBP_CLIENTSTATE_K_GRB_LAT  LAT GRB active
GRBP_CLIENTSTATE_K_GRB_GBM  GBM GRB active


Function Documentation

static __inline int confirmCheck GRBP_client client  )  [static]
 

Checks, if a GRB confirmation message should be declared and if, so, delivers one.

Return values:
0 No GRB confirmation message issued
1 GRB confirmation message issued

static void gbmCalculateHandler GRBP_client client,
GRB_gbmCalcMsg *  msg
[static]
 

Function to handle an incoming GBM interrupt signal.

Parameters:
client The GRBP client context
msg The GBM calculate message

static int gbmCloseoutHandler GRBP_client client,
GRB_gbmCloseMsg *  msg
[static]
 

Function to handle an incoming GBM closeout message.

Return values:
==0,GRBP is not requesting a FINISH message to be issued
!=0,GRBP is requesting a FINISH message to be issued
Parameters:
client The GRBP client context
msg The GBM closeout message

static void gbmInterruptHandler GRBP_client client  )  [static]
 

Function to handle an incoming GBM interrupt signal.

Parameters:
client The GRBP client context

static void gbmRepointHandler GRBP_client client,
GRB_gbmRptMsg *  msg
[static]
 

Function to handle an incoming GBM repoint message.

Parameters:
client The GRBP client context
msg The GBM repoint message

static __inline void grbDeclare GRBP_client client,
GRBP_window window,
double  current_time
[static]
 

Checks, if a GRB suspected message should be declared and if, so, delivers one.

printf ("Start:Current time: %f:%f\n", start_time, current_time);

void GRBP_clientConstruct GRBP_client client,
const GRBP_DB_clientSchema *  cfg
 

Constructs a GRBP client-side (SIU) context using the parameters specified in the configuration, cfg. It is assumed that the user has called GRBP_clientSizeof using the same configuration structure to determine the number of bytes needed to support the specified configuration and that the user has allocated those bytes in the memory pointed to by client.

Parameters:
client The client-side context handle to fill
cfg The configuration

void GRBP_clientMsgProcess GRBP_client client,
const GRBP_msg msg
 

Driver function used to detect a GRB.

Parameters:
client The GRBP client side context
msg The message containing the information about the new photon

void GRBP_clientProcess GRBP_client client,
unsigned long long int  id,
unsigned long long int  time,
unsigned int  energy,
int  dx,
int  dy,
int  dz
 

Driver function used to detect a GRB.

Parameters:
client The GRBP client side context
id The event sequence number of the photon to be added
time The time of the photon to be added
energy The energy, in Mev, of the photon to be added
dx The unnormalized x direction cosine
dy The unnormalized y direction cosine
dz The unnormalized z direction cosine
This routine is called each time a new photon is added. The parameters are those used by the GRB algorithm to define a photon, basically its time of arrival, energy and direction. An unique, but arbitrary, integer, is used to identify the photon.

const GRB_siuServices * GRBP_clientServicesGet GRBP_client client,
GRBP_DB_clientSchema *  schema,
const GRB_latMsgServices *  msgServices
 

Constructs the client context and returns the services table.

Parameters:
client The client-side context to construct
schema The configuration block
msgServices The routines to call to deliver an alert message

int GRBP_clientSizeof const GRBP_DB_clientSchema *  cfg  ) 
 

Computes the number of bytes needed to support the specified configuration, cfg.

Returns:
The number of bytes needed to support the specified configuration
Parameters:
cfg The configuration

static __inline void latReset GRBP_client client  )  [static]
 

Resets the LAT portion of the client context. This routine is generally called after a LAT GRB closeout has been issued, thus preparing it for a new round of detection.

Parameters:
client The client context to clear

static __inline void reset GRBP_client client  )  [static]
 

Resets the client context. This routine is generally called after a GRB closeout has been issued, thus preparing it for a new round of detection.

Parameters:
client The client context to clear

static __inline int sequenceCloseout GRBP_clientSequence sequence,
unsigned int  which
[static]
 

Updates the sequence information for a closeout occuring on the indicate message sequence, which.

Returns:
A flag indicating whether the receiver of the closeout message should inhibit the sending of a FINISH message
Parameters:
sequence The sequence structure to update
which The sequence, in the form of a right justified bit mask to closeout.

static __inline void sequenceReset GRBP_clientSequence sequence  )  [static]
 

Resets the sequence state information.

Parameters:
sequence The sequence structure to reset

static void start GRBP_client client  )  [static]
 

Called when GRB processing is started.

Parameters:
client The client to start

static __inline void statsReset GRBP_clientStats stats  )  [static]
 

Resets the client statistics block. This routine is generally cleared after a GRB closeout has been issued.

Parameters:
stats The statistics block to reset

static void stop GRBP_client client  )  [static]
 

Called when GRB processing is stopped.

Parameters:
client The client to stop
If there is a LAT sequence in progress, it is closed out in the usual fashion. Any pending GBM repoint request is also sent.

static __inline int updateCheck GRBP_client client,
int  added,
double  current_time
[static]
 

Checks if an update or closeout message needs to be issued. If so, one is issued.

printf ("updateCheck time: %f\n", current_time);

static __inline unsigned int xform ATT_Control *  att,
unsigned long long int  time,
int  dx,
int  dy,
int  dz,
double  q[4],
double  dsky[3]
[static]
 

Does the LAT relative to absolute coordinate transformation.

Return values:
Message code
Parameters:
att The attitude history control handle, i.e. the source of the transformations
time The WCT time of the event
dx The LAT relative unnormalized X direction cosine
dy The LAT relative unnormalized Y direction cosine
dz The LAT relative unnormalized Y direction cosine
q The quarternion used in the transformation
dsky Returned as the normalized sky coordination direction cosines


Generated on Tue Sep 2 01:27:02 2008 by  doxygen 1.4.4