\hypertarget{encode_8c}{
\section{encode.c File Reference}
\label{encode_8c}\index{encode.c@{encode.c}}
}
Encode the event against the previously populated histograms. 

{\tt \#include \char`\"{}compact.h\char`\"{}}\par
{\tt \#include \char`\"{}compress.ic\char`\"{}}\par
{\tt \#include \char`\"{}LSEC\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC/LSEC\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-cal.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-cid.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-tem.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-tkr.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LATP.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/WCT.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline void \hyperlink{encode_8c_3a555ce60799cc3924a078f81dbeee65}{setBit} (unsigned int index, unsigned int $\ast$buff)
\begin{CompactList}\small\item\em Set a bit in an integer buffer. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{encode_8c_f854e3927028bfe39c42ddbcd471e7a9}{setNib} (unsigned int value, unsigned int index, unsigned int $\ast$buff)
\begin{CompactList}\small\item\em Set a nibble in an integer buffer. \item\end{CompactList}\item 
unsigned int \hyperlink{encode_8c_d468a5dff7aa9223a3cc9f701b080a65}{LSEC\_\-encode} (\hyperlink{struct__LSEC__compaction}{LSEC\_\-compaction} $\ast$cpc, EBF\_\-dir $\ast$dir)
\begin{CompactList}\small\item\em Encode the next event from the collection. \item\end{CompactList}\item 
unsigned int \hyperlink{encode_8c_da3c5e06152139439f1bb003acd68937}{LSEC\_\-encodeAcd} (\hyperlink{struct__LSEC__compaction}{LSEC\_\-compaction} $\ast$cpc, EBF\_\-dir $\ast$dir)
\begin{CompactList}\small\item\em Encode the ACD event data. \item\end{CompactList}\item 
unsigned int \hyperlink{encode_8c_90119bfc9a3873615328413c7bea8395}{LSEC\_\-encodeCal} (\hyperlink{struct__LSEC__compaction}{LSEC\_\-compaction} $\ast$cpc, EBF\_\-dir $\ast$dir)
\begin{CompactList}\small\item\em Encode the CAL portion of the event. \item\end{CompactList}\item 
unsigned int \hyperlink{encode_8c_42bc13fdaab8a5289495d21c8e98be84}{LSEC\_\-encodeTkr} (\hyperlink{struct__LSEC__compaction}{LSEC\_\-compaction} $\ast$cpc, EBF\_\-dir $\ast$dir)
\begin{CompactList}\small\item\em Encode the TKR portion of the event. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Encode the event against the previously populated histograms. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
{\bf \$Id:} \hyperlink{encode_8c}{encode.c},v 1.13 2010/05/25 17:14:00 saxton Exp \$ 

\subsection{Function Documentation}
\hypertarget{encode_8c_d468a5dff7aa9223a3cc9f701b080a65}{
\index{encode.c@{encode.c}!LSEC_encode@{LSEC\_\-encode}}
\index{LSEC_encode@{LSEC\_\-encode}!encode.c@{encode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LSEC\_\-encode ({\bf LSEC\_\-compaction} $\ast$ {\em cpc}, EBF\_\-dir $\ast$ {\em dir})}}
\label{encode_8c_d468a5dff7aa9223a3cc9f701b080a65}


Encode the next event from the collection. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\item[{\em dir}]Pointer to the event to encode\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of the compressed event, or 0 if there is an error \end{Desc}
\hypertarget{encode_8c_da3c5e06152139439f1bb003acd68937}{
\index{encode.c@{encode.c}!LSEC_encodeAcd@{LSEC\_\-encodeAcd}}
\index{LSEC_encodeAcd@{LSEC\_\-encodeAcd}!encode.c@{encode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LSEC\_\-encodeAcd ({\bf LSEC\_\-compaction} $\ast$ {\em cpc}, EBF\_\-dir $\ast$ {\em dir})}}
\label{encode_8c_da3c5e06152139439f1bb003acd68937}


Encode the ACD event data. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Compaction structure\item[{\em dir}]Pointer to a directory of the event\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of the compressed event, in 32 bit words, or 0 if there is an error \end{Desc}
\hypertarget{encode_8c_90119bfc9a3873615328413c7bea8395}{
\index{encode.c@{encode.c}!LSEC_encodeCal@{LSEC\_\-encodeCal}}
\index{LSEC_encodeCal@{LSEC\_\-encodeCal}!encode.c@{encode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LSEC\_\-encodeCal ({\bf LSEC\_\-compaction} $\ast$ {\em cpc}, EBF\_\-dir $\ast$ {\em dir})}}
\label{encode_8c_90119bfc9a3873615328413c7bea8395}


Encode the CAL portion of the event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Compaction structure\item[{\em dir}]Pointer to a directory of the event\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of the compressed event, in 32 bit words, or 0 if there is an error \end{Desc}
\hypertarget{encode_8c_42bc13fdaab8a5289495d21c8e98be84}{
\index{encode.c@{encode.c}!LSEC_encodeTkr@{LSEC\_\-encodeTkr}}
\index{LSEC_encodeTkr@{LSEC\_\-encodeTkr}!encode.c@{encode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LSEC\_\-encodeTkr ({\bf LSEC\_\-compaction} $\ast$ {\em cpc}, EBF\_\-dir $\ast$ {\em dir})}}
\label{encode_8c_42bc13fdaab8a5289495d21c8e98be84}


Encode the TKR portion of the event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Compaction structure\item[{\em dir}]Pointer to a directory of the event\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of the compressed event, in 32 bit words, or 0 if there is an error \end{Desc}
\hypertarget{encode_8c_3a555ce60799cc3924a078f81dbeee65}{
\index{encode.c@{encode.c}!setBit@{setBit}}
\index{setBit@{setBit}!encode.c@{encode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void setBit (unsigned int {\em index}, unsigned int $\ast$ {\em buff})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{encode_8c_3a555ce60799cc3924a078f81dbeee65}


Set a bit in an integer buffer. 

The bits are numbered from low to high order within each integer.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]The index of the bit to be set.\item[{\em buff}]Address of the integer buffer. \end{description}
\end{Desc}
\hypertarget{encode_8c_f854e3927028bfe39c42ddbcd471e7a9}{
\index{encode.c@{encode.c}!setNib@{setNib}}
\index{setNib@{setNib}!encode.c@{encode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void setNib (unsigned int {\em value}, unsigned int {\em index}, unsigned int $\ast$ {\em buff})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{encode_8c_f854e3927028bfe39c42ddbcd471e7a9}


Set a nibble in an integer buffer. 

The bits are numbered from low to high order within each integer.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em value}]The nibble value to be set.\item[{\em index}]The index of the nibble to be set.\item[{\em buff}]Address of the integer buffer. \end{description}
\end{Desc}
