GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBS / V0-1-2 > grbs_test / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

GRBS_epu_p.h File Reference

Gamma Ray Burst Analysis Code Private definitions for a GRBS EPU photon writer simulation. More...

#include <GRB/GRB_epu.h>
#include <PBI/BSWP.ih>
#include <PBI/Endianness.h>

Classes

struct  _GRBS_epuCtl
 The GRBS photon writer control. More...
struct  _GRBS_msgBdy
 The message carrying the information about a candidate photon from the server side (EPU) to the client side (SIU). More...
struct  _GRBS_msg
 Structure of the message between the server (EPU) and client (SIU). More...

Typedefs

typedef struct _GRBS_epuCtl GRBS_epuCtl
 Typedef for struct _GRBS_epuCtl.
typedef struct _GRBS_msgBdy GRBS_msgBdy
 Typedef for struct _GRBS_msgBdy.
typedef struct _GRBS_msg GRBS_msg
 Typedef for struct _GRBS_msg.

Functions

static __inline void GRBS__msgCompose (GRBS_msg *msg, unsigned long long int seq, unsigned long long int time, unsigned int pps, unsigned int trg, int energy, int dx, int dy, int dz)
 Composes a message (header + body) all values are written as big endian 32-bit values. When read on big-endian machines, no transformation needs to be done. On little-endian machines, the message is readable after doing a 4-byte swap on the entire message.
static __inline unsigned int GRBS__msgLength (const GRBS_msg *msg)
 Accessor to return the length of the message in 32-bit units.
static __inline unsigned long
long int 
GRBS__msgKey (const GRBS_msg *msg)
 Accessor to return the event sequence number.
static __inline unsigned long
long int 
GRBS__msgTime (const GRBS_msg *msg)
 Accessor to return the event time, in nanoseconds.
static __inline unsigned int GRBS__msgPps (const GRBS_msg *msg)
 Accessor to return the GEM PPS timestamps.
static __inline unsigned int GRBS__msgTrg (const GRBS_msg *msg)
 Accessor to return the event timestamp.
static __inline unsigned int GRBS__msgDx (const GRBS_msg *msg)
 Accessor to return the event Dx.
static __inline unsigned int GRBS__msgDy (const GRBS_msg *msg)
 Accessor to return the event Dy.
static __inline unsigned int GRBS__msgDz (const GRBS_msg *msg)
 Accessor to return the event dz.
static __inline unsigned int GRBS__msgEnergy (const GRBS_msg *msg)
 Accessor to return the event energy.
static __inline const GRBS_msgGRBS__msgNext (const GRBS_msg *msg)
 Returns a pointer to the message following the specified message.
static __inline const GRBS_msgGRBS__msgAdvance (const GRBS_msg *msg, int len32)
 Returns a pointer to the location of msg + len32.


Detailed Description

Gamma Ray Burst Analysis Code Private definitions for a GRBS EPU photon writer simulation.

Author:
Sergio Maldonado - smaldona@slac.stanford.edu

    CVS $Id: GRBS_epu_p.h,v 1.5 2011/03/28 20:28:09 russell Exp $

Function Documentation

static __inline const GRBS_msg * GRBS__msgAdvance ( const GRBS_msg msg,
int  len32 
) [static]

Returns a pointer to the location of msg + len32.

Returns:
A pointer to the location of msg + len32.
Parameters:
msg The target message
len32 The amount, in 32-bit units to advance msg by.
Note:
This routine can be used instead of GRBS__msgNext when the length of message has already been extracted or when advancing by multiple messages. Otherwise, GRBS__msgNext should be used.
Warning:
This routine only advances the pointer to the address following the target message. There is no guarantee that a message actually occupies that memory. That question can only be answered by some higher level protocol

References _GRBS_msg::hdr.

static __inline void GRBS__msgCompose ( GRBS_msg msg,
unsigned long long int  seq,
unsigned long long int  time,
unsigned int  pps,
unsigned int  trg,
int  energy,
int  dx,
int  dy,
int  dz 
) [static]

Composes a message (header + body) all values are written as big endian 32-bit values. When read on big-endian machines, no transformation needs to be done. On little-endian machines, the message is readable after doing a 4-byte swap on the entire message.

Parameters:
msg The message
seq The unique sequence number of this event. This number need not be dense, but must be montonically increasing from one packet to the next. This will be used as the sort index when merging packets
time The time, in nanoseconds of the event
energy The energy, in Mev, of the event
pps The GEM timestamp
trg The event timestamps
dx The unnormalized x direction cosine
dy The unnormalized y direction cosine
dz The unnormalized z direction cosine

References _GRBS_msg::bdy, _GRBS_msgBdy::dx, _GRBS_msgBdy::dy, _GRBS_msgBdy::dz, _GRBS_msgBdy::energy, _GRBS_msg::hdr, _GRBS_msgBdy::pps, _GRBS_msgBdy::time, and _GRBS_msgBdy::trg.

static __inline unsigned int GRBS__msgDx ( const GRBS_msg msg  )  [static]

Accessor to return the event Dx.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

References _GRBS_msg::bdy, and _GRBS_msgBdy::dx.

static __inline unsigned int GRBS__msgDy ( const GRBS_msg msg  )  [static]

Accessor to return the event Dy.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

References _GRBS_msg::bdy, and _GRBS_msgBdy::dy.

static __inline unsigned int GRBS__msgDz ( const GRBS_msg msg  )  [static]

Accessor to return the event dz.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

References _GRBS_msg::bdy, and _GRBS_msgBdy::dz.

static __inline unsigned int GRBS__msgEnergy ( const GRBS_msg msg  )  [static]

Accessor to return the event energy.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

References _GRBS_msg::bdy, and _GRBS_msgBdy::energy.

static __inline unsigned long long int GRBS__msgKey ( const GRBS_msg msg  )  [static]

Accessor to return the event sequence number.

Returns:
The event sequence number
Parameters:
msg The target message

References _GRBS_msg::hdr.

static __inline unsigned int GRBS__msgLength ( const GRBS_msg msg  )  [static]

Accessor to return the length of the message in 32-bit units.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

static __inline const GRBS_msg * GRBS__msgNext ( const GRBS_msg msg  )  [static]

Returns a pointer to the message following the specified message.

Returns:
A pointer to the message following the specified message
Parameters:
msg The target message
Warning:
This routine only advances the pointer to the address following the target message. There is no guarantee that a message actually occupies that memory. That question can only be answered by some higher level protocol

References _GRBS_msg::hdr.

static __inline unsigned int GRBS__msgPps ( const GRBS_msg msg  )  [static]

Accessor to return the GEM PPS timestamps.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

References _GRBS_msg::bdy, and _GRBS_msgBdy::pps.

static __inline unsigned long long int GRBS__msgTime ( const GRBS_msg msg  )  [static]

Accessor to return the event time, in nanoseconds.

Returns:
The event time, in nanoseconds
Parameters:
msg The target message

static __inline unsigned int GRBS__msgTrg ( const GRBS_msg msg  )  [static]

Accessor to return the event timestamp.

Returns:
The length of the message in 32-bit units
Parameters:
msg The target message

References _GRBS_msg::bdy, and _GRBS_msgBdy::trg.


Generated on Fri Sep 30 18:42:07 2011 by  doxygen 1.5.8