\hypertarget{ESS_8c}{
\section{ESS.c File Reference}
\label{ESS_8c}\index{ESS.c@{ESS.c}}
}
Implementation of the Event Simple Selection utility.  


{\tt \#include $<$EDS/ESS.h$>$}\par
{\tt \#include $<$EDS/EDS\_\-fw.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-dir.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-gem.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-gemLocate.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \textbf{\_\-ESS\_\-ctl}
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{ESS_8c_4fabf3348f0c5ab025aaa0710c46c2d5}{
typedef struct \_\-ESS\_\-ctl \textbf{ESS\_\-ctl}}
\label{ESS_8c_4fabf3348f0c5ab025aaa0710c46c2d5}

\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd99}{Options} \{ \par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd99dd64b64061ed5ef0f3aab874ec400590}{OPT\_\-M\_\-PKT} =  1 $<$$<$ 0, 
\par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd99e4c336bf4f73339cc52e3acf0ae21ffd}{OPT\_\-M\_\-SIZE} =  1 $<$$<$ 1, 
\par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd995ba42624d4f5ace5ffdc7045a4bb0fd7}{OPT\_\-M\_\-READOUT} =  1 $<$$<$ 2, 
\par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd9933fc848979aec3b1626ba368c4ee0c10}{OPT\_\-M\_\-DGN} =  1 $<$$<$ 3, 
\par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd99f4d99ad71a9b13226fe181ff1230e6ab}{OPT\_\-M\_\-ERR} =  1 $<$$<$ 4, 
\par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd992d28a0abe037345b1d906df60be503fb}{OPT\_\-M\_\-COND} =  1 $<$$<$ 5, 
\par
\hyperlink{ESS_8c_df7c3ac791f996a56160a12f379cbd99ac4a33fd9ff30efff0e0230e1a3ffa83}{OPT\_\-M\_\-FILTER} = ( 1 $<$$<$ 6) - 1
 \}
\begin{CompactList}\small\item\em Enumeration of the bit masks indicating which selection criteria are valid. \item\end{CompactList}\item 
enum \hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f}{Readout} \{ \par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094fa9667f5731f8f9332715c6f8f3fc9cc6}{RO\_\-M\_\-ZS\_\-SINGLE} =  1 $<$$<$ 0, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f8d4ce90fb8f4934e0590e8630e73779d}{RO\_\-M\_\-NS\_\-SINGLE} =  1 $<$$<$ 1, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f3833c5d922a38650bc657fd352f8a8e6}{RO\_\-M\_\-ZS\_\-FOUR} =  1 $<$$<$ 2, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f81aa2b5fd307c9da81c8f0d0fa2e7c24}{RO\_\-M\_\-NS\_\-FOUR} =  1 $<$$<$ 3, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f4dd664d52564f44cedd22201363b8671}{RO\_\-M\_\-SINGLE}, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f5614e7779ec420f4e908ef32101247e3}{RO\_\-M\_\-FOUR}, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f8da441a6a4905f57cfd1080efc4d0843}{RO\_\-M\_\-ZS}, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094f46eb43d0ef53e62b5fabdb632f1d5ea1}{RO\_\-M\_\-NS}, 
\par
\hyperlink{ESS_8c_046980c340b420fcbe3d64869215094fccfefaf50b9b17fa7aaab93cdd05d543}{RO\_\-M\_\-ALL}
 \}
\begin{CompactList}\small\item\em Enumeration of the bit masks of which readout modes are allowed. \item\end{CompactList}\item 
enum \hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023fe}{Allow} \{ \par
\hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023fe08b55c520c5f107ad4f927ebe321b943}{ALLOW\_\-M\_\-1} =  1$<$$<$0, 
\par
\hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023fe3815d99db9efafb9738911bea9ba0017}{ALLOW\_\-M\_\-4} =  1$<$$<$1, 
\par
\hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023fe7e87aa6fc5ca43583c1ecd1e36a8d89d}{ALLOW\_\-M\_\-N} =  1$<$$<$2, 
\par
\hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023fe576c38e0806792cc8b450050fc353c3a}{ALLOW\_\-M\_\-Z} =  1$<$$<$3, 
\par
\hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023fe3af290fdb0b3c15179ffd1e7d46ceafb}{ALLOW\_\-M\_\-ZN} =  ALLOW\_\-M\_\-Z $|$ ALLOW\_\-M\_\-N, 
\par
\hyperlink{ESS_8c_a19eb41a4a84b7263d060965658023feb5cb0deca6ef968625c85ba33f88b6c2}{ALLOW\_\-M\_\-14} =  ALLOW\_\-M\_\-1 $|$ ALLOW\_\-M\_\-4
 \}
\begin{CompactList}\small\item\em This enumeration is used only the get\_\-readout parsing routine to make the code more readable. It has no use outside of that routine. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned int \hyperlink{ESS_8c_8c5e2c14012df8438e7b0fdfbf5073ab}{get\_\-range} (const char $\ast$s, unsigned int opt, unsigned int $\ast$min, unsigned int $\ast$max)
\begin{CompactList}\small\item\em Parses the input string, extracting a range. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_45aaa5af9ddf1f0fcd221583de37cfc0}{ESS\_\-sizeof} (void)
\begin{CompactList}\small\item\em Returns the size, in bytes, of the ESS control structure. \item\end{CompactList}\item 
void \hyperlink{ESS_8c_3e761f1b028458707bccbb7b9c2f5b70}{ESS\_\-construct} (ESS\_\-ctl $\ast$ess)
\begin{CompactList}\small\item\em Constructs (initializes) the ESS control structure. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_99807c540562da91a712845d6385ea1c}{ESS\_\-set\_\-logic} (ESS\_\-ctl $\ast$ess, \hyperlink{ESS_8h_98cba3a8e277c49afdfbb50f08863d4c}{ESS\_\-logic} logic)
\begin{CompactList}\small\item\em Currently just sets the evaluation condition to the 'AND'. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_95d8999ccfebf7f0383099e8af54a4ef}{ESS\_\-parse\_\-dgn} (ESS\_\-ctl $\ast$ess, const char $\ast$s)
\begin{CompactList}\small\item\em Parses the specified input string {\em s\/}, for a diagnostic selection. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_5ae010fe2a7534677d7dd121fe55e3f8}{ESS\_\-parse\_\-err} (ESS\_\-ctl $\ast$ess, const char $\ast$s)
\begin{CompactList}\small\item\em Parses the specified input string {\em s\/}, for an error selection. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_f62f179dda914f9cfc78fd0ed8cfbb75}{ESS\_\-parse\_\-cond} (ESS\_\-ctl $\ast$ess, const char $\ast$s)
\begin{CompactList}\small\item\em Parses the string for the trigger condition specification. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_ee6b135eb35c35da881985e87397f68c}{ESS\_\-parse\_\-pkt} (ESS\_\-ctl $\ast$ess, const char $\ast$s)
\begin{CompactList}\small\item\em Parses the specified input string {\em s\/}, for a packet range. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_65d01f149fdabd9c967f029ee46eb2be}{ESS\_\-parse\_\-readout} (ESS\_\-ctl $\ast$ess, const char $\ast$s)
\begin{CompactList}\small\item\em Parses the input string, extracting a readout mask. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_c8e78487644b5935adc4ffacaa37da04}{ESS\_\-parse\_\-size} (ESS\_\-ctl $\ast$ess, const char $\ast$s)
\begin{CompactList}\small\item\em Parses the specified input string {\em s\/}, for a packet range. \item\end{CompactList}\item 
int \hyperlink{ESS_8c_1e5fb6003ab48d1a5bc7e70b3712711d}{ESS\_\-select} (ESS\_\-ctl $\ast$ess, const \hyperlink{struct__EBF__dir}{EBF\_\-dir} $\ast$dir, unsigned int npkts, unsigned int nbytes)
\begin{CompactList}\small\item\em Evaluates to the filter status. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
const char \hyperlink{ESS_8c_c328856ff8e0ec81cac258ccdeaf010e}{ESS\_\-usage\_\-cond} \mbox{[}$\,$\mbox{]}
\begin{CompactList}\small\item\em String for defining a GEM Pattern Condition specifier. This is meant to be used when reporting the usage of this specifier. \item\end{CompactList}\item 
const char \hyperlink{ESS_8c_942885ca8cb35f0b313c4420b1344ad8}{ESS\_\-usage\_\-range} \mbox{[}$\,$\mbox{]}
\begin{CompactList}\small\item\em String for defining a range specifier. This is meant to be used when reporting the usage of this specifier. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implementation of the Event Simple Selection utility. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

   CVS $Id: ESS.c,v 1.5 2011/03/25 22:16:56 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Enumeration Type Documentation}
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023fe}{
\index{ESS.c@{ESS.c}!Allow@{Allow}}
\index{Allow@{Allow}!ESS.c@{ESS.c}}
\subsubsection[{Allow}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Allow}}}
\label{ESS_8c_a19eb41a4a84b7263d060965658023fe}


This enumeration is used only the get\_\-readout parsing routine to make the code more readable. It has no use outside of that routine. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{ALLOW\_\-M\_\-1@{ALLOW\_\-M\_\-1}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!ALLOW\_\-M\_\-1@{ALLOW\_\-M\_\-1}}\item[{\em 
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023fe08b55c520c5f107ad4f927ebe321b943}{
ALLOW\_\-M\_\-1}
\label{ESS_8c_a19eb41a4a84b7263d060965658023fe08b55c520c5f107ad4f927ebe321b943}
}]Allow single range readout events \index{ALLOW\_\-M\_\-4@{ALLOW\_\-M\_\-4}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!ALLOW\_\-M\_\-4@{ALLOW\_\-M\_\-4}}\item[{\em 
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023fe3815d99db9efafb9738911bea9ba0017}{
ALLOW\_\-M\_\-4}
\label{ESS_8c_a19eb41a4a84b7263d060965658023fe3815d99db9efafb9738911bea9ba0017}
}]Allow four range readout events \index{ALLOW\_\-M\_\-N@{ALLOW\_\-M\_\-N}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!ALLOW\_\-M\_\-N@{ALLOW\_\-M\_\-N}}\item[{\em 
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023fe7e87aa6fc5ca43583c1ecd1e36a8d89d}{
ALLOW\_\-M\_\-N}
\label{ESS_8c_a19eb41a4a84b7263d060965658023fe7e87aa6fc5ca43583c1ecd1e36a8d89d}
}]Allow nonzero-suppressed events \index{ALLOW\_\-M\_\-Z@{ALLOW\_\-M\_\-Z}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!ALLOW\_\-M\_\-Z@{ALLOW\_\-M\_\-Z}}\item[{\em 
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023fe576c38e0806792cc8b450050fc353c3a}{
ALLOW\_\-M\_\-Z}
\label{ESS_8c_a19eb41a4a84b7263d060965658023fe576c38e0806792cc8b450050fc353c3a}
}]Allow zero-suppressed events \index{ALLOW\_\-M\_\-ZN@{ALLOW\_\-M\_\-ZN}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!ALLOW\_\-M\_\-ZN@{ALLOW\_\-M\_\-ZN}}\item[{\em 
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023fe3af290fdb0b3c15179ffd1e7d46ceafb}{
ALLOW\_\-M\_\-ZN}
\label{ESS_8c_a19eb41a4a84b7263d060965658023fe3af290fdb0b3c15179ffd1e7d46ceafb}
}]Allow both zero and non-zero suppressed events \index{ALLOW\_\-M\_\-14@{ALLOW\_\-M\_\-14}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!ALLOW\_\-M\_\-14@{ALLOW\_\-M\_\-14}}\item[{\em 
\hypertarget{ESS_8c_a19eb41a4a84b7263d060965658023feb5cb0deca6ef968625c85ba33f88b6c2}{
ALLOW\_\-M\_\-14}
\label{ESS_8c_a19eb41a4a84b7263d060965658023feb5cb0deca6ef968625c85ba33f88b6c2}
}]Allow both single and four range readout events \end{description}
\end{Desc}

\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd99}{
\index{ESS.c@{ESS.c}!Options@{Options}}
\index{Options@{Options}!ESS.c@{ESS.c}}
\subsubsection[{Options}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Options}}}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd99}


Enumeration of the bit masks indicating which selection criteria are valid. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{OPT\_\-M\_\-PKT@{OPT\_\-M\_\-PKT}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-PKT@{OPT\_\-M\_\-PKT}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd99dd64b64061ed5ef0f3aab874ec400590}{
OPT\_\-M\_\-PKT}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd99dd64b64061ed5ef0f3aab874ec400590}
}]Filter on packet count range \index{OPT\_\-M\_\-SIZE@{OPT\_\-M\_\-SIZE}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-SIZE@{OPT\_\-M\_\-SIZE}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd99e4c336bf4f73339cc52e3acf0ae21ffd}{
OPT\_\-M\_\-SIZE}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd99e4c336bf4f73339cc52e3acf0ae21ffd}
}]Filter on minimum event size \index{OPT\_\-M\_\-READOUT@{OPT\_\-M\_\-READOUT}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-READOUT@{OPT\_\-M\_\-READOUT}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd995ba42624d4f5ace5ffdc7045a4bb0fd7}{
OPT\_\-M\_\-READOUT}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd995ba42624d4f5ace5ffdc7045a4bb0fd7}
}]Filter on readout mode \index{OPT\_\-M\_\-DGN@{OPT\_\-M\_\-DGN}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-DGN@{OPT\_\-M\_\-DGN}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd9933fc848979aec3b1626ba368c4ee0c10}{
OPT\_\-M\_\-DGN}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd9933fc848979aec3b1626ba368c4ee0c10}
}]Filter on events with diagnostic block \index{OPT\_\-M\_\-ERR@{OPT\_\-M\_\-ERR}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-ERR@{OPT\_\-M\_\-ERR}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd99f4d99ad71a9b13226fe181ff1230e6ab}{
OPT\_\-M\_\-ERR}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd99f4d99ad71a9b13226fe181ff1230e6ab}
}]Filter on events with error block \index{OPT\_\-M\_\-COND@{OPT\_\-M\_\-COND}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-COND@{OPT\_\-M\_\-COND}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd992d28a0abe037345b1d906df60be503fb}{
OPT\_\-M\_\-COND}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd992d28a0abe037345b1d906df60be503fb}
}]Filter on trigger conditions \index{OPT\_\-M\_\-FILTER@{OPT\_\-M\_\-FILTER}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!OPT\_\-M\_\-FILTER@{OPT\_\-M\_\-FILTER}}\item[{\em 
\hypertarget{ESS_8c_df7c3ac791f996a56160a12f379cbd99ac4a33fd9ff30efff0e0230e1a3ffa83}{
OPT\_\-M\_\-FILTER}
\label{ESS_8c_df7c3ac791f996a56160a12f379cbd99ac4a33fd9ff30efff0e0230e1a3ffa83}
}]All filter bits \end{description}
\end{Desc}

\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f}{
\index{ESS.c@{ESS.c}!Readout@{Readout}}
\index{Readout@{Readout}!ESS.c@{ESS.c}}
\subsubsection[{Readout}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf Readout}}}
\label{ESS_8c_046980c340b420fcbe3d64869215094f}


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. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{RO\_\-M\_\-ZS\_\-SINGLE@{RO\_\-M\_\-ZS\_\-SINGLE}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-ZS\_\-SINGLE@{RO\_\-M\_\-ZS\_\-SINGLE}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094fa9667f5731f8f9332715c6f8f3fc9cc6}{
RO\_\-M\_\-ZS\_\-SINGLE}
\label{ESS_8c_046980c340b420fcbe3d64869215094fa9667f5731f8f9332715c6f8f3fc9cc6}
}]Zero-suppress, single range readout \index{RO\_\-M\_\-NS\_\-SINGLE@{RO\_\-M\_\-NS\_\-SINGLE}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-NS\_\-SINGLE@{RO\_\-M\_\-NS\_\-SINGLE}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f8d4ce90fb8f4934e0590e8630e73779d}{
RO\_\-M\_\-NS\_\-SINGLE}
\label{ESS_8c_046980c340b420fcbe3d64869215094f8d4ce90fb8f4934e0590e8630e73779d}
}]Non-zero-suppress, single range readout \index{RO\_\-M\_\-ZS\_\-FOUR@{RO\_\-M\_\-ZS\_\-FOUR}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-ZS\_\-FOUR@{RO\_\-M\_\-ZS\_\-FOUR}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f3833c5d922a38650bc657fd352f8a8e6}{
RO\_\-M\_\-ZS\_\-FOUR}
\label{ESS_8c_046980c340b420fcbe3d64869215094f3833c5d922a38650bc657fd352f8a8e6}
}]Zero-suppress, four range readout \index{RO\_\-M\_\-NS\_\-FOUR@{RO\_\-M\_\-NS\_\-FOUR}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-NS\_\-FOUR@{RO\_\-M\_\-NS\_\-FOUR}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f81aa2b5fd307c9da81c8f0d0fa2e7c24}{
RO\_\-M\_\-NS\_\-FOUR}
\label{ESS_8c_046980c340b420fcbe3d64869215094f81aa2b5fd307c9da81c8f0d0fa2e7c24}
}]Non-zero-suppress, four range readout \index{RO\_\-M\_\-SINGLE@{RO\_\-M\_\-SINGLE}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-SINGLE@{RO\_\-M\_\-SINGLE}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f4dd664d52564f44cedd22201363b8671}{
RO\_\-M\_\-SINGLE}
\label{ESS_8c_046980c340b420fcbe3d64869215094f4dd664d52564f44cedd22201363b8671}
}]Convenience symbol for single, either zero or non-zero-suppress \index{RO\_\-M\_\-FOUR@{RO\_\-M\_\-FOUR}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-FOUR@{RO\_\-M\_\-FOUR}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f5614e7779ec420f4e908ef32101247e3}{
RO\_\-M\_\-FOUR}
\label{ESS_8c_046980c340b420fcbe3d64869215094f5614e7779ec420f4e908ef32101247e3}
}]Convenience symbol for four, either zero or non-zero-suppress \index{RO\_\-M\_\-ZS@{RO\_\-M\_\-ZS}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-ZS@{RO\_\-M\_\-ZS}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f8da441a6a4905f57cfd1080efc4d0843}{
RO\_\-M\_\-ZS}
\label{ESS_8c_046980c340b420fcbe3d64869215094f8da441a6a4905f57cfd1080efc4d0843}
}]Convenience symbol for zero-suppress, either single or four range \index{RO\_\-M\_\-NS@{RO\_\-M\_\-NS}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-NS@{RO\_\-M\_\-NS}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094f46eb43d0ef53e62b5fabdb632f1d5ea1}{
RO\_\-M\_\-NS}
\label{ESS_8c_046980c340b420fcbe3d64869215094f46eb43d0ef53e62b5fabdb632f1d5ea1}
}]Convenience symbol for non-zero-suppress, either single or four range \index{RO\_\-M\_\-ALL@{RO\_\-M\_\-ALL}!ESS.c@{ESS.c}}\index{ESS.c@{ESS.c}!RO\_\-M\_\-ALL@{RO\_\-M\_\-ALL}}\item[{\em 
\hypertarget{ESS_8c_046980c340b420fcbe3d64869215094fccfefaf50b9b17fa7aaab93cdd05d543}{
RO\_\-M\_\-ALL}
\label{ESS_8c_046980c340b420fcbe3d64869215094fccfefaf50b9b17fa7aaab93cdd05d543}
}]Convenience symbol four all possible combinations \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{ESS_8c_3e761f1b028458707bccbb7b9c2f5b70}{
\index{ESS.c@{ESS.c}!ESS\_\-construct@{ESS\_\-construct}}
\index{ESS\_\-construct@{ESS\_\-construct}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-construct}]{\setlength{\rightskip}{0pt plus 5cm}void ESS\_\-construct (ESS\_\-ctl $\ast$ {\em ess})}}
\label{ESS_8c_3e761f1b028458707bccbb7b9c2f5b70}


Constructs (initializes) the ESS control structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to initialize \end{description}
\end{Desc}


References ESS\_\-LOGIC\_\-K\_\-OR.\hypertarget{ESS_8c_f62f179dda914f9cfc78fd0ed8cfbb75}{
\index{ESS.c@{ESS.c}!ESS\_\-parse\_\-cond@{ESS\_\-parse\_\-cond}}
\index{ESS\_\-parse\_\-cond@{ESS\_\-parse\_\-cond}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-parse\_\-cond}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-parse\_\-cond (ESS\_\-ctl $\ast$ {\em ess}, \/  const char $\ast$ {\em s})}}
\label{ESS_8c_f62f179dda914f9cfc78fd0ed8cfbb75}


Parses the string for the trigger condition specification. 

\begin{Desc}
\item[Returns:]The trigger condition filter word\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill \item[{\em s}]The string to parse.\end{description}
\end{Desc}
\begin{Desc}
\item[Syntax of the string ]A form of a string is $<$logic\_\-specifier$>$$<$list of trigger condition specifiers$>$\end{Desc}
\begin{Desc}
\item[List of trigger condition specifiers]The trigger condition specifiers are\begin{itemize}
\item r Region of interest (throttle tracker trigger)\item t 3-in-a-row\item l CAL lo\item h CAL hi\item c CNO\item p Periodic\item s Solicited\item e External\end{itemize}
\end{Desc}
\begin{Desc}
\item[]The specifiers may be specified in the positive (must be present) or negative (must be absent) sense. A string of positive specifiers is introduced by a {\em +\/} and a string of negative specifiers is introduced by a {\em -\/}. By default, the initial string starts as a string of positive identifiers.\end{Desc}
\begin{Desc}
\item[Logic]If the string begins with \end{Desc}
\begin{Desc}
\item[List of trigger condition specifiers]This string to parse comes in in three forms\end{Desc}
\begin{itemize}
\item {\em \/}:, True if the AND of the condition specifiers and the actual trigger conditions matches the comparison set. This effectively treats the specifiers not mentioned as don't care.\item {\em =\/}, True if the list of the specified trigger conditions and the actual trigger conditions are an exact match. In this case the default comparison set is the complete set.\item otherwise, True if the OR of the specified conditions specifiers and the actual trigger conditions is non-zero. In this case the concept of a comparison set is unnecessary\end{itemize}


\begin{Desc}
\item[Limitations]In order to keep the interface simply, arbitrary combinations cannot be specified with the syntax above.\end{Desc}
\begin{Desc}
\item[Examples]\begin{enumerate}
\item Clh\par
 Allow any event with either CAL LO or CAL HI present\end{enumerate}
\end{Desc}
\begin{enumerate}
\item Cl-h\par
 Allow any event with either CAL LO present or CAL HI absent\end{enumerate}


\begin{enumerate}
\item C:lh\par
 Allow any event with both CAL LO and CAL HI present\end{enumerate}


\begin{enumerate}
\item C=lh\par
 Allow any event with only CAL LO and CAL HI present \end{enumerate}


References OPT\_\-M\_\-COND.\hypertarget{ESS_8c_95d8999ccfebf7f0383099e8af54a4ef}{
\index{ESS.c@{ESS.c}!ESS\_\-parse\_\-dgn@{ESS\_\-parse\_\-dgn}}
\index{ESS\_\-parse\_\-dgn@{ESS\_\-parse\_\-dgn}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-parse\_\-dgn}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-parse\_\-dgn (ESS\_\-ctl $\ast$ {\em ess}, \/  const char $\ast$ {\em s})}}
\label{ESS_8c_95d8999ccfebf7f0383099e8af54a4ef}


Parses the specified input string {\em s\/}, for a diagnostic selection. 

\begin{Desc}
\item[Returns:]Parsing status, 0 if succesful\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill \item[{\em s}]The string to parse. If NULL, the diagnostic selection defaults to any contributor \end{description}
\end{Desc}


References OPT\_\-M\_\-DGN.\hypertarget{ESS_8c_5ae010fe2a7534677d7dd121fe55e3f8}{
\index{ESS.c@{ESS.c}!ESS\_\-parse\_\-err@{ESS\_\-parse\_\-err}}
\index{ESS\_\-parse\_\-err@{ESS\_\-parse\_\-err}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-parse\_\-err}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-parse\_\-err (ESS\_\-ctl $\ast$ {\em ess}, \/  const char $\ast$ {\em s})}}
\label{ESS_8c_5ae010fe2a7534677d7dd121fe55e3f8}


Parses the specified input string {\em s\/}, for an error selection. 

\begin{Desc}
\item[Returns:]Parsing status, 0 if succesful\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill \item[{\em s}]The string to parse. If NULL, the error selection defaults to any contributor \end{description}
\end{Desc}


References OPT\_\-M\_\-ERR.\hypertarget{ESS_8c_ee6b135eb35c35da881985e87397f68c}{
\index{ESS.c@{ESS.c}!ESS\_\-parse\_\-pkt@{ESS\_\-parse\_\-pkt}}
\index{ESS\_\-parse\_\-pkt@{ESS\_\-parse\_\-pkt}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-parse\_\-pkt}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-parse\_\-pkt (ESS\_\-ctl $\ast$ {\em ess}, \/  const char $\ast$ {\em s})}}
\label{ESS_8c_ee6b135eb35c35da881985e87397f68c}


Parses the specified input string {\em s\/}, for a packet range. 

\begin{Desc}
\item[Returns:]Parsing status, 0 if succesful\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill, see the documentation for get\_\-range on the allowed syntax of {\em s\/}. \item[{\em s}]The string to parse \end{description}
\end{Desc}


References get\_\-range(), and OPT\_\-M\_\-PKT.\hypertarget{ESS_8c_65d01f149fdabd9c967f029ee46eb2be}{
\index{ESS.c@{ESS.c}!ESS\_\-parse\_\-readout@{ESS\_\-parse\_\-readout}}
\index{ESS\_\-parse\_\-readout@{ESS\_\-parse\_\-readout}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-parse\_\-readout}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-parse\_\-readout (ESS\_\-ctl $\ast$ {\em ess}, \/  const char $\ast$ {\em s})}}
\label{ESS_8c_65d01f149fdabd9c967f029ee46eb2be}


Parses the input string, extracting a readout mask. 

\begin{Desc}
\item[Returns:]The readout mask\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill, see the documentation for get\_\-range on the allowed syntax of {\em s\/}. \item[{\em s}]The input string, consisting of up to 4 characters\begin{itemize}
\item z permit events with zero-suppression enabled\item n permit events with zero-suppression disabled\item 4 permit events in four range readout mode\item 1 permit events in single range readout mode\end{itemize}
\end{description}
\end{Desc}
If neither {\em z\/} or {\em n\/} are specified, it is as if both are specified If neither {\em 4\/} or {\em 1\/} are specified, it is as if both are specified 

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.\hypertarget{ESS_8c_c8e78487644b5935adc4ffacaa37da04}{
\index{ESS.c@{ESS.c}!ESS\_\-parse\_\-size@{ESS\_\-parse\_\-size}}
\index{ESS\_\-parse\_\-size@{ESS\_\-parse\_\-size}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-parse\_\-size}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-parse\_\-size (ESS\_\-ctl $\ast$ {\em ess}, \/  const char $\ast$ {\em s})}}
\label{ESS_8c_c8e78487644b5935adc4ffacaa37da04}


Parses the specified input string {\em s\/}, for a packet range. 

\begin{Desc}
\item[Returns:]Parsing status, 0 if succesful\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill, see the documentation for get\_\-range on the allowed syntax of {\em s\/}. \item[{\em s}]The string to parse \end{description}
\end{Desc}


References get\_\-range(), and OPT\_\-M\_\-SIZE.\hypertarget{ESS_8c_1e5fb6003ab48d1a5bc7e70b3712711d}{
\index{ESS.c@{ESS.c}!ESS\_\-select@{ESS\_\-select}}
\index{ESS\_\-select@{ESS\_\-select}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-select}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-select (ESS\_\-ctl $\ast$ {\em ess}, \/  const {\bf EBF\_\-dir} $\ast$ {\em dir}, \/  unsigned int {\em npkts}, \/  unsigned int {\em nbytes})}}
\label{ESS_8c_1e5fb6003ab48d1a5bc7e70b3712711d}


Evaluates to the filter status. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,does}]not pass \item[{\em 1,passes}]\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The selection parameters \item[{\em dir}]The EBF directory structure \item[{\em npkts}]The number of packets in this event. This is relevant if and only if the OPT\_\-M\_\-PKT selection option is active. \item[{\em nbytes}]The number of bytes in this event. This is relevant if and only if the OPT\_\-M\_\-SIZE selection option is active. \end{description}
\end{Desc}


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.\hypertarget{ESS_8c_99807c540562da91a712845d6385ea1c}{
\index{ESS.c@{ESS.c}!ESS\_\-set\_\-logic@{ESS\_\-set\_\-logic}}
\index{ESS\_\-set\_\-logic@{ESS\_\-set\_\-logic}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-set\_\-logic}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-set\_\-logic (ESS\_\-ctl $\ast$ {\em ess}, \/  {\bf ESS\_\-logic} {\em logic})}}
\label{ESS_8c_99807c540562da91a712845d6385ea1c}


Currently just sets the evaluation condition to the 'AND'. 

\begin{Desc}
\item[Returns:]Parsing status, 0 if succesful\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ess}]The control structure to fill \item[{\em logic}]The string to parse. Currently unused, should be specified as NULL \end{description}
\end{Desc}
\hypertarget{ESS_8c_45aaa5af9ddf1f0fcd221583de37cfc0}{
\index{ESS.c@{ESS.c}!ESS\_\-sizeof@{ESS\_\-sizeof}}
\index{ESS\_\-sizeof@{ESS\_\-sizeof}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int ESS\_\-sizeof (void)}}
\label{ESS_8c_45aaa5af9ddf1f0fcd221583de37cfc0}


Returns the size, in bytes, of the ESS control structure. 

\begin{Desc}
\item[Returns:]The size, in bytes, of the ESS control structure. \end{Desc}
\hypertarget{ESS_8c_8c5e2c14012df8438e7b0fdfbf5073ab}{
\index{ESS.c@{ESS.c}!get\_\-range@{get\_\-range}}
\index{get\_\-range@{get\_\-range}!ESS.c@{ESS.c}}
\subsubsection[{get\_\-range}]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int get\_\-range (const char $\ast$ {\em s}, \/  unsigned int {\em opt}, \/  unsigned int $\ast$ {\em min}, \/  unsigned int $\ast$ {\em max})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{ESS_8c_8c5e2c14012df8438e7b0fdfbf5073ab}


Parses the input string, extracting a range. 

\begin{Desc}
\item[Returns:]The specified option\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s}]The input string. This can be a single number or a pair of numbers\begin{itemize}
\item A single positive number indicates the value is an inclusive lower limit\item A single negative number indicates the value is an inclusive upper limit\item An {\em =\/} followed by a single number indicates precisely that number only.\item A pair of numbers separated by a comma indicates an inclusive range \end{itemize}
\item[{\em opt}]Option used to indicate a minimum was specified \item[{\em min}]Returned as the minimum value \item[{\em max}]Returned as the maximum value \end{description}
\end{Desc}


Referenced by ESS\_\-parse\_\-pkt(), and ESS\_\-parse\_\-size().

\subsection{Variable Documentation}
\hypertarget{ESS_8c_c328856ff8e0ec81cac258ccdeaf010e}{
\index{ESS.c@{ESS.c}!ESS\_\-usage\_\-cond@{ESS\_\-usage\_\-cond}}
\index{ESS\_\-usage\_\-cond@{ESS\_\-usage\_\-cond}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-usage\_\-cond}]{\setlength{\rightskip}{0pt plus 5cm}const char {\bf ESS\_\-usage\_\-cond}}}
\label{ESS_8c_c328856ff8e0ec81cac258ccdeaf010e}


\textbf{Initial value:}

\begin{Code}\begin{verbatim}
   "  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"
\end{verbatim}
\end{Code}
String for defining a GEM Pattern Condition specifier. This is meant to be used when reporting the usage of this specifier. 

\hypertarget{ESS_8c_942885ca8cb35f0b313c4420b1344ad8}{
\index{ESS.c@{ESS.c}!ESS\_\-usage\_\-range@{ESS\_\-usage\_\-range}}
\index{ESS\_\-usage\_\-range@{ESS\_\-usage\_\-range}!ESS.c@{ESS.c}}
\subsubsection[{ESS\_\-usage\_\-range}]{\setlength{\rightskip}{0pt plus 5cm}const char {\bf ESS\_\-usage\_\-range}}}
\label{ESS_8c_942885ca8cb35f0b313c4420b1344ad8}


\textbf{Initial value:}

\begin{Code}\begin{verbatim}
   "  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"
\end{verbatim}
\end{Code}
String for defining a range specifier. This is meant to be used when reporting the usage of this specifier. 

