\hypertarget{EFS_8h}{
\section{EFS.h File Reference}
\label{EFS_8h}\index{EFS.h@{EFS.h}}
}
Defines the interface for summarizing the event-by-event results of a filtering process into a statistics table. This is a generic facility, with very little specific filter information.  


{\tt \#include $<$LSF/LSF\_\-cpu.h$>$}\par
{\tt \#include $<$LSF/LSF\_\-origin.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned char $\ast$ \hyperlink{EFS_8h_d087f485a746b86d92b47cb9a41d7f53}{EFS\_\-construct} (\hyperlink{struct__EFS}{EFS} $\ast$efs, const EFC\_\-DB\_\-SchemaAnalysis $\ast$schema, int result\_\-size, unsigned int apid\_\-offset, unsigned int dgmid\_\-offset, LSF\_\-CPU\_\-K cpu, LSF\_\-ORIGIN\_\-K origin, unsigned int schema\_\-key, LSD\_\-sdiWriteCbp $\ast$writeCbp)
\begin{CompactList}\small\item\em Constructs an Event Filter Statistics handle. \item\end{CompactList}\item 
void \hyperlink{EFS_8h_754dd2eff80f85a11ba08866ae88b92f}{EFS\_\-post} (\hyperlink{struct__EFS}{EFS} $\ast$efs, int reason, const void $\ast$beg, const void $\ast$end, const \hyperlink{struct__EFA__span}{EFA\_\-span} $\ast$span)
\begin{CompactList}\small\item\em Formats the datagram and eventually writes the datagram to the output device. \item\end{CompactList}\item 
int \hyperlink{EFS_8h_d23f1e746fe8955d0ff46345af2e8aad}{EFS\_\-sizeof} (int max\_\-records)
\begin{CompactList}\small\item\em Computes the size, in bytes, of the EFS control structure. \item\end{CompactList}\item 
int \hyperlink{EFS_8h_d36e3a5804dfefd6172ccdf4029176d8}{EFS\_\-start} (\hyperlink{struct__EFS}{EFS} $\ast$efs, int reason, int run\_\-id, int startTime, int mode)
\begin{CompactList}\small\item\em Captures the start run information. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Defines the interface for summarizing the event-by-event results of a filtering process into a statistics table. This is a generic facility, with very little specific filter information. 

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


\footnotesize\begin{verbatim}

   CVS $Id: EFS.h,v 1.2 2011/03/27 04:55:29 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{EFS_8h_d087f485a746b86d92b47cb9a41d7f53}{
\index{EFS.h@{EFS.h}!EFS\_\-construct@{EFS\_\-construct}}
\index{EFS\_\-construct@{EFS\_\-construct}!EFS.h@{EFS.h}}
\subsubsection[{EFS\_\-construct}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char $\ast$ EFS\_\-construct ({\bf EFS} $\ast$ {\em efs}, \/  const EFC\_\-DB\_\-SchemaAnalysis $\ast$ {\em schema}, \/  int {\em result\_\-size}, \/  unsigned int {\em apid\_\-offset}, \/  unsigned int {\em dgmid\_\-offset}, \/  LSF\_\-CPU\_\-K {\em cpu}, \/  LSF\_\-ORIGIN\_\-K {\em origin}, \/  unsigned int {\em schema\_\-key}, \/  LSD\_\-sdiWriteCbp $\ast$ {\em write})}}
\label{EFS_8h_d087f485a746b86d92b47cb9a41d7f53}


Constructs an Event Filter Statistics handle. 

\begin{Desc}
\item[Returns:]The next available memory location\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efs}]The control handle to be initialized \item[{\em schema}]The analysis schema \item[{\em result\_\-size}]The size, in 32-bit words, of a result vector This application only uses the first 32-bits assuming them to be a 32-bit Event Filter status mask. \item[{\em apid\_\-offset}]The offset to the base value of the APID. This must be a value between 0 - 4. In general it is represented by on of the values LSF\_\-CPU\_\-K\_\-EPU\_\-0,1,2 or LSF\_\-CPU\_\-SIU\_\-0,1 \item[{\em dgmid\_\-offset}]The offset of the datagram id. The value LSF\_\-ID\_\-K\_\-EFS will be added to this value. \item[{\em cpu}]One of the enumeration LSE\_\-CPU\_\-K specifying the CPU that is writing the datagram \item[{\em origin}]One of the enumeration LSE\_\-ORIGIN\_\-K specifying the origin of the data \item[{\em schema\_\-key}]The, usually FMX, key of the configuration file currently being used to produce the result vectors. This allows the consumer of the EFS datagrams to understand the conditions that the data was taken \item[{\em write}]Callback routine and parameter to commit the formatted datagram to the output device \end{description}
\end{Desc}


References compose\_\-ctx\_\-template(), \_\-EFS::ctbHdrId, \_\-EFS::ctxCtb, \_\-EFS::cur\_\-idx, \_\-EFS::dgm\_\-size, \_\-EFS::dgmHdrId, EFS\_\-ID\_\-K\_\-STATS, get\_\-datagram\_\-pool\_\-size(), get\_\-datagram\_\-size(), \_\-EFS::nrecs, \_\-EFS::recLimit, sbsKeyGet(), \_\-EFS::sdi, and \_\-EFS::stride.

Referenced by EFC\_\-stdConstruct().\hypertarget{EFS_8h_754dd2eff80f85a11ba08866ae88b92f}{
\index{EFS.h@{EFS.h}!EFS\_\-post@{EFS\_\-post}}
\index{EFS\_\-post@{EFS\_\-post}!EFS.h@{EFS.h}}
\subsubsection[{EFS\_\-post}]{\setlength{\rightskip}{0pt plus 5cm}void EFS\_\-post ({\bf EFS} $\ast$ {\em efs}, \/  int {\em reason}, \/  const void $\ast$ {\em beg}, \/  const void $\ast$ {\em end}, \/  const {\bf EFA\_\-span} $\ast$ {\em span})}}
\label{EFS_8h_754dd2eff80f85a11ba08866ae88b92f}


Formats the datagram and eventually writes the datagram to the output device. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efs}]The Event Filter Statistics handle \item[{\em reason}]The reason EFS\_\-post is being called. These are enumerated in EFA\_\-FLUSH\_\-REASON but, briefly are the set of the LSF\_\-REASONs augmented to a record update reason and a record process reason. \item[{\em beg}]The first result vector to analyze \item[{\em end}]The last (actually one past the last) result vector to analyze \item[{\em span}]Structure defining the span of events, both in time and event sequence numbers, that are being analyzed. \end{description}
\end{Desc}


References accumulate(), \_\-EFS\_\-ctxCtb::bdy, \_\-EFS\_\-ctxBridge::bf, \_\-EFS\_\-ctxKeys::cfg, \_\-EFA\_\-span::cfg\_\-id, \_\-EFS\_\-ctxBdy::cfg\_\-id, \_\-EFA\_\-span::cfg\_\-key, clear(), \_\-EFS\_\-ctxBridge\_\-bf::close, \_\-EFS\_\-stats::cnts, \_\-EFS::ctbHdrId, \_\-EFS\_\-datagram::ctx, \_\-EFS::ctxCtb, \_\-EFS::cur\_\-idx, \_\-EFS::dgm, \_\-EFS::dgm\_\-size, \_\-EFS::dgmHdrId, \_\-EFS\_\-ctxBdy::did, \_\-EfsPrvHdr::diff, EFA\_\-\_\-hdrSeqGet(), \_\-EfsPrvHdr::efaHdr, EFC\_\-\_\-timestampGet(), \_\-EFC\_\-time::f, format\_\-begin\_\-record(), format\_\-diff\_\-record(), format\_\-global\_\-record(), format\_\-record(), \_\-EFS::gbl\_\-span, \_\-EFS\_\-ctxCtb::hdr, \_\-EFS\_\-datagram::hdr, \_\-EFA\_\-span::hdrs, \_\-EFS\_\-ctxBdy::key, \_\-EFS::last, \_\-EFA\_\-span::mode, \_\-EFS::nrecs, OpenReasons, \_\-EFS::pds, \_\-EFS::prvHdr, \_\-EFS::rec, \_\-EFS::rec\_\-span, \_\-EFS::recLimit, \_\-EFS::sdi, \_\-EFA\_\-hdr::seq, \_\-EFS::stats, \_\-EFS\_\-datagram::stb, \_\-EFS::stride, and \_\-EFC\_\-time::ull.

Referenced by EFC\_\-stdConstruct().\hypertarget{EFS_8h_d23f1e746fe8955d0ff46345af2e8aad}{
\index{EFS.h@{EFS.h}!EFS\_\-sizeof@{EFS\_\-sizeof}}
\index{EFS\_\-sizeof@{EFS\_\-sizeof}!EFS.h@{EFS.h}}
\subsubsection[{EFS\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int EFS\_\-sizeof (int {\em max\_\-records})}}
\label{EFS_8h_d23f1e746fe8955d0ff46345af2e8aad}


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

\begin{Desc}
\item[Returns:]The size, in bytes,\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em max\_\-records}]The maximum number of records in a datagram \end{description}
\end{Desc}


References get\_\-datagram\_\-pool\_\-size().

Referenced by EFC\_\-stdConstruct(), and EFC\_\-stdSizeof().\hypertarget{EFS_8h_d36e3a5804dfefd6172ccdf4029176d8}{
\index{EFS.h@{EFS.h}!EFS\_\-start@{EFS\_\-start}}
\index{EFS\_\-start@{EFS\_\-start}!EFS.h@{EFS.h}}
\subsubsection[{EFS\_\-start}]{\setlength{\rightskip}{0pt plus 5cm}int EFS\_\-start ({\bf EFS} $\ast$ {\em efs}, \/  int {\em reason}, \/  int {\em run\_\-id}, \/  int {\em startTime}, \/  int {\em mode})}}
\label{EFS_8h_d36e3a5804dfefd6172ccdf4029176d8}


Captures the start run information. 

\begin{Desc}
\item[Returns:]0 is successful, non-zero otherwise\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em efs}]The Event Filter Statistics 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\_\-fwHandlerStart is called and EDS\_\-fwHandlerFlush is called with a stop reason \item[{\em startTime}]The run start time rounded to the nearest second \item[{\em mode}]This must be the running mode. \end{description}
\end{Desc}


References \_\-EFS\_\-ctxCtb::bdy, \_\-EFS\_\-ctxBridge::bf, \_\-EFS\_\-ctxBridge\_\-bf::close, \_\-EFS::ctxCtb, \_\-EFS::cur\_\-idx, \_\-EFS\_\-ctxBdy::did, \_\-EFS\_\-ctxCtb::hdr, \_\-EFS::nrecs, \_\-EFS\_\-ctxBridge\_\-bf::open, and \_\-EFS\_\-ctxBridge::ub.

Referenced by EFC\_\-stdConstruct().