\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 $<$compact.h$>$}\par
{\tt \#include $<$compress.ic$>$}\par
{\tt \#include $<$LSEC\_\-p.h$>$}\par
{\tt \#include $<$LSEC/LSEC\_\-msgs.h$>$}\par
{\tt \#include $<$LDT/HDE.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-cal.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-cid.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-tem.h$>$}\par
{\tt \#include $<$EDS/EBF\_\-tkr.h$>$}\par
{\tt \#include $<$LCBD/LATP.h$>$}\par
{\tt \#include $<$PBS/WCT.h$>$}\par
{\tt \#include $<$PBI/PTR.h$>$}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int $\ast$ \hyperlink{encode_8c_5737bcff0a9c8ead861e302f78bea02a}{LSEC\_\-encodeCal} (\hyperlink{struct__LSEC__compaction}{LSEC\_\-compaction} $\ast$cpc, const \hyperlink{struct__LSEC__calEvent}{LSEC\_\-calEvent} $\ast$event, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Encode the CAL portion of the event. \item\end{CompactList}\item 
unsigned int $\ast$ \hyperlink{encode_8c_49632142d2e1f78daf2a66a728bf20a0}{LSEC\_\-encodeTkr} (\hyperlink{struct__LSEC__compaction}{LSEC\_\-compaction} $\ast$cpc, const EBF\_\-dir $\ast$dir, unsigned int $\ast$buf)
\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.16 2011/03/27 17:46:42 saxton Exp \$ 

\subsection{Function Documentation}
\hypertarget{encode_8c_5737bcff0a9c8ead861e302f78bea02a}{
\index{encode.c@{encode.c}!LSEC\_\-encodeCal@{LSEC\_\-encodeCal}}
\index{LSEC\_\-encodeCal@{LSEC\_\-encodeCal}!encode.c@{encode.c}}
\subsubsection[{LSEC\_\-encodeCal}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int$\ast$ LSEC\_\-encodeCal ({\bf LSEC\_\-compaction} $\ast$ {\em cpc}, \/  const {\bf LSEC\_\-calEvent} $\ast$ {\em event}, \/  unsigned int $\ast$ {\em buf})}}
\label{encode_8c_5737bcff0a9c8ead861e302f78bea02a}


Encode the CAL portion of the event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Compaction structure\item[{\em event}]Pointer to the saved event\item[{\em buf}]Pointer to the buffer receiving the encoded data\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Address of the word after the encoded data \end{Desc}


References \_\-LSEC\_\-compaction::cal, \_\-LSEC\_\-calEvent::dgnMap, \_\-LSEC\_\-calEvent::diag, FR\_\-LENG, \_\-LSEC\_\-calEvent::frstRng, \_\-LSEC\_\-calEvent::gem, getBit(), getNib(), LM\_\-LENG, \_\-LSEC\_\-calEvent::logMap, LSEC\_\-calCompaction::logs, LSEC\_\-CAL\_\-M\_\-END, LSEC\_\-CAL\_\-P\_\-END, LSEC\_\-compressH(), LSEC\_\-N\_\-CAL\_\-COL, LSEC\_\-N\_\-CAL\_\-LAY, LSEC\_\-N\_\-TWR, \_\-LSEC\_\-calEvent::size, and \_\-LSEC\_\-calEvent::twrMap.\hypertarget{encode_8c_49632142d2e1f78daf2a66a728bf20a0}{
\index{encode.c@{encode.c}!LSEC\_\-encodeTkr@{LSEC\_\-encodeTkr}}
\index{LSEC\_\-encodeTkr@{LSEC\_\-encodeTkr}!encode.c@{encode.c}}
\subsubsection[{LSEC\_\-encodeTkr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int$\ast$ LSEC\_\-encodeTkr ({\bf LSEC\_\-compaction} $\ast$ {\em cpc}, \/  const EBF\_\-dir $\ast$ {\em dir}, \/  unsigned int $\ast$ {\em buf})}}
\label{encode_8c_49632142d2e1f78daf2a66a728bf20a0}


Encode the TKR portion of the event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Compaction structure\item[{\em dir}]Pointer to the event directory\item[{\em buf}]Pointer to the buffer receiving the encoded data\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Address of the word after the encoded data \end{Desc}


References LSEC\_\-tkr::channel, \_\-LSEC\_\-compaction::ctx, LSEC\_\-channel::flags, LSEC\_\-N\_\-TKR\_\-CC, LSEC\_\-N\_\-TKR\_\-CHNL, LSEC\_\-N\_\-TKR\_\-FE, LSEC\_\-N\_\-TKR\_\-RC, LSEC\_\-N\_\-TWR, LSEC\_\-channel::number, LSEC\_\-ctx::specific, and LSEC\_\-specific::tkr.