\hypertarget{compact_8c}{
\section{compact.c File Reference}
\label{compact_8c}\index{compact.c@{compact.c}}
}
Compaction implementation. 

{\tt \#include \char`\"{}LSEC/LSEC\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC/LSEC\_\-ctx.h\char`\"{}}\par
{\tt \#include \char`\"{}compact\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}encode.h\char`\"{}}\par
{\tt \#include \char`\"{}compress.ic\char`\"{}}\par
{\tt \#include \char`\"{}acdraw.h\char`\"{}}\par
{\tt \#include \char`\"{}gemraw.h\char`\"{}}\par
{\tt \#include \char`\"{}LDT/APE.h\char`\"{}}\par
{\tt \#include \char`\"{}LDT/APD.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-siv.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-cid.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-cal.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/FFS.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/WCT.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$math.h$>$}\par


Include dependency graph for compact.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=187pt]{compact_8c__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{compact_8c_a0}{\_\-printf}(msg, format, args...)
\begin{CompactList}\small\item\em Provide printf-like functionality using MSG information message. \item\end{CompactList}\item 
\#define \hyperlink{compact_8c_a1}{CHECK\_\-CALL}(FUNC)
\begin{CompactList}\small\item\em Call a function and check the return value. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \{ {\bf PRINTSIZE} =  256
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ \hyperlink{compact_8c_a3}{LSEC\_\-new\-Compaction} (unsigned cap)
\begin{CompactList}\small\item\em Allocate memory for an LSEC\_\-compaction structure and all the substructures. \item\end{CompactList}\item 
void \hyperlink{compact_8c_a4}{LSEC\_\-delete\-Compaction} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Free memory previously allocated with a call to LSEC\_\-new\-Compaction. \item\end{CompactList}\item 
void \hyperlink{compact_8c_a5}{LSEC\_\-clear\-Compaction} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Clear away any context from a previous cycle. \item\end{CompactList}\item 
void \hyperlink{compact_8c_a6}{LSEC\_\-report\-Compaction} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, FILE $\ast$fp)
\begin{CompactList}\small\item\em Write formatted ASCII output to a file. \item\end{CompactList}\item 
void \hyperlink{compact_8c_a7}{LSEC\_\-set\-Mode} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned mode)
\begin{CompactList}\small\item\em Set the calibration mode. \item\end{CompactList}\item 
void \hyperlink{compact_8c_a8}{LSEC\_\-set\-Four\-Range} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned range)
\begin{CompactList}\small\item\em Set the four-range value. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a9}{LSEC\_\-check\-Compaction} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Check the substructures for errors. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a10}{LSEC\_\-monitor\-Compaction} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned mon)
\begin{CompactList}\small\item\em Set the monitoring level for the compaction. \item\end{CompactList}\item 
unsigned int \hyperlink{compact_8c_a11}{sizeof\-User\-Gem} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Calculate the number of 32-bit words required to hold the tables against which the GEM contributions will be encoded. \item\end{CompactList}\item 
static unsigned int \hyperlink{compact_8c_a12}{sizeof\-User\-Acd} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Calculate the number of 32-bit words required to hold the tables against which the ACD contributions will be encoded. \item\end{CompactList}\item 
static unsigned int \hyperlink{compact_8c_a13}{sizeof\-User\-Cal} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Calculate the number of 32-bit words required to hold the tables against which the CAL contributions will be encoded. \item\end{CompactList}\item 
static unsigned int \hyperlink{compact_8c_a14}{sizeof\-User\-Tkr} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Calculate the number of 32-bit words required to hold the tables against which the TKR contributions will be encoded. \item\end{CompactList}\item 
unsigned int $\ast$ \hyperlink{compact_8c_a15}{consign\-User\-Gem} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Pack the tables against which the GEM contributions will be encoded into the buffer. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{compact_8c_a16}{consign\-User\-Acd} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Pack the tables against which the ACD contributions will be encoded into the buffer. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{compact_8c_a17}{consign\-User\-Cal} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Pack the tables against which the CAL contributions will be encoded into the buffer. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{compact_8c_a18}{consign\-User\-Tkr} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Pack the tables against which the TKR contributions will be encoded into the buffer. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a19}{process\-Gem} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Process the GEM compression structure. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a20}{LSEC\_\-process\-Acd} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Process ACD compaction data. \item\end{CompactList}\item 
void \hyperlink{compact_8c_a21}{LSEC\_\-calculate\-Cal\-Means} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Calculate the mean value for each CAL log end. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a22}{LSEC\_\-process\-Cal\-Means} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Process the mean values for each CAL log end. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a23}{LSEC\_\-process\-Cal} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Process the CAL compression structures. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a24}{LSEC\_\-process\-Tkr} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Process the TKR compression structures. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a25}{LSEC\_\-encode} (\hyperlink{structLSEC__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 $\ast$ \hyperlink{compact_8c_a26}{LSEC\_\-consign\-Evt} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Copy a single encoded event into the datagram. \item\end{CompactList}\item 
unsigned \hyperlink{compact_8c_a27}{LSEC\_\-sizeof\-User32} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc)
\begin{CompactList}\small\item\em Calculate the number of 32-bit words required to hold tables against which the events will be encoded. \item\end{CompactList}\item 
unsigned int $\ast$ \hyperlink{compact_8c_a28}{LSEC\_\-consign\-User} (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$cpc, unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Pack the tables against which the events will be encoded into the buffer. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Compaction implementation. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{compact_8c}{compact.c},v 1.11 2007/06/13 17:15:22 saxton Exp \end{Desc}


\subsection{Define Documentation}
\hypertarget{compact_8c_a0}{
\index{compact.c@{compact.c}!_printf@{\_\-printf}}
\index{_printf@{\_\-printf}!compact.c@{compact.c}}
\subsubsection[\_\-printf]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-printf(msg, format, args...)}}
\label{compact_8c_a0}


{\bf Value:}

\footnotesize\begin{verbatim}{ \
   char buffer[PRINTSIZE];\
   sprintf(buffer, format, ## args); \
   _msg_report(msg, 0, 1, buffer); \
 }
\end{verbatim}\normalsize 
Provide printf-like functionality using MSG information message. 

\hypertarget{compact_8c_a1}{
\index{compact.c@{compact.c}!CHECK_CALL@{CHECK\_\-CALL}}
\index{CHECK_CALL@{CHECK\_\-CALL}!compact.c@{compact.c}}
\subsubsection[CHECK\_\-CALL]{\setlength{\rightskip}{0pt plus 5cm}\#define CHECK\_\-CALL(FUNC)}}
\label{compact_8c_a1}


{\bf Value:}

\footnotesize\begin{verbatim}{ \
  unsigned status = FUNC;\
  if (_msg_failure(status)) return status;\
}
\end{verbatim}\normalsize 
Call a function and check the return value. 



\subsection{Function Documentation}
\hypertarget{compact_8c_a16}{
\index{compact.c@{compact.c}!consignUserAcd@{consignUserAcd}}
\index{consignUserAcd@{consignUserAcd}!compact.c@{compact.c}}
\subsubsection[consignUserAcd]{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ consign\-User\-Acd (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned int $\ast$ {\em buf})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{compact_8c_a16}


Pack the tables against which the ACD contributions will be encoded into the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]Pointer to the buffer where the context should be placed\item[{\em cpc}]Pointer to the structure containing the tables (a compaction)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location to be filled.\end{Desc}
\hypertarget{compact_8c_a17}{
\index{compact.c@{compact.c}!consignUserCal@{consignUserCal}}
\index{consignUserCal@{consignUserCal}!compact.c@{compact.c}}
\subsubsection[consignUserCal]{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ consign\-User\-Cal (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned int $\ast$ {\em buf})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{compact_8c_a17}


Pack the tables against which the CAL contributions will be encoded into the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]Pointer to the buffer where the context should be placed.\item[{\em cpc}]Pointer to the structure containing the tables (a compaction)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location to be filled.\end{Desc}
\hypertarget{compact_8c_a15}{
\index{compact.c@{compact.c}!consignUserGem@{consignUserGem}}
\index{consignUserGem@{consignUserGem}!compact.c@{compact.c}}
\subsubsection[consignUserGem]{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ consign\-User\-Gem (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned int $\ast$ {\em buf})}}
\label{compact_8c_a15}


Pack the tables against which the GEM contributions will be encoded into the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]Pointer to the buffer where the context should be placed.\item[{\em cpc}]Pointer to the structure containing the tables (a compaction)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location to be filled.\end{Desc}
\hypertarget{compact_8c_a18}{
\index{compact.c@{compact.c}!consignUserTkr@{consignUserTkr}}
\index{consignUserTkr@{consignUserTkr}!compact.c@{compact.c}}
\subsubsection[consignUserTkr]{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ consign\-User\-Tkr (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned int $\ast$ {\em buf})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{compact_8c_a18}


Pack the tables against which the TKR contributions will be encoded into the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]Pointer to the buffer where the context should be placed.\item[{\em cpc}]Pointer to the structure containing the tables (a compaction)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location to be filled.\end{Desc}
\hypertarget{compact_8c_a21}{
\index{compact.c@{compact.c}!LSEC_calculateCalMeans@{LSEC\_\-calculateCalMeans}}
\index{LSEC_calculateCalMeans@{LSEC\_\-calculateCalMeans}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-calculateCalMeans]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-calculate\-Cal\-Means (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a21}


Calculate the mean value for each CAL log end. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\end{description}
\end{Desc}
\hypertarget{compact_8c_a9}{
\index{compact.c@{compact.c}!LSEC_checkCompaction@{LSEC\_\-checkCompaction}}
\index{LSEC_checkCompaction@{LSEC\_\-checkCompaction}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-checkCompaction]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-check\-Compaction (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a9}


Check the substructures for errors. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to a compaction object\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The last error from the first substrcture to be found in error or LSEC\_\-SUCCESS if there are no errors.\end{Desc}
\hypertarget{compact_8c_a5}{
\index{compact.c@{compact.c}!LSEC_clearCompaction@{LSEC\_\-clearCompaction}}
\index{LSEC_clearCompaction@{LSEC\_\-clearCompaction}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-clearCompaction]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-clear\-Compaction (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a5}


Clear away any context from a previous cycle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to a compaction object\end{description}
\end{Desc}
\hypertarget{compact_8c_a26}{
\index{compact.c@{compact.c}!LSEC_consignEvt@{LSEC\_\-consignEvt}}
\index{LSEC_consignEvt@{LSEC\_\-consignEvt}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-consignEvt]{\setlength{\rightskip}{0pt plus 5cm}unsigned int$\ast$ LSEC\_\-consign\-Evt (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned int $\ast$ {\em buf})}}
\label{compact_8c_a26}


Copy a single encoded event into the datagram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to the compaction structure holding the encoded event\item[{\em buf}]Pointer to the location to place the encoded event\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location\end{Desc}
\hypertarget{compact_8c_a28}{
\index{compact.c@{compact.c}!LSEC_consignUser@{LSEC\_\-consignUser}}
\index{LSEC_consignUser@{LSEC\_\-consignUser}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-consignUser]{\setlength{\rightskip}{0pt plus 5cm}unsigned int$\ast$ LSEC\_\-consign\-User (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned int $\ast$ {\em buf})}}
\label{compact_8c_a28}


Pack the tables against which the events will be encoded into the buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]Pointer to the buffer where the context should be placed.\item[{\em cpc}]Pointer to the structure containing the tables (a compaction)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location to be filled.\end{Desc}
\hypertarget{compact_8c_a4}{
\index{compact.c@{compact.c}!LSEC_deleteCompaction@{LSEC\_\-deleteCompaction}}
\index{LSEC_deleteCompaction@{LSEC\_\-deleteCompaction}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-deleteCompaction]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-delete\-Compaction (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a4}


Free memory previously allocated with a call to LSEC\_\-new\-Compaction. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to a compaction structure previously created by a call to LSEC\_\-new\-Compaction\end{description}
\end{Desc}
\hypertarget{compact_8c_a25}{
\index{compact.c@{compact.c}!LSEC_encode@{LSEC\_\-encode}}
\index{LSEC_encode@{LSEC\_\-encode}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-encode]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-encode (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, EBF\_\-dir $\ast$ {\em dir})}}
\label{compact_8c_a25}


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{compact_8c_a10}{
\index{compact.c@{compact.c}!LSEC_monitorCompaction@{LSEC\_\-monitorCompaction}}
\index{LSEC_monitorCompaction@{LSEC\_\-monitorCompaction}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-monitorCompaction]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-monitor\-Compaction (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned {\em mon})}}
\label{compact_8c_a10}


Set the monitoring level for the compaction. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an initialised compaction\item[{\em mon}]Monitoring level to set\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The previous monitoring level.\end{Desc}
\hypertarget{compact_8c_a3}{
\index{compact.c@{compact.c}!LSEC_newCompaction@{LSEC\_\-newCompaction}}
\index{LSEC_newCompaction@{LSEC\_\-newCompaction}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-newCompaction]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction}$\ast$ LSEC\_\-new\-Compaction (unsigned {\em cap})}}
\label{compact_8c_a3}


Allocate memory for an LSEC\_\-compaction structure and all the substructures. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cap}]Capacity of the calibration task, the maximum number of events that can be collected each cycle\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an allocated, initialise, LSEC\_\-compaction structure\end{Desc}
\hypertarget{compact_8c_a20}{
\index{compact.c@{compact.c}!LSEC_processAcd@{LSEC\_\-processAcd}}
\index{LSEC_processAcd@{LSEC\_\-processAcd}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-processAcd]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-process\-Acd (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a20}


Process ACD compaction data. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\end{description}
\end{Desc}
\hypertarget{compact_8c_a23}{
\index{compact.c@{compact.c}!LSEC_processCal@{LSEC\_\-processCal}}
\index{LSEC_processCal@{LSEC\_\-processCal}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-processCal]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-process\-Cal (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a23}


Process the CAL compression structures. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\end{description}
\end{Desc}
\hypertarget{compact_8c_a22}{
\index{compact.c@{compact.c}!LSEC_processCalMeans@{LSEC\_\-processCalMeans}}
\index{LSEC_processCalMeans@{LSEC\_\-processCalMeans}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-processCalMeans]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-process\-Cal\-Means (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a22}


Process the mean values for each CAL log end. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of the calorimeter log context.\end{Desc}
\hypertarget{compact_8c_a24}{
\index{compact.c@{compact.c}!LSEC_processTkr@{LSEC\_\-processTkr}}
\index{LSEC_processTkr@{LSEC\_\-processTkr}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-processTkr]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-process\-Tkr (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a24}


Process the TKR compression structures. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\end{description}
\end{Desc}
\hypertarget{compact_8c_a6}{
\index{compact.c@{compact.c}!LSEC_reportCompaction@{LSEC\_\-reportCompaction}}
\index{LSEC_reportCompaction@{LSEC\_\-reportCompaction}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-reportCompaction]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-report\-Compaction (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, FILE $\ast$ {\em fp})}}
\label{compact_8c_a6}


Write formatted ASCII output to a file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to a compaction object\item[{\em fp}]Pointer to the destination file\end{description}
\end{Desc}
\hypertarget{compact_8c_a8}{
\index{compact.c@{compact.c}!LSEC_setFourRange@{LSEC\_\-setFourRange}}
\index{LSEC_setFourRange@{LSEC\_\-setFourRange}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-setFourRange]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-set\-Four\-Range (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned {\em range})}}
\label{compact_8c_a8}


Set the four-range value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to a compaction structure\item[{\em range}]Flag indicating 4-range or auto-range\end{description}
\end{Desc}
\hypertarget{compact_8c_a7}{
\index{compact.c@{compact.c}!LSEC_setMode@{LSEC\_\-setMode}}
\index{LSEC_setMode@{LSEC\_\-setMode}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-setMode]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-set\-Mode (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc}, unsigned {\em mode})}}
\label{compact_8c_a7}


Set the calibration mode. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to a compaction structure\item[{\em mode}]The calibration mode\end{description}
\end{Desc}
\hypertarget{compact_8c_a27}{
\index{compact.c@{compact.c}!LSEC_sizeofUser32@{LSEC\_\-sizeofUser32}}
\index{LSEC_sizeofUser32@{LSEC\_\-sizeofUser32}!compact.c@{compact.c}}
\subsubsection[LSEC\_\-sizeofUser32]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-sizeof\-User32 (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a27}


Calculate the number of 32-bit words required to hold tables against which the events will be encoded. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to the compaction structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of 32-bit words required to hold the context information\end{Desc}
\hypertarget{compact_8c_a19}{
\index{compact.c@{compact.c}!processGem@{processGem}}
\index{processGem@{processGem}!compact.c@{compact.c}}
\subsubsection[processGem]{\setlength{\rightskip}{0pt plus 5cm}unsigned process\-Gem (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a19}


Process the GEM compression structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to an LSEC\_\-compaction structure\end{description}
\end{Desc}
\hypertarget{compact_8c_a12}{
\index{compact.c@{compact.c}!sizeofUserAcd@{sizeofUserAcd}}
\index{sizeofUserAcd@{sizeofUserAcd}!compact.c@{compact.c}}
\subsubsection[sizeofUserAcd]{\setlength{\rightskip}{0pt plus 5cm}unsigned sizeof\-User\-Acd (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{compact_8c_a12}


Calculate the number of 32-bit words required to hold the tables against which the ACD contributions will be encoded. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to the compaction structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of 32-bit words required to hold the packed tables used to encode the ACD contribution\end{Desc}
\hypertarget{compact_8c_a13}{
\index{compact.c@{compact.c}!sizeofUserCal@{sizeofUserCal}}
\index{sizeofUserCal@{sizeofUserCal}!compact.c@{compact.c}}
\subsubsection[sizeofUserCal]{\setlength{\rightskip}{0pt plus 5cm}unsigned sizeof\-User\-Cal (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{compact_8c_a13}


Calculate the number of 32-bit words required to hold the tables against which the CAL contributions will be encoded. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to the compaction structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of 32-bit words required to hold the packed tables used to encode the CAL contribution\end{Desc}
\hypertarget{compact_8c_a11}{
\index{compact.c@{compact.c}!sizeofUserGem@{sizeofUserGem}}
\index{sizeofUserGem@{sizeofUserGem}!compact.c@{compact.c}}
\subsubsection[sizeofUserGem]{\setlength{\rightskip}{0pt plus 5cm}unsigned sizeof\-User\-Gem (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})}}
\label{compact_8c_a11}


Calculate the number of 32-bit words required to hold the tables against which the GEM contributions will be encoded. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to the compaction structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of 32-bit words required to hold the packed tables used to encode the GEM contribution\end{Desc}
\hypertarget{compact_8c_a14}{
\index{compact.c@{compact.c}!sizeofUserTkr@{sizeofUserTkr}}
\index{sizeofUserTkr@{sizeofUserTkr}!compact.c@{compact.c}}
\subsubsection[sizeofUserTkr]{\setlength{\rightskip}{0pt plus 5cm}unsigned sizeof\-User\-Tkr (\hyperlink{structLSEC__compaction__}{LSEC\_\-compaction} $\ast$ {\em cpc})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{compact_8c_a14}


Calculate the number of 32-bit words required to hold the tables against which the TKR contributions will be encoded. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cpc}]Pointer to the compaction structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of 32-bit words required to hold the packed tables used to encode the TKR contribution\end{Desc}
