\section{Marlin\-Trk Namespace Reference}
\label{namespaceMarlinTrk}\index{Marlin\-Trk@{Marlin\-Trk}}


Created by Steve Aplin on 9/16/11.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class {\bf Config\-Flags}
\item 
class {\bf Factory}
\begin{DoxyCompactList}\small\item\em \doxyref{Factory}{p.}{classMarlinTrk_1_1Factory} methods for creating the Marlin\-Trk\-System of a certain type\-: Kal\-Test, D\-D\-Kal\-Test, aida\-T\-T,...\par
 Currently implemented\-: Kal\-Test, D\-D\-Kal\-Test. \end{DoxyCompactList}\item 
class {\bf Helix\-Fit}
\item 
class {\bf I\-Marlin\-Track}
\begin{DoxyCompactList}\small\item\em Interface for generic tracks in \doxyref{Marlin\-Trk}{p.}{namespaceMarlinTrk}. \end{DoxyCompactList}\item 
class {\bf Exception}
\begin{DoxyCompactList}\small\item\em \doxyref{Exception}{p.}{classMarlinTrk_1_1Exception} thrown in I\-Marlin\-Trk namespace (implemetations of \doxyref{I\-Marlin\-Trk\-System}{p.}{classMarlinTrk_1_1IMarlinTrkSystem} and \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack}). \end{DoxyCompactList}\item 
class {\bf I\-Marlin\-Trk\-System}
\begin{DoxyCompactList}\small\item\em Base class for tracking system implementations in \doxyref{Marlin\-Trk}{p.}{namespaceMarlinTrk}. \end{DoxyCompactList}\item 
class {\bf Marlin\-Aida\-T\-T}
\begin{DoxyCompactList}\small\item\em Interface to Kalt\-Test Kalman fitter -\/ instantiates and holds the detector geometry. \end{DoxyCompactList}\item 
class {\bf Marlin\-Aida\-T\-T\-Track}
\item 
class {\bf Marlin\-D\-D\-Kal\-Test}
\begin{DoxyCompactList}\small\item\em Interface to Kalt\-Test Kalman fitter -\/ instantiates and holds the detector geometry. \end{DoxyCompactList}\item 
class {\bf Marlin\-D\-D\-Kal\-Test\-Track}
\item 
class {\bf Marlin\-Kal\-Test}
\begin{DoxyCompactList}\small\item\em Interface to Kalt\-Test Kalman fitter -\/ instantiates and holds the detector geometry. \end{DoxyCompactList}\item 
class {\bf Marlin\-Kal\-Test\-Track}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef std\-::multimap$<$ long, \\*
const aida\-T\-T\-::\-I\-Surface $\ast$ $>$ {\bfseries Surf\-Map}\label{namespaceMarlinTrk_a22327930216ca5b29661c2e619779103}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
std\-::ostream \& {\bfseries operator$<$$<$} (std\-::ostream \&os, const {\bf Config\-Flags} \&cf)\label{namespaceMarlinTrk_a382e05423b2edebc86f793a5ec76694a}

\item 
std\-::string {\bf error\-Code} (int error)\label{namespaceMarlinTrk_aaf290c64dc2cd148a48bb236878922ad}

\begin{DoxyCompactList}\small\item\em Helper function to convert error return code to string. \end{DoxyCompactList}\item 
int {\bf create\-Finalised\-L\-C\-I\-O\-Track} ({\bf I\-Marlin\-Track} $\ast$marlin\-Trk, std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&hit\-\_\-list, I\-M\-P\-L\-::\-Track\-Impl $\ast$track, bool fit\-\_\-direction, E\-V\-E\-N\-T\-::\-Track\-State $\ast$pre\-\_\-fit, float bfield\-\_\-z, double max\-Chi2\-Increment=D\-B\-L\-\_\-\-M\-A\-X)
\begin{DoxyCompactList}\small\item\em Takes a list of hits and uses the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} inferface to fit them using a supplied prefit containing a covariance matrix for the initialisation. \end{DoxyCompactList}\item 
int {\bf create\-Finalised\-L\-C\-I\-O\-Track} ({\bf I\-Marlin\-Track} $\ast$marlin\-Trk, std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&hit\-\_\-list, I\-M\-P\-L\-::\-Track\-Impl $\ast$track, bool fit\-\_\-direction, const E\-V\-E\-N\-T\-::\-Float\-Vec \&initial\-\_\-cov\-\_\-for\-\_\-prefit, float bfield\-\_\-z, double max\-Chi2\-Increment=D\-B\-L\-\_\-\-M\-A\-X)
\begin{DoxyCompactList}\small\item\em Takes a list of hits and uses the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} inferface to fit them using a supplied covariance matrix for the initialisation. \end{DoxyCompactList}\item 
int {\bf create\-Prefit} (std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&hit\-\_\-list, I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$pre\-\_\-fit, float bfield\-\_\-z, bool fit\-\_\-direction)
\begin{DoxyCompactList}\small\item\em Provides the values of a track state from the first, middle and last hits in the hit\-\_\-list. \end{DoxyCompactList}\item 
int {\bf create\-Fit} (std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&hit\-\_\-list, {\bf I\-Marlin\-Track} $\ast$marlin\-Trk, E\-V\-E\-N\-T\-::\-Track\-State $\ast$pre\-\_\-fit, float bfield\-\_\-z, bool fit\-\_\-direction, double max\-Chi2\-Increment=D\-B\-L\-\_\-\-M\-A\-X)
\begin{DoxyCompactList}\small\item\em Takes a list of hits and uses the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} inferface to fit them using a supplied prefit containing a covariance matrix for the initialisation. \end{DoxyCompactList}\item 
int {\bf finalise\-L\-C\-I\-O\-Track} ({\bf I\-Marlin\-Track} $\ast$marlin\-Trk, I\-M\-P\-L\-::\-Track\-Impl $\ast$track, std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&hit\-\_\-list, bool fit\-\_\-direction, I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$at\-Last\-Hit=0, I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$at\-Calo\-Face=0)
\begin{DoxyCompactList}\small\item\em Takes a fitted Marlin\-Track, Track\-Impl to record the fit and the hits which have been added to the fit. \end{DoxyCompactList}\item 
void {\bf add\-Hit\-Numbers\-To\-Track} (I\-M\-P\-L\-::\-Track\-Impl $\ast$track, std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&hit\-\_\-list, bool hits\-\_\-in\-\_\-fit, U\-T\-I\-L\-::\-Bit\-Field64 \&cell\-I\-D\-\_\-encoder)\label{namespaceMarlinTrk_a03ec46036276ebc9a385fe1c60f91835}

\begin{DoxyCompactList}\small\item\em Set the subdetector hit numbers for the Track\-Impl. \end{DoxyCompactList}\item 
void {\bf add\-Hit\-Numbers\-To\-Track} (I\-M\-P\-L\-::\-Track\-Impl $\ast$track, std\-::vector$<$ std\-::pair$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$, double $>$ $>$ \&hit\-\_\-list, bool hits\-\_\-in\-\_\-fit, U\-T\-I\-L\-::\-Bit\-Field64 \&cell\-I\-D\-\_\-encoder)\label{namespaceMarlinTrk_a6a0bc688c060c8ada98b4e45323d1103}

\begin{DoxyCompactList}\small\item\em Set the subdetector hit numbers for the Track\-Impl. \end{DoxyCompactList}\item 
std\-::string {\bfseries cell\-I\-D\-String} (int det\-Element\-I\-D)\label{namespaceMarlinTrk_ad2e761c17a5fea9ec232b9fd17d2908d}

\item 
std\-::string {\bfseries decode\-I\-L\-D} (int det\-Element\-I\-D)\label{namespaceMarlinTrk_a97deb7d5a8a470847144cabb13270ea9}

\item 
int {\bfseries create\-Track\-State\-At\-Calo\-Face} ({\bf I\-Marlin\-Track} $\ast$marlin\-Trk, I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$track, E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$trkhit, bool tan\-L\-\_\-is\-\_\-positive)\label{namespaceMarlinTrk_a9272b021d53ec7d5ff79580816233735}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Created by Steve Aplin on 9/16/11. Implementation of the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} interface, using Kal\-Test and Kal\-Det to provide the needed functionality for a Kalman Filter.

D\-E\-S\-Y

C++ rewrite of the aleph Fortran routine T\-F\-I\-T\-H\-L

! Fast helix fit

Input\-: N\-P\-T Number of 3-\/\-D points to be fit xf Array of X-\/values of points to be fit yf Array of Y-\/values of points to be fit zf Array of Z-\/values of points to be fit wf Array of 1/(sig(rphi))$\ast$$\ast$2 for each point wzf Array of 1/(sig(z))$\ast$$\ast$2 for each point iopt $<$ 3 \-: error matrix calculated = 3 \-: 3-\/dimensional iteration

O\-U\-T\-P\-U\-T\-: vv0 = Helix parameter in perigee form ee0 = I\-N\-V\-E\-R\-S\-E O\-F E\-R\-R\-O\-R M\-A\-T\-R\-I\-X I\-N T\-R\-I\-A\-N\-G. F\-O\-R\-M chi2ph = C\-H\-I S\-Q\-U\-A\-R\-E\-D = S\-U\-M (P\-H\-I D\-E\-V\-I\-A\-T\-I\-O\-N\-S/\-E\-R\-R\-O\-R\-S)$\ast$$\ast$2 C\-H2\-Z = C\-H\-I S\-Q\-U\-A\-R\-E\-D = S\-U\-M (Z D\-E\-V\-I\-A\-T\-I\-O\-N\-S/\-E\-R\-R\-O\-R\-S)$\ast$$\ast$2 \subsubsection*{N\-O\-T\-E\-: D\-E\-G\-R\-E\-E\-S O\-F F\-R\-E\-E\-D\-O\-M = 2$\ast$\-N\-P\-T-\/5 }

B\-A\-S\-E\-D O\-N S\-U\-B\-R\-O\-U\-T\-I\-N\-E C\-I\-R\-C\-L\-E R\-E\-F\-E\-R\-E\-N\-C\-E\-: C\-O\-M\-P\-U\-T\-E\-R P\-H\-Y\-S\-I\-C\-S C\-O\-M\-M\-U\-N\-I\-C\-A\-T\-I\-O\-N\-S V\-O\-L 33,P329

A\-U\-T\-H\-O\-R\-S\-: N. C\-H\-E\-R\-N\-O\-V, G. O\-S\-O\-S\-K\-O\-V \& M. P\-O\-P\-P\-E Modified by\-: Fred Weber, 8 Jun 1989 Modified by\-: M.\-Cattaneo, 27-\/\-Jan-\/1998 Protect against arg S\-I\-N $>$ 1.\-0 



\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}

\end{DoxyParagraph}
F. Gaede D\-E\-S\-Y, Oct 2016

\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}
\doxyref{Marlin\-D\-D\-Kal\-Test\-Track.\-h}{p.}{MarlinDDKalTestTrack_8h_source} 3641 2012-\/06-\/13 13\-:04\-:36\-Z aplin 
\end{DoxyParagraph}
\begin{DoxyAuthor}{Author}
S.\-Aplin, F. Gaede D\-E\-S\-Y
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}
\doxyref{Marlin\-Kal\-Test\-Track.\-h}{p.}{MarlinKalTestTrack_8h_source} 5559 2016-\/06-\/07 16\-:14\-:02\-Z gaede 
\end{DoxyParagraph}
\begin{DoxyAuthor}{Author}
S.\-Aplin, F. Gaede D\-E\-S\-Y 
\end{DoxyAuthor}


\subsection{Function Documentation}
\index{Marlin\-Trk@{Marlin\-Trk}!create\-Finalised\-L\-C\-I\-O\-Track@{create\-Finalised\-L\-C\-I\-O\-Track}}
\index{create\-Finalised\-L\-C\-I\-O\-Track@{create\-Finalised\-L\-C\-I\-O\-Track}!MarlinTrk@{Marlin\-Trk}}
\subsubsection[{create\-Finalised\-L\-C\-I\-O\-Track}]{\setlength{\rightskip}{0pt plus 5cm}int Marlin\-Trk\-::create\-Finalised\-L\-C\-I\-O\-Track (
\begin{DoxyParamCaption}
\item[{I\-Marlin\-Track $\ast$}]{marlin\-Trk, }
\item[{std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&}]{hit\-\_\-list, }
\item[{I\-M\-P\-L\-::\-Track\-Impl $\ast$}]{track, }
\item[{bool}]{fit\-\_\-direction, }
\item[{E\-V\-E\-N\-T\-::\-Track\-State $\ast$}]{pre\-\_\-fit, }
\item[{float}]{bfield\-\_\-z, }
\item[{double}]{max\-Chi2\-Increment = {\ttfamily DBL\-\_\-MAX}}
\end{DoxyParamCaption}
)}\label{namespaceMarlinTrk_acd19c79174d4d6123f5a76e1a088420d}


Takes a list of hits and uses the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} inferface to fit them using a supplied prefit containing a covariance matrix for the initialisation. 

The Track\-Impl will have the 4 trackstates added to it , ,  and  

References create\-Fit(), and finalise\-L\-C\-I\-O\-Track().



Referenced by create\-Finalised\-L\-C\-I\-O\-Track().

\index{Marlin\-Trk@{Marlin\-Trk}!create\-Finalised\-L\-C\-I\-O\-Track@{create\-Finalised\-L\-C\-I\-O\-Track}}
\index{create\-Finalised\-L\-C\-I\-O\-Track@{create\-Finalised\-L\-C\-I\-O\-Track}!MarlinTrk@{Marlin\-Trk}}
\subsubsection[{create\-Finalised\-L\-C\-I\-O\-Track}]{\setlength{\rightskip}{0pt plus 5cm}int Marlin\-Trk\-::create\-Finalised\-L\-C\-I\-O\-Track (
\begin{DoxyParamCaption}
\item[{I\-Marlin\-Track $\ast$}]{marlin\-Trk, }
\item[{std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&}]{hit\-\_\-list, }
\item[{I\-M\-P\-L\-::\-Track\-Impl $\ast$}]{track, }
\item[{bool}]{fit\-\_\-direction, }
\item[{const E\-V\-E\-N\-T\-::\-Float\-Vec \&}]{initial\-\_\-cov\-\_\-for\-\_\-prefit, }
\item[{float}]{bfield\-\_\-z, }
\item[{double}]{max\-Chi2\-Increment = {\ttfamily DBL\-\_\-MAX}}
\end{DoxyParamCaption}
)}\label{namespaceMarlinTrk_a00299753dd33f4e4b404451808055cba}


Takes a list of hits and uses the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} inferface to fit them using a supplied covariance matrix for the initialisation. 

The Track\-Impl will have the 4 trackstates added to it , ,  and  

References create\-Finalised\-L\-C\-I\-O\-Track(), and create\-Prefit().

\index{Marlin\-Trk@{Marlin\-Trk}!create\-Fit@{create\-Fit}}
\index{create\-Fit@{create\-Fit}!MarlinTrk@{Marlin\-Trk}}
\subsubsection[{create\-Fit}]{\setlength{\rightskip}{0pt plus 5cm}int Marlin\-Trk\-::create\-Fit (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&}]{hit\-\_\-list, }
\item[{I\-Marlin\-Track $\ast$}]{marlin\-Trk, }
\item[{E\-V\-E\-N\-T\-::\-Track\-State $\ast$}]{pre\-\_\-fit, }
\item[{float}]{bfield\-\_\-z, }
\item[{bool}]{fit\-\_\-direction, }
\item[{double}]{max\-Chi2\-Increment = {\ttfamily DBL\-\_\-MAX}}
\end{DoxyParamCaption}
)}\label{namespaceMarlinTrk_a2b9e86b6f1137af26dd00b486fb978e0}


Takes a list of hits and uses the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} inferface to fit them using a supplied prefit containing a covariance matrix for the initialisation. 



References Marlin\-Trk\-::\-I\-Marlin\-Track\-::add\-Hit(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::fit(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::initialise(), and Marlin\-Trk\-::\-I\-Marlin\-Track\-::propagate().



Referenced by create\-Finalised\-L\-C\-I\-O\-Track().

\index{Marlin\-Trk@{Marlin\-Trk}!create\-Prefit@{create\-Prefit}}
\index{create\-Prefit@{create\-Prefit}!MarlinTrk@{Marlin\-Trk}}
\subsubsection[{create\-Prefit}]{\setlength{\rightskip}{0pt plus 5cm}int Marlin\-Trk\-::create\-Prefit (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&}]{hit\-\_\-list, }
\item[{I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$}]{pre\-\_\-fit, }
\item[{float}]{bfield\-\_\-z, }
\item[{bool}]{fit\-\_\-direction}
\end{DoxyParamCaption}
)}\label{namespaceMarlinTrk_af833b06170b0a314602b951be0cb6b5d}


Provides the values of a track state from the first, middle and last hits in the hit\-\_\-list. 



References Marlin\-Trk\-::\-I\-Marlin\-Track\-::backward.



Referenced by create\-Finalised\-L\-C\-I\-O\-Track().

\index{Marlin\-Trk@{Marlin\-Trk}!finalise\-L\-C\-I\-O\-Track@{finalise\-L\-C\-I\-O\-Track}}
\index{finalise\-L\-C\-I\-O\-Track@{finalise\-L\-C\-I\-O\-Track}!MarlinTrk@{Marlin\-Trk}}
\subsubsection[{finalise\-L\-C\-I\-O\-Track}]{\setlength{\rightskip}{0pt plus 5cm}int Marlin\-Trk\-::finalise\-L\-C\-I\-O\-Track (
\begin{DoxyParamCaption}
\item[{I\-Marlin\-Track $\ast$}]{marlin\-Trk, }
\item[{I\-M\-P\-L\-::\-Track\-Impl $\ast$}]{track, }
\item[{std\-::vector$<$ E\-V\-E\-N\-T\-::\-Tracker\-Hit $\ast$ $>$ \&}]{hit\-\_\-list, }
\item[{bool}]{fit\-\_\-direction, }
\item[{I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$}]{at\-Last\-Hit = {\ttfamily 0}, }
\item[{I\-M\-P\-L\-::\-Track\-State\-Impl $\ast$}]{at\-Calo\-Face = {\ttfamily 0}}
\end{DoxyParamCaption}
)}\label{namespaceMarlinTrk_a44cae10a38b99e5a6e831eb22643650d}


Takes a fitted Marlin\-Track, Track\-Impl to record the fit and the hits which have been added to the fit. 

The Track\-Impl will have the 4 trackstates added to it , ,  and . Note\-: the hit list is needed as the \doxyref{I\-Marlin\-Track}{p.}{classMarlinTrk_1_1IMarlinTrack} only contains the hits used in the fit, not the spacepoints (if any have been included) so as the strip hits cannot point to the space points we need to have the list so that they can be recorded in the L\-C\-I\-O Track\-Impl 

References Marlin\-Trk\-::\-I\-Marlin\-Track\-::backward, Marlin\-Trk\-::\-I\-Marlin\-Trk\-System\-::create\-Track(), error\-Code(), Marlin\-Trk\-::\-Factory\-::get\-Current\-Marlin\-Trk\-System(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::get\-Hits\-In\-Fit(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::get\-N\-D\-F(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::get\-Outliers(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::get\-Tracker\-Hit\-At\-Positive\-N\-D\-F(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::get\-Track\-State(), Marlin\-Trk\-::\-I\-Marlin\-Trk\-System\-::name(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::propagate(), Marlin\-Trk\-::\-I\-Marlin\-Track\-::smooth(), and Marlin\-Trk\-::\-I\-Marlin\-Track\-::to\-String().



Referenced by create\-Finalised\-L\-C\-I\-O\-Track().

