\hypertarget{event_8c}{
\section{event.c File Reference}
\label{event_8c}\index{event.c@{event.c}}
}
Routines that handle raw event data. 

{\tt \#include \char`\"{}LSEC\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC/LSEC.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC/LSEC\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-dir.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-edw.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-siv.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__LSEC__event}{\_\-LSEC\_\-event}
\begin{CompactList}\small\item\em Structure holding raw event data. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \{ \hyperlink{event_8c_dc29c2ff13d900c2f185ee95427fb06c6bfd1c3fbdf2b545a5d1bc1dd4533283}{MAX\_\-OVERHEAD\_\-PER\_\-EVENT} =  sizeof(EBF\_\-pktHdr) $\ast$ 8 $\ast$ 56
 \}
\begin{CompactList}\small\item\em Various constants. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{event_8c_74c11eb498c64ea9102c02cd5e7d200e}{LSEC\_\-eventClear} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt)
\begin{CompactList}\small\item\em Clear the stored event data. \item\end{CompactList}\item 
\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$ \hyperlink{event_8c_aad0a8ea7ad8e102cb728f086c0f5b8d}{LSEC\_\-eventCreate} (int cap, long long $\ast$times)
\begin{CompactList}\small\item\em Create a new event structure. \item\end{CompactList}\item 
void \hyperlink{event_8c_a02662052945c47d0daae9d509b8dc33}{LSEC\_\-eventDelete} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt)
\begin{CompactList}\small\item\em Delete the previously allocated event structure. \item\end{CompactList}\item 
EBF\_\-dir $\ast$ \hyperlink{event_8c_b752530eca99b9ce1b86a9a9d932d778}{LSEC\_\-eventGet} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt)
\begin{CompactList}\small\item\em Get the EBF directory pointer for the next stored event. \item\end{CompactList}\item 
void \hyperlink{event_8c_49cb1669a6052c6f20e497d6c56fbd43}{LSEC\_\-eventPrepare} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt, int save)
\begin{CompactList}\small\item\em Prepare for a new run. \item\end{CompactList}\item 
unsigned \hyperlink{event_8c_9f17c7359e0610fe8dbcb33c868192aa}{LSEC\_\-eventProcess} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt, unsigned int edw, EBF\_\-pkt $\ast$pkt)
\begin{CompactList}\small\item\em Process an event packet. \item\end{CompactList}\item 
void \hyperlink{event_8c_ed1d905c08fc50554e39e280dc714259}{LSEC\_\-eventProcSet} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt, \hyperlink{LSEC__p_8h_ceefe78efae20f2d0feec10d79684caf}{LSEC\_\-eventProcRtn} $\ast$rtn, void $\ast$parm)
\begin{CompactList}\small\item\em Set the event processing routine to use. \item\end{CompactList}\item 
void \hyperlink{event_8c_7630f0a03c64c8a7894d999c6b64cdf1}{LSEC\_\-eventRestart} (\hyperlink{struct__LSEC__event}{LSEC\_\-event} $\ast$evt)
\begin{CompactList}\small\item\em Reset event store reading to start over. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Routines that handle raw event data. 

\begin{Desc}
\item[Author:]Owen Saxton\end{Desc}
{\bf \$Id:} \hyperlink{event_8c}{event.c},v 1.3 2010/05/03 16:31:39 saxton Exp \$ 

\subsection{Enumeration Type Documentation}
\hypertarget{event_8c_dc29c2ff13d900c2f185ee95427fb06c}{
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}}
\label{event_8c_dc29c2ff13d900c2f185ee95427fb06c}


Various constants. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{MAX_OVERHEAD_PER_EVENT@{MAX\_\-OVERHEAD\_\-PER\_\-EVENT}!event.c@{event.c}}\index{event.c@{event.c}!MAX_OVERHEAD_PER_EVENT@{MAX\_\-OVERHEAD\_\-PER\_\-EVENT}}\item[{\em 
\hypertarget{event_8c_dc29c2ff13d900c2f185ee95427fb06c6bfd1c3fbdf2b545a5d1bc1dd4533283}{
MAX\_\-OVERHEAD\_\-PER\_\-EVENT}
\label{event_8c_dc29c2ff13d900c2f185ee95427fb06c6bfd1c3fbdf2b545a5d1bc1dd4533283}
}]Maximum fragmentation gives 8 pktHdrs and 8 event descriptor words per KB,. \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{event_8c_74c11eb498c64ea9102c02cd5e7d200e}{
\index{event.c@{event.c}!LSEC_eventClear@{LSEC\_\-eventClear}}
\index{LSEC_eventClear@{LSEC\_\-eventClear}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-eventClear ({\bf LSEC\_\-event} $\ast$ {\em evt})}}
\label{event_8c_74c11eb498c64ea9102c02cd5e7d200e}


Clear the stored event data. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to an event structure. \end{description}
\end{Desc}
\hypertarget{event_8c_aad0a8ea7ad8e102cb728f086c0f5b8d}{
\index{event.c@{event.c}!LSEC_eventCreate@{LSEC\_\-eventCreate}}
\index{LSEC_eventCreate@{LSEC\_\-eventCreate}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf LSEC\_\-event}$\ast$ LSEC\_\-eventCreate (int {\em cap}, long long $\ast$ {\em times})}}
\label{event_8c_aad0a8ea7ad8e102cb728f086c0f5b8d}


Create a new event structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cap}]The maximum number of events that can be stored.\item[{\em times}]Address of the processing times array.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the new event structure, or NULL if there is insufficient memory available. \end{Desc}
\hypertarget{event_8c_a02662052945c47d0daae9d509b8dc33}{
\index{event.c@{event.c}!LSEC_eventDelete@{LSEC\_\-eventDelete}}
\index{LSEC_eventDelete@{LSEC\_\-eventDelete}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-eventDelete ({\bf LSEC\_\-event} $\ast$ {\em evt})}}
\label{event_8c_a02662052945c47d0daae9d509b8dc33}


Delete the previously allocated event structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to allocated, intialised event structure \end{description}
\end{Desc}
\hypertarget{event_8c_b752530eca99b9ce1b86a9a9d932d778}{
\index{event.c@{event.c}!LSEC_eventGet@{LSEC\_\-eventGet}}
\index{LSEC_eventGet@{LSEC\_\-eventGet}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}EBF\_\-dir$\ast$ LSEC\_\-eventGet ({\bf LSEC\_\-event} $\ast$ {\em evt})}}
\label{event_8c_b752530eca99b9ce1b86a9a9d932d778}


Get the EBF directory pointer for the next stored event. 

This routine return a pointer to the directory of the next event and advances the read counter.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to an event structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the directory of the next event, or NULL if there are no more events. \end{Desc}
\hypertarget{event_8c_49cb1669a6052c6f20e497d6c56fbd43}{
\index{event.c@{event.c}!LSEC_eventPrepare@{LSEC\_\-eventPrepare}}
\index{LSEC_eventPrepare@{LSEC\_\-eventPrepare}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-eventPrepare ({\bf LSEC\_\-event} $\ast$ {\em evt}, int {\em save})}}
\label{event_8c_49cb1669a6052c6f20e497d6c56fbd43}


Prepare for a new run. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to allocated, intialised event structure\item[{\em save}]TRUE if events are to be saved, FALSE otherwise. \end{description}
\end{Desc}
\hypertarget{event_8c_9f17c7359e0610fe8dbcb33c868192aa}{
\index{event.c@{event.c}!LSEC_eventProcess@{LSEC\_\-eventProcess}}
\index{LSEC_eventProcess@{LSEC\_\-eventProcess}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-eventProcess ({\bf LSEC\_\-event} $\ast$ {\em evt}, unsigned int {\em edw}, EBF\_\-pkt $\ast$ {\em pkt})}}
\label{event_8c_9f17c7359e0610fe8dbcb33c868192aa}


Process an event packet. 

This routine is called whenever a new event packet arrives.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to an event structure\item[{\em edw}]Description of the event (a thirty-two bit number that indicates, among other things, errors in the event transmission)\item[{\em pkt}]Pointer to the event packet\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The OR of zero or more of the bits:\begin{itemize}
\item \hyperlink{LSEC_8h_a80313f67e97ae160a5ae3b03292b1bd6e3d0bcd67d4cedff34e5118f663a95e}{LSEC\_\-EVT\_\-FREE} Free the packet\item \hyperlink{LSEC_8h_a80313f67e97ae160a5ae3b03292b1bdc89e347fdb8dde9f617fc63aca9e0b70}{LSEC\_\-EVT\_\-DONE} Event is complete \end{itemize}
\end{Desc}
\hypertarget{event_8c_ed1d905c08fc50554e39e280dc714259}{
\index{event.c@{event.c}!LSEC_eventProcSet@{LSEC\_\-eventProcSet}}
\index{LSEC_eventProcSet@{LSEC\_\-eventProcSet}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-eventProcSet ({\bf LSEC\_\-event} $\ast$ {\em evt}, {\bf LSEC\_\-eventProcRtn} $\ast$ {\em rtn}, void $\ast$ {\em parm})}}
\label{event_8c_ed1d905c08fc50554e39e280dc714259}


Set the event processing routine to use. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to an event structure.\item[{\em rtn}]Pointer to the processing routine.\item[{\em parm}]Parameter to pass to the processing routine. \end{description}
\end{Desc}
\hypertarget{event_8c_7630f0a03c64c8a7894d999c6b64cdf1}{
\index{event.c@{event.c}!LSEC_eventRestart@{LSEC\_\-eventRestart}}
\index{LSEC_eventRestart@{LSEC\_\-eventRestart}!event.c@{event.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-eventRestart ({\bf LSEC\_\-event} $\ast$ {\em evt})}}
\label{event_8c_7630f0a03c64c8a7894d999c6b64cdf1}


Reset event store reading to start over. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em evt}]Pointer to an event structure. \end{description}
\end{Desc}
