\hypertarget{tolerances_8c}{
\section{tolerances.c File Reference}
\label{tolerances_8c}\index{tolerances.c@{tolerances.c}}
}
Prints the energy and layer dependent tolerances. 

{\tt \#include \char`\"{}TFC\_\-tolerances\-Def.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/FFS.h\char`\"{}}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$math.h$>$}\par
{\tt \#include \char`\"{}TFC\_\-tolerances\-Cfg.h\char`\"{}}\par


Include dependency graph for tolerances.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=133pt]{tolerances_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf \_\-TFC\_\-tolerance\-Model}
\item 
struct {\bf \_\-TFC\_\-tolerances\-Cfg\_\-xy}
\item 
struct {\bf \_\-TFC\_\-tolerances\-Cfg}
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{tolerances_8c_a0}{
typedef \_\-TFC\_\-tolerance\-Model {\bf TFC\_\-tolerance\-Model}}
\label{tolerances_8c_a0}

\item 
\hypertarget{tolerances_8c_a1}{
typedef \_\-TFC\_\-tolerances\-Cfg\_\-xy {\bf TFC\_\-tolerances\-Cfg\_\-xy}}
\label{tolerances_8c_a1}

\item 
\hypertarget{tolerances_8c_a2}{
typedef \_\-TFC\_\-tolerances\-Cfg {\bf TFC\_\-tolerances\-Cfg}}
\label{tolerances_8c_a2}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static const TFC\_\-tolerances\-Cfg $\ast$ \hyperlink{tolerances_8c_a3}{locate\_\-cfg} (void)
\begin{CompactList}\small\item\em Return a pointer to the tolerances configuration. \item\end{CompactList}\item 
static void \hyperlink{tolerances_8c_a4}{construct\_\-all} (\hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerances\-All} $\ast$all, const TFC\_\-tolerances\-Cfg $\ast$cfg)
\begin{CompactList}\small\item\em Constructs the tolerances for all X and Y layers based on the specified model. \item\end{CompactList}\item 
static const \hyperlink{struct__TFC__tolerances}{TFC\_\-tolerances} $\ast$ \hyperlink{tolerances_8c_a5}{locate\_\-tolerances} (const \hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerances\-All} $\ast$all, unsigned int energy\_\-leu)
\begin{CompactList}\small\item\em Locates the set of tolerances to use for the specified energy. \item\end{CompactList}\item 
static void \hyperlink{tolerances_8c_a6}{construct\_\-xy} (\hyperlink{struct__TFC__tolerances__xy}{TFC\_\-tolerances\_\-xy} $\ast$tolerances, const TFC\_\-tolerances\-Cfg\_\-xy $\ast$cfg, unsigned int energy\_\-leu)
\begin{CompactList}\small\item\em Construct/initializes the tolerances for either the X or Y layers. \item\end{CompactList}\item 
static unsigned int \hyperlink{tolerances_8c_a7}{get\_\-tolerance} (const TFC\_\-tolerance\-Model $\ast$model, int layer, float energy)
\begin{CompactList}\small\item\em Computes the tolerance from the model parameters for the given layer. \item\end{CompactList}\item 
\hypertarget{tolerances_8c_a8}{
static void {\bf write\-Chdr} (const \hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerances\-All} $\ast$all)}
\label{tolerances_8c_a8}

\item 
\hypertarget{tolerances_8c_a9}{
static void {\bf write\-Chdr\_\-energy} (FILE $\ast$f, const \hyperlink{struct__TFC__tolerances__xy}{TFC\_\-tolerances\_\-xy} $\ast$xy)}
\label{tolerances_8c_a9}

\item 
\hypertarget{tolerances_8c_a10}{
static void {\bf write\-Chdr\_\-tol\-H} (FILE $\ast$f, char xy)}
\label{tolerances_8c_a10}

\item 
\hypertarget{tolerances_8c_a11}{
static void {\bf write\-Chdr\_\-tol} (FILE $\ast$f, int which, const unsigned char tols\mbox{[}18\mbox{]})}
\label{tolerances_8c_a11}

\item 
\hypertarget{tolerances_8c_a12}{
static void {\bf report\-Hdr} (const char $\ast$title)}
\label{tolerances_8c_a12}

\item 
\hypertarget{tolerances_8c_a13}{
static void {\bf report} (unsigned int mev, const unsigned char x\mbox{[}18\mbox{]}, const unsigned char y\mbox{[}18\mbox{]})}
\label{tolerances_8c_a13}

\item 
\hypertarget{tolerances_8c_a14}{
int {\bf main} (int argc, const char $\ast$const argv\mbox{[}$\,$\mbox{]})}
\label{tolerances_8c_a14}

\end{CompactItemize}


\subsection{Detailed Description}
Prints the energy and layer dependent tolerances. 

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


\footnotesize\begin{verbatim}   CVS $Id: tolerances.c,v 1.1 2007/06/17 21:55:00 russell Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{tolerances_8c_a4}{
\index{tolerances.c@{tolerances.c}!construct_all@{construct\_\-all}}
\index{construct_all@{construct\_\-all}!tolerances.c@{tolerances.c}}
\subsubsection[construct\_\-all]{\setlength{\rightskip}{0pt plus 5cm}static void construct\_\-all (\hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerances\-All} $\ast$ {\em all}, const TFC\_\-tolerances\-Cfg $\ast$ {\em cfg})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_a4}


Constructs the tolerances for all X and Y layers based on the specified model. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em all}]The tolerances to initialize \item[{\em cfg}]The configuration parameters of the model\end{description}
\end{Desc}
\hypertarget{tolerances_8c_a6}{
\index{tolerances.c@{tolerances.c}!construct_xy@{construct\_\-xy}}
\index{construct_xy@{construct\_\-xy}!tolerances.c@{tolerances.c}}
\subsubsection[construct\_\-xy]{\setlength{\rightskip}{0pt plus 5cm}static void construct\_\-xy (\hyperlink{struct__TFC__tolerances__xy}{TFC\_\-tolerances\_\-xy} $\ast$ {\em tolerances}, const TFC\_\-tolerances\-Cfg\_\-xy $\ast$ {\em cfg}, unsigned int {\em energy\_\-mev})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_a6}


Construct/initializes the tolerances for either the X or Y layers. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tolerances}]The set of tolerances to initialize \item[{\em cfg}]The model parameters \item[{\em energy\_\-mev}]The energy of the event in Mev\end{description}
\end{Desc}
\hypertarget{tolerances_8c_a7}{
\index{tolerances.c@{tolerances.c}!get_tolerance@{get\_\-tolerance}}
\index{get_tolerance@{get\_\-tolerance}!tolerances.c@{tolerances.c}}
\subsubsection[get\_\-tolerance]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int get\_\-tolerance (const TFC\_\-tolerance\-Model $\ast$ {\em model}, int {\em layer}, float {\em energy})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_a7}


Computes the tolerance from the model parameters for the given layer. 

\begin{Desc}
\item[Returns:]The tolerance, in whole units of strip widths\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em model}]The model parameters \item[{\em layer}]The layer number \item[{\em energy}]The energy in Mev\end{description}
\end{Desc}
\hypertarget{tolerances_8c_a3}{
\index{tolerances.c@{tolerances.c}!locate_cfg@{locate\_\-cfg}}
\index{locate_cfg@{locate\_\-cfg}!tolerances.c@{tolerances.c}}
\subsubsection[locate\_\-cfg]{\setlength{\rightskip}{0pt plus 5cm}const TFC\_\-tolerances\-Cfg $\ast$ locate\_\-cfg (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_a3}


Return a pointer to the tolerances configuration. 

\begin{Desc}
\item[Returns:]A readonly pointer to the tolerances configuration\end{Desc}
\hypertarget{tolerances_8c_a5}{
\index{tolerances.c@{tolerances.c}!locate_tolerances@{locate\_\-tolerances}}
\index{locate_tolerances@{locate\_\-tolerances}!tolerances.c@{tolerances.c}}
\subsubsection[locate\_\-tolerances]{\setlength{\rightskip}{0pt plus 5cm}static const \hyperlink{struct__TFC__tolerances}{TFC\_\-tolerances} $\ast$ locate\_\-tolerances (const \hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerances\-All} $\ast$ {\em all}, unsigned int {\em energy\_\-leu})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_a5}


Locates the set of tolerances to use for the specified energy. 

\begin{Desc}
\item[Returns:]A read-only pointer to the energies\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em all}]The set of all tolerances \item[{\em energy\_\-leu}]The energy in LEUs\end{description}
\end{Desc}
