GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / dev > esu / rhel6-64
#include <EDS/ESS.h>
#include <EDS/EDS_fw.h>
#include <EDS/EBF_dir.h>
#include <EDS/EBF_gem.h>
#include <EDS/EBF_gemLocate.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
Classes | |
struct | _ESS_ctl |
Typedefs | |
typedef struct _ESS_ctl | ESS_ctl |
Enumerations | |
enum | Options { OPT_M_PKT = 1 << 0, OPT_M_SIZE = 1 << 1, OPT_M_READOUT = 1 << 2, OPT_M_DGN = 1 << 3, OPT_M_ERR = 1 << 4, OPT_M_COND = 1 << 5, OPT_M_FILTER = ( 1 << 6) - 1 } |
Enumeration of the bit masks indicating which selection criteria are valid. More... | |
enum | Readout { RO_M_ZS_SINGLE = 1 << 0, RO_M_NS_SINGLE = 1 << 1, RO_M_ZS_FOUR = 1 << 2, RO_M_NS_FOUR = 1 << 3, RO_M_SINGLE, RO_M_FOUR, RO_M_ZS, RO_M_NS, RO_M_ALL } |
Enumeration of the bit masks of which readout modes are allowed. More... | |
enum | Allow { ALLOW_M_1 = 1<<0, ALLOW_M_4 = 1<<1, ALLOW_M_N = 1<<2, ALLOW_M_Z = 1<<3, ALLOW_M_ZN = ALLOW_M_Z | ALLOW_M_N, ALLOW_M_14 = ALLOW_M_1 | ALLOW_M_4 } |
This enumeration is used only the get_readout parsing routine to make the code more readable. It has no use outside of that routine. More... | |
Functions | |
static unsigned int | get_range (const char *s, unsigned int opt, unsigned int *min, unsigned int *max) |
Parses the input string, extracting a range. | |
int | ESS_sizeof (void) |
Returns the size, in bytes, of the ESS control structure. | |
void | ESS_construct (ESS_ctl *ess) |
Constructs (initializes) the ESS control structure. | |
int | ESS_set_logic (ESS_ctl *ess, ESS_logic logic) |
Currently just sets the evaluation condition to the 'AND'. | |
int | ESS_parse_dgn (ESS_ctl *ess, const char *s) |
Parses the specified input string s, for a diagnostic selection. | |
int | ESS_parse_err (ESS_ctl *ess, const char *s) |
Parses the specified input string s, for an error selection. | |
int | ESS_parse_cond (ESS_ctl *ess, const char *s) |
Parses the string for the trigger condition specification. | |
int | ESS_parse_pkt (ESS_ctl *ess, const char *s) |
Parses the specified input string s, for a packet range. | |
int | ESS_parse_readout (ESS_ctl *ess, const char *s) |
Parses the input string, extracting a readout mask. | |
int | ESS_parse_size (ESS_ctl *ess, const char *s) |
Parses the specified input string s, for a packet range. | |
int | ESS_select (ESS_ctl *ess, const EBF_dir *dir, unsigned int npkts, unsigned int nbytes) |
Evaluates to the filter status. | |
Variables | |
const char | ESS_usage_cond [] |
String for defining a GEM Pattern Condition specifier. This is meant to be used when reporting the usage of this specifier. | |
const char | ESS_usage_range [] |
String for defining a range specifier. This is meant to be used when reporting the usage of this specifier. |
CVS $Id: ESS.c,v 1.5 2011/03/25 22:16:56 russell Exp $
enum Allow |
This enumeration is used only the get_readout parsing routine to make the code more readable. It has no use outside of that routine.
enum Options |
Enumeration of the bit masks indicating which selection criteria are valid.
enum Readout |
Enumeration of the bit masks of which readout modes are allowed.
Consider the 4 possible readout modes (single/four range x zero/non-zero suppressed). The selector works by forming a bit mask of the combinations that are permitted. For example if events with four range readout for either zero or non-zero suppressed data were desired, this bit mask would consist of RO_M_NS_FOUR or'd with RO_M_ZS_FOUR. To make the selection, the readout mode of any given event can be represented by the integers 0-3. Simply shift 1 to the left by this value and AND it with the permitted mask. If non-zero the event is selected.
void ESS_construct | ( | ESS_ctl * | ess | ) |
Constructs (initializes) the ESS control structure.
ess | The control structure to initialize |
References ESS_LOGIC_K_OR.
int ESS_parse_cond | ( | ESS_ctl * | ess, | |
const char * | s | |||
) |
Parses the string for the trigger condition specification.
ess | The control structure to fill | |
s | The string to parse. |
References OPT_M_COND.
int ESS_parse_dgn | ( | ESS_ctl * | ess, | |
const char * | s | |||
) |
Parses the specified input string s, for a diagnostic selection.
ess | The control structure to fill | |
s | The string to parse. If NULL, the diagnostic selection defaults to any contributor |
References OPT_M_DGN.
int ESS_parse_err | ( | ESS_ctl * | ess, | |
const char * | s | |||
) |
Parses the specified input string s, for an error selection.
ess | The control structure to fill | |
s | The string to parse. If NULL, the error selection defaults to any contributor |
References OPT_M_ERR.
int ESS_parse_pkt | ( | ESS_ctl * | ess, | |
const char * | s | |||
) |
Parses the specified input string s, for a packet range.
ess | The control structure to fill, see the documentation for get_range on the allowed syntax of s. | |
s | The string to parse |
References get_range(), and OPT_M_PKT.
int ESS_parse_readout | ( | ESS_ctl * | ess, | |
const char * | s | |||
) |
Parses the input string, extracting a readout mask.
ess | The control structure to fill, see the documentation for get_range on the allowed syntax of s. | |
s | The input string, consisting of up to 4 characters
|
References ALLOW_M_1, ALLOW_M_4, ALLOW_M_N, ALLOW_M_Z, OPT_M_READOUT, RO_M_ALL, RO_M_FOUR, RO_M_NS, RO_M_NS_FOUR, RO_M_NS_SINGLE, RO_M_SINGLE, RO_M_ZS, RO_M_ZS_FOUR, and RO_M_ZS_SINGLE.
int ESS_parse_size | ( | ESS_ctl * | ess, | |
const char * | s | |||
) |
Parses the specified input string s, for a packet range.
ess | The control structure to fill, see the documentation for get_range on the allowed syntax of s. | |
s | The string to parse |
References get_range(), and OPT_M_SIZE.
int ESS_select | ( | ESS_ctl * | ess, | |
const EBF_dir * | dir, | |||
unsigned int | npkts, | |||
unsigned int | nbytes | |||
) |
Evaluates to the filter status.
0,does | not pass | |
1,passes |
ess | The selection parameters | |
dir | The EBF directory structure | |
npkts | The number of packets in this event. This is relevant if and only if the OPT_M_PKT selection option is active. | |
nbytes | The number of bytes in this event. This is relevant if and only if the OPT_M_SIZE selection option is active. |
References _EBF_gem::condsumCno, _EBF_dirRedux::dgn_ids, EBF__gemLocate(), EBF_GEM_DEADCONDCNO_EXTRACT, _EBF_dirRedux::err_ids, ESS_LOGIC_K_OR, _EBF_dir::evt, _EBF_dirRedux::nosup_ids, OPT_M_COND, OPT_M_DGN, OPT_M_ERR, OPT_M_FILTER, OPT_M_PKT, OPT_M_READOUT, OPT_M_SIZE, _EBF_dir::redux, and _EBF_dirRedux::rng_ids.
int ESS_set_logic | ( | ESS_ctl * | ess, | |
ESS_logic | logic | |||
) |
Currently just sets the evaluation condition to the 'AND'.
ess | The control structure to fill | |
logic | The string to parse. Currently unused, should be specified as NULL |
int ESS_sizeof | ( | void | ) |
Returns the size, in bytes, of the ESS control structure.
static unsigned int get_range | ( | const char * | s, | |
unsigned int | opt, | |||
unsigned int * | min, | |||
unsigned int * | max | |||
) | [static] |
Parses the input string, extracting a range.
s | The input string. This can be a single number or a pair of numbers
| |
opt | Option used to indicate a minimum was specified | |
min | Returned as the minimum value | |
max | Returned as the maximum value |
Referenced by ESS_parse_pkt(), and ESS_parse_size().
const char ESS_usage_cond |
Initial value:
" GEM Trigger Condition Selection Pattern Definition\n" " --------------------------------------------------\n" " A GEM condition selection condition pattern is specified in three ways\n" " -T< specifier set> - Any matching condition passes\n" " -T:<specifier set> - The AND with GEM conditions must match the set\n" " -T=<specifier set> - The specifier set must match exactly\n" "\n" " A specifier set consists of the following codes:\n" " r: Region of Interest (throttled tracker trigger\n" " t: 3-in-a-row l: CAL lo h: CAL hi c: CNO\n" " p: Periodic s: Solicited e: External\n" "\n" " A list specifiers may be specified as required to be present or\n" " required to be absent by prefixing the list with either a '+' or\n" " a '-'. The first string defaults to being reguired to be present.\n" "\n" " Examples, assuming T is the option selector:\n" " -Tlt Select any event with either CAL LO or CAL HI present\n" " -Tl-h Select any event with either CAL LO present or CAL HI absent\n" " -T:lh Select any event with both CAL LO and CAL HI present\n" " -T=lh Select any event with only CAL LO and CAL HI present\n" " -T:r-t Select any event with a tracker throttle and no 3-in-a-row\n" " Given normal triggering modes, this should be an empty set.\n" " -T:r-lh Select any event with a tracker throttle and no CAL HI and\n" " no CAL LO\n" "\n" " Note that the '=' notation is just short hand and that specifying an\n" " absent condition is unnecessary. C=lh is equivalent to C:lh-rtcpse\n" "\n"
const char ESS_usage_range |
Initial value:
" Range Selection Definition\n" " --------------------------\n" " A range can be specified as\n" " 1 A single positive number, indicating an inclusive lower limit\n" " 2 A single negative number, indicating an inclusive upper limit\n" " 3 An = followed by a single number, indicates precisely that number\n" " 4 A pair of numbers separated by a ',' or ':', indicating an \n" " inclusive range\n" "\n" " Examples, assuming P is the option selector:\n" " -P2 Select events with >= 2 objects\n" " -P-2 Select events with <= 2 objects\n" " -P2:3 Select events with between 2 and 3 objects\n" " -P=3 Select events with precisely 3 objects\n" " -P3:3 Select events with precisely 3 objects\n"