\hypertarget{EFA_8h}{
\section{EFA.h File Reference}
\label{EFA_8h}\index{EFA.h@{EFA.h}}
}
Defines the functions to a header common to all event-based analysis. 

{\tt \#include \char`\"{}EFC/EFA\_\-def.h\char`\"{}}\par


Include dependency graph for EFA.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=111pt]{EFA_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=189pt]{EFA_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{EFA_8h_a0}{
typedef \hyperlink{struct__EFA}{\_\-EFA} {\bf EFA}}
\label{EFA_8h_a0}

\item 
\hypertarget{EFA_8h_a1}{
typedef \hyperlink{struct__EFA__hdr}{\_\-EFA\_\-hdr} {\bf EFA\_\-hdr}}
\label{EFA_8h_a1}

\item 
\hypertarget{EFA_8h_a2}{
typedef \_\-EDS\_\-cfg\-Info {\bf EDS\_\-cfg\-Info}}
\label{EFA_8h_a2}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{EFA_8h_a3}{EFA\_\-construct} (\hyperlink{struct__EFA}{EFA} $\ast$efa, void $\ast$pool, int enable, const \hyperlink{struct__EFA__services}{EFA\_\-services} $\ast$services, void $\ast$ctx, unsigned int size, unsigned int post\-Cnt, unsigned int rec\-Cnt)
\begin{CompactList}\small\item\em Set up the internal data structures of the EFA control structure. \item\end{CompactList}\item 
int \hyperlink{EFA_8h_a4}{EFA\_\-flush} (\hyperlink{struct__EFA}{EFA} $\ast$efa, int reason)
\begin{CompactList}\small\item\em Forces a posting of the current results. \item\end{CompactList}\item 
int \hyperlink{EFA_8h_a5}{EFA\_\-notify} (\hyperlink{struct__EFA}{EFA} $\ast$efa, int mode, const EDS\_\-cfg\-Info $\ast$cfg)
\begin{CompactList}\small\item\em Callback signature to notify an analyis routine of a mode change. \item\end{CompactList}\item 
int \hyperlink{EFA_8h_a6}{EFA\_\-result\-Sizeof} (const \hyperlink{struct__EFA}{EFA} $\ast$efa)
\begin{CompactList}\small\item\em Returns the size, in bytes, of one result vector. \item\end{CompactList}\item 
int \hyperlink{EFA_8h_a7}{EFA\_\-sizeof} (int result\_\-size, int result\_\-cnt)
\begin{CompactList}\small\item\em Computes the size, in bytes, of the EFA control structure. \item\end{CompactList}\item 
int \hyperlink{EFA_8h_a8}{EFA\_\-enable} (\hyperlink{struct__EFA}{EFA} $\ast$efa, int enable)
\begin{CompactList}\small\item\em Enables/disables EFA. This can only be done outside the context of a run, i.e. the state must be STOPPED. \item\end{CompactList}\item 
int \hyperlink{EFA_8h_a9}{EFA\_\-start} (\hyperlink{struct__EFA}{EFA} $\ast$efa, int reason, int run\_\-id, int start\-Time, int mode)
\begin{CompactList}\small\item\em Callback signature to start or prepare a posting stream to receive events. \item\end{CompactList}\item 
unsigned int \hyperlink{EFA_8h_a10}{EFA\_\-hdr\-Compose} (\hyperlink{struct__EFA__hdr}{EFA\_\-hdr} $\ast$hdr, unsigned int relative, unsigned long long seq, unsigned int gem\-Clock, unsigned int gem\-Strobe)
\begin{CompactList}\small\item\em Composes specified event header. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Defines the functions to a header common to all event-based analysis. 

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


\footnotesize\begin{verbatim}   CVS $Id: EFA.h,v 1.1 2007/10/10 23:40:42 russell Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{EFA_8h_a3}{
\index{EFA.h@{EFA.h}!EFA_construct@{EFA\_\-construct}}
\index{EFA_construct@{EFA\_\-construct}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-construct]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-construct (\hyperlink{struct__EFA}{EFA} $\ast$ {\em efa}, void $\ast$ {\em pool}, int {\em enable}, const \hyperlink{struct__EFA__services}{EFA\_\-services} $\ast$ {\em services}, void $\ast$ {\em ctx}, unsigned int {\em size}, unsigned int {\em post\-Cnt}, unsigned int {\em flush\-Cnt})}}
\label{EFA_8h_a3}


Set up the internal data structures of the EFA control structure. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,Success}]\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efa}]The Event Filter Analysis control structure \item[{\em pool}]The memory pool \item[{\em enable}]1 if start in the enabled state, else start in the disabled state \item[{\em services}]The set of service routines \item[{\em ctx}]Arbitrary user context parameter passed to the user callback routines \item[{\em size}]The size of a result vector. This value should have been obtained by a call to EFA\_\-result\-Sizeof This routine checks that this value matches that from EFA\_\-result\-Sizeof. \item[{\em post\-Cnt}]The number of result vectors in a packet. This results in a process flush reason \item[{\em flush\-Cnt}]The number of result vectors before a flush is issued. This results in a process LSF\_\-REASON\_\-CLOSE\_\-K\_\-STOP\_\-CNT flush reason.\end{description}
\end{Desc}
\hypertarget{EFA_8h_a8}{
\index{EFA.h@{EFA.h}!EFA_enable@{EFA\_\-enable}}
\index{EFA_enable@{EFA\_\-enable}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-enable]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-enable (\hyperlink{struct__EFA}{EFA} $\ast$ {\em efa}, int {\em enable})}}
\label{EFA_8h_a8}


Enables/disables EFA. This can only be done outside the context of a run, i.e. the state must be STOPPED. 

\begin{Desc}
\item[Returns:]0, if successful 

-1, on failure.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efa}]The Event Filter Analysis control handle \item[{\em enable}]If non-zero, enable, if zero, disable\end{description}
\end{Desc}
\hypertarget{EFA_8h_a4}{
\index{EFA.h@{EFA.h}!EFA_flush@{EFA\_\-flush}}
\index{EFA_flush@{EFA\_\-flush}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-flush]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-flush (\hyperlink{struct__EFA}{EFA} $\ast$ {\em efa}, int {\em reason})}}
\label{EFA_8h_a4}


Forces a posting of the current results. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efa}]The event filter analysis control structure \item[{\em reason}]The reason flush is being called.\end{description}
\end{Desc}
\begin{Desc}
\item[]This routine is meant to flush any remaining result vectors, such as at the end of a run. There is no interlocking. If result vectors are still being accumulated, the caller must arrange such an interlocking mechanism.\end{Desc}
\hypertarget{EFA_8h_a10}{
\index{EFA.h@{EFA.h}!EFA_hdrCompose@{EFA\_\-hdrCompose}}
\index{EFA_hdrCompose@{EFA\_\-hdrCompose}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-hdrCompose]{\setlength{\rightskip}{0pt plus 5cm}unsigned int EFA\_\-hdr\-Compose (\hyperlink{struct__EFA__hdr}{EFA\_\-hdr} $\ast$ {\em hdr}, unsigned int {\em relative}, unsigned long long {\em seq}, unsigned int {\em gem\-Clock}, unsigned int {\em gem\-Strobe})}}
\label{EFA_8h_a10}


Composes specified event header. 

\begin{Desc}
\item[Returns:]The timetone's status flag word\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hdr}]Pointer to the target EFA\_\-hdr \item[{\em relative}]The relative (to the beginning of the buffer) event number (1 = first event) \item[{\em seq}]Extended seqence number of the event \item[{\em gem\-Clock}]Event clock register read from GEM contributor of event \item[{\em gem\-Strobe}]Event PPS cock register read from GEM contributor of event\end{description}
\end{Desc}
This is convenience routine to fill in event info that is stored in a EFA\_\-hdr structure within an LSF packet for eventual output as science data on the SSR.\hypertarget{EFA_8h_a5}{
\index{EFA.h@{EFA.h}!EFA_notify@{EFA\_\-notify}}
\index{EFA_notify@{EFA\_\-notify}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-notify]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-notify (\hyperlink{struct__EFA}{EFA} $\ast$ {\em efa}, int {\em mode}, const EDS\_\-cfg\-Info $\ast$ {\em cfg})}}
\label{EFA_8h_a5}


Callback signature to notify an analyis routine of a mode change. 

\begin{Desc}
\item[Returns:]0 is successful, non-zero otherwise\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efa}]The Event Filter Analysis control handle \item[{\em mode}]The new running mode. \item[{\em cfg}]The new configuration information\end{description}
\end{Desc}
\hypertarget{EFA_8h_a6}{
\index{EFA.h@{EFA.h}!EFA_resultSizeof@{EFA\_\-resultSizeof}}
\index{EFA_resultSizeof@{EFA\_\-resultSizeof}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-resultSizeof]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-result\-Sizeof (const \hyperlink{struct__EFA}{EFA} $\ast$ {\em efa})}}
\label{EFA_8h_a6}


Returns the size, in bytes, of one result vector. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]size, in bytes, of one result vector\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efa}]The Event Filter Analysis Control Block\end{description}
\end{Desc}
\hypertarget{EFA_8h_a7}{
\index{EFA.h@{EFA.h}!EFA_sizeof@{EFA\_\-sizeof}}
\index{EFA_sizeof@{EFA\_\-sizeof}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-sizeof]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-sizeof (int {\em result\_\-size}, int {\em result\_\-cnt})}}
\label{EFA_8h_a7}


Computes the size, in bytes, of the EFA control structure. 

\begin{Desc}
\item[Returns:]The size, in bytes,\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em result\_\-size}]The size, in bytes, of one result vector \item[{\em result\_\-cnt}]The number of result vectors in one packet\end{description}
\end{Desc}
\hypertarget{EFA_8h_a9}{
\index{EFA.h@{EFA.h}!EFA_start@{EFA\_\-start}}
\index{EFA_start@{EFA\_\-start}!EFA.h@{EFA.h}}
\subsubsection[EFA\_\-start]{\setlength{\rightskip}{0pt plus 5cm}int EFA\_\-start (\hyperlink{struct__EFA}{EFA} $\ast$ {\em efa}, int {\em reason}, int {\em run\_\-id}, int {\em start\-Time}, int {\em mode})}}
\label{EFA_8h_a9}


Callback signature to start or prepare a posting stream to receive events. 

\begin{Desc}
\item[Returns:]0 is successful, non-zero otherwise\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efa}]The Event Filter Analysis control handle \item[{\em reason}]The LSF\_\-REASON\_\-OPEN to indicate why the stream is being started \item[{\em run\_\-id}]Suggested use is to identify the block of events between when EDS\_\-fw\-Handler\-Start is called and EDS\_\-fw\-Handler\-Flush is called with a stop reason \item[{\em start\-Time}]The run start time rounded to the nearest second \item[{\em mode}]This must be the running mode.\end{description}
\end{Desc}
