\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 $<$EFC/../src/TFC\_\-tolerancesDef.h$>$}\par
{\tt \#include $<$PBI/FFS.ih$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$math.h$>$}\par
{\tt \#include $<$EFC/../src/TFC\_\-tolerancesCfg.h$>$}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \textbf{\_\-TFC\_\-toleranceModel}
\item 
struct \textbf{\_\-TFC\_\-tolerancesCfg\_\-xy}
\item 
struct \textbf{\_\-TFC\_\-tolerancesCfg}
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{tolerances_8c_2df776bd85eb81d3197b116aa3d94e67}{
typedef struct \_\-TFC\_\-toleranceModel \textbf{TFC\_\-toleranceModel}}
\label{tolerances_8c_2df776bd85eb81d3197b116aa3d94e67}

\item 
\hypertarget{tolerances_8c_f7c1f5e84158114f3fc19c9841e9205d}{
typedef struct \_\-TFC\_\-tolerancesCfg\_\-xy \textbf{TFC\_\-tolerancesCfg\_\-xy}}
\label{tolerances_8c_f7c1f5e84158114f3fc19c9841e9205d}

\item 
\hypertarget{tolerances_8c_a8acb0ce14f9abc75e596ce70497bb24}{
typedef struct \_\-TFC\_\-tolerancesCfg \textbf{TFC\_\-tolerancesCfg}}
\label{tolerances_8c_a8acb0ce14f9abc75e596ce70497bb24}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static const TFC\_\-tolerancesCfg $\ast$ \hyperlink{tolerances_8c_fb23e85ff5feb4c20d9900eb7f1ca371}{locate\_\-cfg} (void)
\begin{CompactList}\small\item\em Return a pointer to the tolerances configuration. \item\end{CompactList}\item 
static void \hyperlink{tolerances_8c_b668134158f5e710623edafa0762f44e}{construct\_\-all} (\hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerancesAll} $\ast$all, const TFC\_\-tolerancesCfg $\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_97935f289ab6c783ec68755bdbd9f9c5}{locate\_\-tolerances} (const \hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerancesAll} $\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_fd0722a1c36a92c178d0f3b1a7a2e62f}{construct\_\-xy} (\hyperlink{struct__TFC__tolerances__xy}{TFC\_\-tolerances\_\-xy} $\ast$tolerances, const TFC\_\-tolerancesCfg\_\-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_b108d624e28149ed8e86a933117dbb2e}{get\_\-tolerance} (const TFC\_\-toleranceModel $\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_2c698fc57cc0acd9296e1f4f0fe307c7}{
static void \textbf{writeChdr} (const \hyperlink{struct__TFC__tolerancesAll}{TFC\_\-tolerancesAll} $\ast$all)}
\label{tolerances_8c_2c698fc57cc0acd9296e1f4f0fe307c7}

\item 
\hypertarget{tolerances_8c_50df75181921c5660585ebb4ec447c4a}{
static void \textbf{writeChdr\_\-energy} (FILE $\ast$f, const \hyperlink{struct__TFC__tolerances__xy}{TFC\_\-tolerances\_\-xy} $\ast$xy)}
\label{tolerances_8c_50df75181921c5660585ebb4ec447c4a}

\item 
\hypertarget{tolerances_8c_4d8d1431a4cddddc40872fbbb0ed9711}{
static void \textbf{writeChdr\_\-tolH} (FILE $\ast$f, char xy)}
\label{tolerances_8c_4d8d1431a4cddddc40872fbbb0ed9711}

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

\item 
\hypertarget{tolerances_8c_3e632e089b7bd1b037e680bc144a0681}{
static void \textbf{reportHdr} (const char $\ast$title)}
\label{tolerances_8c_3e632e089b7bd1b037e680bc144a0681}

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

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

\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.3 2011/03/31 21:54:24 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{tolerances_8c_b668134158f5e710623edafa0762f44e}{
\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 ({\bf TFC\_\-tolerancesAll} $\ast$ {\em all}, \/  const TFC\_\-tolerancesCfg $\ast$ {\em cfg})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_b668134158f5e710623edafa0762f44e}


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}


References construct\_\-xy(), \_\-TFC\_\-tolerancesAll::energy, \_\-TFC\_\-tolerancesAll::max, and \_\-TFC\_\-tolerancesAll::min.\hypertarget{tolerances_8c_fd0722a1c36a92c178d0f3b1a7a2e62f}{
\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 ({\bf TFC\_\-tolerances\_\-xy} $\ast$ {\em tolerances}, \/  const TFC\_\-tolerancesCfg\_\-xy $\ast$ {\em cfg}, \/  unsigned int {\em energy\_\-mev})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_fd0722a1c36a92c178d0f3b1a7a2e62f}


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}


References \_\-TFC\_\-tolerances\_\-xy::extend1, \_\-TFC\_\-tolerances\_\-xy::extend2, \_\-TFC\_\-tolerances\_\-xy::find, and get\_\-tolerance().

Referenced by construct\_\-all().\hypertarget{tolerances_8c_b108d624e28149ed8e86a933117dbb2e}{
\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\_\-toleranceModel $\ast$ {\em model}, \/  int {\em layer}, \/  float {\em energy})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_b108d624e28149ed8e86a933117dbb2e}


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}


Referenced by construct\_\-xy().\hypertarget{tolerances_8c_fb23e85ff5feb4c20d9900eb7f1ca371}{
\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\_\-tolerancesCfg $\ast$ locate\_\-cfg (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_fb23e85ff5feb4c20d9900eb7f1ca371}


Return a pointer to the tolerances configuration. 

\begin{Desc}
\item[Returns:]A readonly pointer to the tolerances configuration \end{Desc}
\hypertarget{tolerances_8c_97935f289ab6c783ec68755bdbd9f9c5}{
\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 {\bf TFC\_\-tolerances} $\ast$ locate\_\-tolerances (const {\bf TFC\_\-tolerancesAll} $\ast$ {\em all}, \/  unsigned int {\em energy\_\-leu})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{tolerances_8c_97935f289ab6c783ec68755bdbd9f9c5}


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}


References \_\-TFC\_\-tolerancesAll::energy, and \_\-TFC\_\-tolerancesAll::min.