\section{marlintpc\-:\-:Linear\-Regression\-Processor Class Reference}
\label{classmarlintpc_1_1LinearRegressionProcessor}\index{marlintpc\-::\-Linear\-Regression\-Processor@{marlintpc\-::\-Linear\-Regression\-Processor}}


\doxyref{Linear\-Regression\-Processor}{p.}{classmarlintpc_1_1LinearRegressionProcessor} performs a linear regression on the hits in seed tracks.  




{\ttfamily \#include $<$Linear\-Regression\-Processor.\-h$>$}

Inheritance diagram for marlintpc\-:\-:Linear\-Regression\-Processor\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classmarlintpc_1_1LinearRegressionProcessor}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Linear\-Regression\-Processor} ()\label{classmarlintpc_1_1LinearRegressionProcessor_ad828274353051fff47f5ec6cdc7fa4d3}

\begin{DoxyCompactList}\small\item\em Default constructor. \end{DoxyCompactList}\item 
{\bf $\sim$\-Linear\-Regression\-Processor} ()\label{classmarlintpc_1_1LinearRegressionProcessor_ab42ae086def08f9f32a74d7951a23ef4}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
Processor $\ast$ {\bf new\-Processor} ()\label{classmarlintpc_1_1LinearRegressionProcessor_ae38afc597ad8e095f441438fa70668b4}

\begin{DoxyCompactList}\small\item\em Return a new instance of this processor. \end{DoxyCompactList}\item 
void {\bf init} ()\label{classmarlintpc_1_1LinearRegressionProcessor_a63dbb6815318a0c4d3167eb7216a31d5}

\begin{DoxyCompactList}\small\item\em Called at the begin of the job before anything is read. \end{DoxyCompactList}\item 
void {\bf process\-Run\-Header} (lcio\-::\-L\-C\-Run\-Header $\ast$run)\label{classmarlintpc_1_1LinearRegressionProcessor_a6f8a800e1f8d7316c05fec55730017f4}

\begin{DoxyCompactList}\small\item\em Called once per run to process the event's header. \end{DoxyCompactList}\item 
virtual void {\bf process\-Event} (lcio\-::\-L\-C\-Event $\ast$evt)\label{classmarlintpc_1_1LinearRegressionProcessor_a2cf53c28928d4500a88a1127938e4abd}

\begin{DoxyCompactList}\small\item\em Called for every event -\/ the working horse. \end{DoxyCompactList}\item 
virtual void {\bf check} (lcio\-::\-L\-C\-Event $\ast$evt)\label{classmarlintpc_1_1LinearRegressionProcessor_a92668eda9b342a67c07023aa60042f63}

\begin{DoxyCompactList}\small\item\em Called for every event -\/ right after \doxyref{process\-Event()}{p.}{classmarlintpc_1_1LinearRegressionProcessor_a2cf53c28928d4500a88a1127938e4abd} has been called for all processors. \end{DoxyCompactList}\item 
virtual void {\bf end} ()\label{classmarlintpc_1_1LinearRegressionProcessor_a332a94dc56f834098537ee93bd29d855}

\begin{DoxyCompactList}\small\item\em Called after data processing for clean up in the inverse order of the \doxyref{init()}{p.}{classmarlintpc_1_1LinearRegressionProcessor_a63dbb6815318a0c4d3167eb7216a31d5} method so that resources allocated in the first processor also will be available for all following processors. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static bool {\bfseries compare\-Hit} (const std\-::pair$<$ Tracker\-Hit $\ast$, double $>$ \&pair1, const std\-::pair$<$ Tracker\-Hit $\ast$, double $>$ \&pair2)\label{classmarlintpc_1_1LinearRegressionProcessor_afa5295730747c4a1610e173416383ea3}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\doxyref{Linear\-Regression\-Processor}{p.}{classmarlintpc_1_1LinearRegressionProcessor} performs a linear regression on the hits in seed tracks. 

It calculates the track parameters for a straight line. The linear regression is an analytical calculation, but equivalent to a chi$^\wedge$2 fit. Does not need seed tracks, so it can directly work on track candidates. Orientation of the track can be either along x-\/ or y-\/axis.\par
 \begin{DoxyItemize}
\item case1\-: $\displaystyle |\phi | < \frac{\pi}{4}$\par
 y = ax + b\par
 z = cx + d\par
 $\displaystyle \phi = atan(a) $\par
 $\displaystyle d_0 = b\cdot cos(\phi) $\par
 \par
 calculation of $\lambda$\-:\par
 (angle betwenn track and x-\/y-\/plane, that is between track and projection on x-\/y-\/plane)\par
 track\-: $\displaystyle \vec{g}(x) = \left(\begin{array}{c} x \\ ax + b \\ cx + d \end{array} \right)$\par
 projection\-: $\displaystyle \vec{f}(x) = \left(\begin{array}{c} x \\ ax + b \\ 0 \end{array} \right)$\par
 $\displaystyle cos( \lambda ) = \frac{(\vec{g}(1) - \vec{g}(0))\cdot(\vec{f}(1) - \vec{f}(0))}{|(\vec{g}(1) - \vec{g}(0))| \cdot |(\vec{f}(1) - \vec{f}(0))| } $\par
 $\displaystyle \Rightarrow cos( \lambda ) = \frac{ \sqrt{ a^2 + 1 } }{ \sqrt{ a^2 + 1 + c^2 } }$ \par
 $\displaystyle z_0 = c\cdot x_0 + d = c\cdot sin( \phi )\cdot d_0 $ \par
 \par
 \item case2\-: $\displaystyle |\phi | > \frac{\pi}{4}$\par
 x = ay + b\par
 z = cy + d\par
 $\displaystyle \phi = \frac{\pi}{2}-atan(a) $\par
 $\displaystyle d_0 = b\cdot sin(\phi) $\par
 same as above\-:\par
 $\displaystyle cos( \lambda ) = \frac{ \sqrt{ a^2 + 1 } }{ \sqrt{ a^2 + 1 + c^2 } }$\par
 $\displaystyle z_0 = c\cdot y_0 + d = c\cdot sin( \frac{\pi}{2} - \phi)\cdot d_0 $\par
\par
d\-Edx is the charge deposition per track length. The procedure is the following\-:\par
1) one sorts the hits along the track (parametrization\-: $\displaystyle \vec{P}=\vec{d_0}+s\begin{array}{c} cos\phi \\sin\phi \end{array} $ $\Rightarrow$ sorting in s) \par
2) calculate distance from first to last point along track $\displaystyle l=|s_{last}-s_{first}|$ \par
3) $\displaystyle l_{eff} = l\cdot\frac{n}{n-1}$ where n is the number of hits on the track 4) $\displaystyle dEdx = \frac{\sum Q}{l_{eff}} $ \begin{DoxyAuthor}{Author}
M. Killenberg(\-University of Bonn), S.\-Zimmermann(\-University of Bonn)
\end{DoxyAuthor}
\subparagraph*{Input -\/ Prerequisites}\end{DoxyItemize}
\begin{DoxyItemize}
\item A collection of track candidates or seen tracks (lcio\-::\-Tracks) containing the Tracker\-Hits.\par
 Note\-: The L\-C\-I\-O\-::\-T\-R\-B\-I\-T\-\_\-\-H\-I\-T\-S flag has to be set when this collection is created so the hits are stored in the track.\end{DoxyItemize}
\subparagraph*{Output}

\begin{DoxyItemize}
\item Collection of straight tracks.\end{DoxyItemize}

\begin{DoxyParams}{Parameters}
{\em Input\-Track\-Candidates} & The the name of the input collection of track candidates (default\-: T\-P\-C\-Track\-Candidates) \\
\hline
{\em Output\-Tracks} & The name of the collection the straight tracks be stored under (default\-: T\-P\-C\-Tracks) \\
\hline
{\em Set\-Output\-Transient} & If not 0 the output collection is set transient (default\-: 0) \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Linear\-Regression\-Processor.\-h\item 
Linear\-Regression\-Processor.\-cc\end{DoxyCompactItemize}
