GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EMP / V1-4-1 > ascprint / sun-gcc
Classes | |
struct | _EMP_hdrTimetone |
Defines the most general version of the timetone information. More... | |
struct | _EMP_hdrTimetones |
Captures the information needed to convert a GEM event clock register value into an absolute time. More... | |
struct | _EMP_hdrEvtSeq |
Hide the access to the long long to avoid alignment issues. More... | |
struct | _EMP_hdrEvt |
Captures the information needed to uniquely identify this event by sequence and time. More... | |
struct | _EMP_hdrEvtSpan |
The defining information about the first and last event that went into the sample. More... | |
struct | _EMP_hdr |
EMP standard header for event-based statistics. More... | |
Typedefs | |
typedef unsigned int(* | EMP_timetones_get_rtn )(unsigned int cur_pps, unsigned int *cur_secs, unsigned int *cur_flags, unsigned int *prv_secs, unsigned int *prv_flags, unsigned int *prv_pps) |
Function template to get the timetone information from an event. | |
typedef struct _EMP_hdrTimetone | EMP_hdrTimetone |
Typedef for struct _EMP_hdrTimetone. | |
typedef struct _EMP_hdrTimetones | EMP_hdrTimetones |
Typedef for struct _EMP_hdrTimetones. | |
typedef struct _EMP_hdrEvtSeq | EMP_hdrEvtSeq |
Typedef for struct _EMP_hdrEvtSeq. | |
typedef struct _EMP_hdrEvt | EMP_hdrEvt |
Typedef for _EMP_hdrEvt. | |
typedef struct _EMP_hdrEvtSpan | EMP_hdrEvtSpan |
Typedef for struct _EMP_hdrEvtSpan. | |
typedef struct _EMP_hdr | EMP_hdr |
Typedef for struct _EMP_hdr. | |
Functions | |
void | EMP_timetones_get_set (EMP_timetones_get_rtn rtn) |
Routine to set the routine to get the timetone information. | |
static __inline void | EMP__hdrEvtSeqSet (EMP_hdrEvtSeq *dst, unsigned long long int src) |
Hide access to the long long sequence number to avoid big/little endian and alignment issues. | |
static __inline unsigned long long int | EMP__hdrEvtSeqGet (const EMP_hdrEvtSeq *seq) |
Hide access to the long long sequence number to avoid big/little endian and alignment issues. |
CVS $Id: EMP_hdrdefs.h,v 1.2 2011/03/26 20:07:42 russell Exp $
Typedef for struct _EMP_hdr.
beg_evt_sequence = hdr->evt.beg.seq; end_evt_sequence = hdr->evt.end.seq; beg_seconds = hdr->evt.beg.timetones.cur.secs; end_seconds = hdr->evt.end.timetones.cur.secs; elasped_seconds = beg_seconds - end_seconds; events_seen = end_evt_sequence - beg_evt_sequence; events_accumulated = hdr->nevts;
unsigned long long int get_event_time (const EMP_hdrEvt *evt) { unsigned int curGemStrobe = evt->timetones.cur.gemStrobe & TICKS; unsigned int prvGemStrobe = evt->timetones.cur.gemStrobe & TICKS; unsigned int deltaTicks = curGemStrobe - prvGemStrobe; unsigned int curGemSecs = evt->timetones.cur.secs; unsigned int prvGemSecs = evt->timetones.prv.secs; unsigned int deltaNsecs = ONE_BILLION * (curGemSecs - prvGemSecs); unsigned int curGemClock = evt->gemClock & TICKS; unsigned int elapsedTicks = curGemClock - curGemStrobe; unsigned long long int time; // One needs to exercise caution to make sure the arithmetic // is done properly. In particular the mulitplication, // elapsedTicks * deltaNsecs, should yield an unsigned long long int // while the division by deltaTicks should be considered a 64/32 bit // division. time = ONE_BILLION * secs + (elapsedTicks * deltaNsecs) / deltaTicks; return time;
beg_time = get_event_time (&hdr->span.beg); end_time = get_event_time (&hdr->span.end); elapsed_time = end_time - beg_time;
Typedef for _EMP_hdrEvt.
Typedef for struct _EMP_hdrTimetone.
typedef unsigned int(* EMP_timetones_get_rtn)(unsigned int cur_pps, unsigned int *cur_secs, unsigned int *cur_flags, unsigned int *prv_secs, unsigned int *prv_flags, unsigned int *prv_pps) |
Function template to get the timetone information from an event.
cur_pps | The value of the GEM's 1-PPS register to use as a key in locating the timetone messages | |
cur_secs | Filled in with the time since the Spectrum-Astro epoch corresponding the current timetone message | |
cur_flags | Filled in with status flags/values (see THS) corresponding the current timetone message | |
prv_secs | Filled in with the time since the Spectrum-Astro epoch corresponding the previous timetone message | |
prv_flags | Filled in with status flags/values (see THS) corresponding the previous timetone message | |
prv_pps | Filled in with the value of GEM's 1-PPS register corresponding the previous timetone message |
static __inline unsigned long long int EMP__hdrEvtSeqGet | ( | const EMP_hdrEvtSeq * | seq | ) | [static] |
Hide access to the long long sequence number to avoid big/little endian and alignment issues.
seq | Address of the event sequence number to fetch |
References _EMP_hdrEvtSeq::hi, and _EMP_hdrEvtSeq::lo.
Referenced by printHdrEvt().
static __inline void EMP__hdrEvtSeqSet | ( | EMP_hdrEvtSeq * | dst, | |
unsigned long long int | src | |||
) | [static] |
Hide access to the long long sequence number to avoid big/little endian and alignment issues.
dst | The destintation address | |
src | The source event sequence number |
References _EMP_hdrEvtSeq::hi, and _EMP_hdrEvtSeq::lo.
void EMP_timetones_get_set | ( | EMP_timetones_get_rtn | rtn | ) |
Routine to set the routine to get the timetone information.
rtn | The timetone get routine |