\section{Marlin\-Track\-Fit Class Reference}
\label{classMarlinTrackFit}\index{Marlin\-Track\-Fit@{Marlin\-Track\-Fit}}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Marlin\-Track\-Fit} ()\label{classMarlinTrackFit_a015a7f1f951737e418f671a56a4bacd3}

\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
{\bf $\sim$\-Marlin\-Track\-Fit} ()\label{classMarlinTrackFit_a18abc467f2995e298f77d0bcdbcecaea}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
int {\bf Do\-Fitting} (int use\-Extra\-Point, int fit\-Opt, int \&nhits, float b\-Field, int $\ast$idet, int $\ast$itype, float chi2\-Prefit\-Cut, float $\ast$x, float $\ast$y, float $\ast$z, float $\ast$R\-P\-Reso, float $\ast$Z\-Reso, float $\ast$param, float $\ast$eparam, float $\ast$Ref\-Point, float \&chi2, int \&ndf, float \&chi2rphi, float \&chi2z, int $\ast$lhits)
\begin{DoxyCompactList}\small\item\em Method performs track fitting taking into account energy loss and M\-S First simple helix fit is performed to define initial track parameters at the P\-C\-A to primary I\-P. \end{DoxyCompactList}\item 
void {\bf Crude\-Error\-Estimates} (float B\-Field, float $\ast$reso, float $\ast$param, float $\ast$eparam)\label{classMarlinTrackFit_a69ea8b943bde214e8f43d149a46688b1}

\begin{DoxyCompactList}\small\item\em Method fills covariance matrix according to apriori specified resolutions Covariance matrix is assumed to be diagonal Inputs \-: reso[4] -\/ array of resolutions \-: \par
 0 -\/ momentum resolution delta(\-Pt)/\-Pt$^\wedge$2 \par
 1 -\/ angular resolution (radians) \par
 2 -\/ D0 resolution (mm) \par
 3 -\/ Z0 resolution (mm) \par
 param[5] -\/ track parameters in the canonical representation \par
 Output \-: eparam[15] -\/ covariance matrix \par
 \end{DoxyCompactList}\item 
void {\bfseries set\-Parameters\-For\-I\-P\-Errors} (float $\ast$par)\label{classMarlinTrackFit_a6ea2d99e21955f332bc35930c1167189}

\end{DoxyCompactItemize}


\subsection{Member Function Documentation}
\index{Marlin\-Track\-Fit@{Marlin\-Track\-Fit}!Do\-Fitting@{Do\-Fitting}}
\index{Do\-Fitting@{Do\-Fitting}!MarlinTrackFit@{Marlin\-Track\-Fit}}
\subsubsection[{Do\-Fitting}]{\setlength{\rightskip}{0pt plus 5cm}int Marlin\-Track\-Fit\-::\-Do\-Fitting (
\begin{DoxyParamCaption}
\item[{int}]{use\-Extra\-Point, }
\item[{int}]{fit\-Opt, }
\item[{int \&}]{nhits, }
\item[{float}]{b\-Field, }
\item[{int $\ast$}]{idet, }
\item[{int $\ast$}]{itype, }
\item[{float}]{chi2\-Prefit\-Cut, }
\item[{float $\ast$}]{x, }
\item[{float $\ast$}]{y, }
\item[{float $\ast$}]{z, }
\item[{float $\ast$}]{R\-P\-Reso, }
\item[{float $\ast$}]{Z\-Reso, }
\item[{float $\ast$}]{param, }
\item[{float $\ast$}]{eparam, }
\item[{float $\ast$}]{Ref\-Point, }
\item[{float \&}]{chi2, }
\item[{int \&}]{ndf, }
\item[{float \&}]{chi2rphi, }
\item[{float \&}]{chi2z, }
\item[{int $\ast$}]{lhits}
\end{DoxyParamCaption}
)}\label{classMarlinTrackFit_aa8737522682fdb6b0b33cf0d01d7bd9d}


Method performs track fitting taking into account energy loss and M\-S First simple helix fit is performed to define initial track parameters at the P\-C\-A to primary I\-P. 

If simple helix fit converges and has qood quality set by variable chi2\-Prefit\-Cut then D\-E\-L\-P\-H\-I fitting routine trkfit.\-F is envoked Inputs \-: use\-Extra\-Point \-: 1 -\/ an additional extra point (P.\-C.\-A) is used in fit with relatively large errors to improve D0 and Z0 determination @ P.\-C.\-A 0 -\/ number of points in fit equals to the number of hits in track opt\-Fit \-: 0 -\/ F\-O\-R\-T\-R\-A\-N routine tfithl is used for prefit to determine initial track parameters 1 -\/ Cluster\-Shapes class is used for prefit nhits -\/ number of tracker hits used in fit b\-Field -\/ magnetic field in Tesla idet -\/ list of the hit detector identifiers itype -\/ list of the hit types ( 2 -\/ planar disks, 3 -\/ cyllindrical or laddered detector ) chi2\-Prefit\-Cut -\/ cut on the chi2 of prefit. If chi2 of prefit $>$ chi2 then prefit is regarded to fail and routine returns -\/1 x,y,z -\/ list of the hit Cartesian coordinates R\-P\-Reso -\/ list of the hit resolutions in R-\/\-Phi projection Z\-Reso -\/ list of the hit resolutions along Z Outpus \-: param -\/ list of the track parameters at the P\-C\-A param[0] -\/ Omega (signed curvuture) sign \char`\"{}+\char`\"{} corresponds to clock-\/wise direction param[1] -\/ tan(\-Lambda) (tangence of the dip angle, lambda = pi/2 -\/ Theta) param[2] -\/ Azimuthal angle of the particle momentum @ P\-C\-A param[3] -\/ D0 (I\-P in the R-\/\-Phi projection @ P\-C\-A ) param[4] -\/ Z0 (z coordinate displacement @ P\-C\-A ) eparam[15] -\/ covariance matrix of the track parameters (lower-\/left part of symmetric matrix) Ref\-Point[3] -\/ reference point of track fit chi2 -\/ fit chi2 ndf -\/ number of degrees of freedom chi2rphi -\/ prefit chi2 in the R-\/\-Phi (X-\/\-Y) plane chi2z -\/ prefit chi2 in the S-\/\-Z plane lhits -\/ list of hit status after fit, lhits[i] = 0 means that hit is thrown away after fitting procedure lhits[i] = 1 means that hit is kept in the fitting procedure returned integer indicate error flag error = 0 -\/ no error, fit is successfull error = -\/1 -\/ simple helix fit failed error = 1 -\/ Delphi fit failed, but the simple helix fit is successfull

Subroutine converts covariance matrix from the T\-A\-N\-A\-G\-R\-A (D\-E\-L\-P\-H\-I code) representation \par
 (R-\/\-Phi,R-\/\-Phi) \par
 (R-\/\-Phi,Z\-R) (Z\-R,Z\-R) \par
 (R-\/\-Phi,Theta) (Z\-R,Theta) (Theta,Theta) \par
 (R-\/\-Phi,Phi\-R) (Z\-R,Phi\-R) (Theta,Phi\-R) (Phi\-R,Phi\-R) \par
 (R-\/\-Phi,1/p) (Z\-R,1/p) (Theta,1/p) (Phi\-R,1/p) (1/p,1/p) \par
 into canonical representation \par
 (D0,D0) \par
 (Phi0,D0) (Phi0,Phi0) \par
 (Omega,D0) (Omega,Phi0) (Omega,Omega) \par
 (Z0,D0) (Z0,Phi0) (Z0,Omega) (Z0,Z0) \par
 (Tan\-L,D0) (Tan\-L,Phi0) (Tan\-L,Omega) (Tan\-L,Z0) (Tan\-L,Tan\-L) \par


T\-A\-N\-A\-G\-R\-A Vector Eta = (R-\/\-Phi,z,Theta,phi,1/p) \par
 where R-\/\-Phi \-: R$\ast$\-Phi @ fixed Radius of the reference point \par
 Z\-R \-: z coordinate of the reference point \par
 Theta \-: polar angle of the momentum @ reference point \par
 Phi\-R \-: azimuthal angle of the momentum @ reference point \par
 1/p \-: inverse of momentum magnitude (signed quantity) \par
 sign is \char`\"{}+\char`\"{} corresponds to anticlock-\/wise direction \par
 as opposed to definition of Omega (in canonical format) \par
 Canonical Vector X = (Omega,Tan\-Lambda,Phi,D0,Z0) \par


Covariance matrix is calculated according to \par
 U\-X[i,j] = V\-Eta[l,m]$\ast$d\-Xd\-Eta[i,l]$\ast$d\-Xd\-Eta[j,m] \par
 where U\-X[i,j] is the cov matrix in the canonical representation \par
 Veta[l,m] is the cov matrix in the T\-A\-N\-A\-G\-R\-A (D\-E\-L\-P\-H\-I) representation \par
 and d\-Xd\-Eta[k,n] -\/ is Jacobian d\-X\-\_\-k/d\-Eta\-\_\-n \par
 \par
 

The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Marlin\-Track\-Fit.\-h\end{DoxyCompactItemize}
