\section{marlintpc\-:\-:Track\-Finder\-Rectangular\-Processor Class Reference}
\label{classmarlintpc_1_1TrackFinderRectangularProcessor}\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}


Processor to find linear tracks using linear regression, based on a modified version of the track following algorithm.  




{\ttfamily \#include $<$Track\-Finder\-Rectangular\-Processor.\-h$>$}

Inheritance diagram for marlintpc\-:\-:Track\-Finder\-Rectangular\-Processor\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classmarlintpc_1_1TrackFinderRectangularProcessor}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual Processor $\ast$ {\bfseries new\-Processor} ()\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a26f91d07a914f67f5774a6af598b0c55}

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

\begin{DoxyCompactList}\small\item\em Called for every run. \end{DoxyCompactList}\item 
virtual void {\bf process\-Event} (lcio\-::\-L\-C\-Event $\ast$evt)\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a2a25e58fc17e6fd0aa5ab3c412945a81}

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

\item 
virtual void {\bf end} ()\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a5fd471f738201cd968cc21c1ea457ff4}

\begin{DoxyCompactList}\small\item\em Called after data processing for clean up. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf zero\-Flags} (bool $\ast$Is\-In)\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a2d17deadeabc2b077ef610f8b642b3ae}

\begin{DoxyCompactList}\small\item\em Set flags if hit is in a track to zero. \end{DoxyCompactList}\item 
void {\bf add\-Track\-Candidate\-Flags} ()\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ac55ff649fc0b5393dce7a92ee3b8842c}

\begin{DoxyCompactList}\small\item\em Add the hits of the track candidate to the is\-In\-Track flag array. \end{DoxyCompactList}\item 
void {\bfseries create\-New\-Is\-In\-Track\-Flags} ()\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ae533d75aa46f8ff1d77ab4b833e1eb5d}

\item 
I\-M\-P\-L\-::\-Tracker\-Hit\-Impl {\bf extrapolate\-Next\-Hit} (double y)\label{classmarlintpc_1_1TrackFinderRectangularProcessor_abd667956a5e88d49674a17a76b0ed5ea}

\begin{DoxyCompactList}\small\item\em Extrapolate the next expected hit on the track. \end{DoxyCompactList}\item 
void {\bf do\-Regression} (E\-V\-E\-N\-T\-::\-Track $\ast$track\-Candidate)
\begin{DoxyCompactList}\small\item\em Calculate the track parameters from the hits. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::string {\bf \-\_\-input\-Col\-Name}
\item 
std\-::string {\bf \-\_\-output\-Col\-Name}
\item 
int {\bf \-\_\-output\-Is\-Transient}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a21e2ee9214d06e51098a0f99da4c8188}

\begin{DoxyCompactList}\small\item\em give the status which is set to the transient flag of the output collection it is an int instead of a boolean, because the processor parameter cannot be a boolean \end{DoxyCompactList}\item 
gear\-::\-Pad\-Row\-Layout2\-D const $\ast$ {\bf \-\_\-pad\-Layout}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a7ee850cb6ce6d248379ed4886b0ff925}

\begin{DoxyCompactList}\small\item\em The pad layout as defined in G\-E\-A\-R. \end{DoxyCompactList}\item 
int {\bfseries \-\_\-row\-Height}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a5b30a77ae2c68e06ed2c92d840c9c486}

\item 
int {\bf \-\_\-min\-Track\-Hits}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ae9200aece48a21b22cd61d23d6392879}

\begin{DoxyCompactList}\small\item\em Minimum number of hits on track. \end{DoxyCompactList}\item 
int {\bf \-\_\-max\-Skip\-Rows}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a306c956cd7b5bedcd3d6856d2c3760a0}

\begin{DoxyCompactList}\small\item\em Maximum number of missing hits. \end{DoxyCompactList}\item 
float {\bf \-\_\-delta\-X}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ae7e9f2a3d2b6017e117b9ab8cf6e3df4}

\begin{DoxyCompactList}\small\item\em Maximum distances between predicted and measured hit. \end{DoxyCompactList}\item 
float {\bfseries \-\_\-delta\-Y}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ae88a5bc92464fe25b36b978a7e04cd1e}

\item 
float {\bfseries \-\_\-delta\-Z}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_aa70f9ba03747d51ab25d086d7045464b}

\item 
int {\bf \-\_\-n\-Run}
\begin{DoxyCompactList}\small\item\em !!!!! This information should come from the conditions data! Implemented as processor parameter for first tests! \end{DoxyCompactList}\item 
int {\bf \-\_\-n\-Evt}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ad0607dd69243b39407afb60c03510b58}

\begin{DoxyCompactList}\small\item\em The total number of events. \end{DoxyCompactList}\item 
int {\bf \-\_\-verbosity\-Level}
\begin{DoxyCompactList}\small\item\em Flag about verbosity of the processor. \end{DoxyCompactList}\item 
bool $\ast$ {\bf is\-In\-Track}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a60659cf2c52380c366329070fde8da1f}

\begin{DoxyCompactList}\small\item\em Array of flags whether a hit is in a track. \end{DoxyCompactList}\item 
bool $\ast$ {\bf is\-In\-Track\-Candidate}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a67e63bf41c937dad6984890ca65b5ea4}

\begin{DoxyCompactList}\small\item\em Array of flags whether a hit is in the current track candidate. \end{DoxyCompactList}\item 
unsigned int {\bf n\-Hits}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a808df05296d74e76908029de634bec33}

\begin{DoxyCompactList}\small\item\em Number of hits in the current event. \end{DoxyCompactList}\item 
\begin{tabbing}
xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill
struct \{\\
\>float {\bfseries a}\\
\>float {\bfseries b}\\
\>float {\bfseries c}\\
\>float {\bfseries d}\\
\} {\bf straightLine}\\

\end{tabbing}\begin{DoxyCompactList}\small\item\em Straight line for linear regression. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Processor to find linear tracks using linear regression, based on a modified version of the track following algorithm. 

It assumes the hits being equidistantly spaced in y, which is the case for a T\-P\-C with rectangular pad layout (straight rows).

\subparagraph*{Input -\/ Prerequisites}

Collection of Tracker\-Hits, sorted in y, x and z (in this order). A sorting function might be implemented in a later version or provided as a separate processor. For the time being the Hit\-Finder has provide sorted hits.

\subparagraph*{Output}

Collection of Tracks


\begin{DoxyParams}{Parameters}
{\em Input\-Collection\-Name} & Name of input data collection (default\-: T\-P\-C\-Hits) \\
\hline
{\em Output\-Collection\-Name} & Name of output data collection (default\-: T\-P\-C\-Seed\-Tracks) \\
\hline
{\em Set\-Output\-Transient} & If not 0 the output collection is set transient (default\-: 0)\\
\hline
\end{DoxyParams}
This processor is intended to work as a finder, the fitting is done by a more advanced fitting algorithm. In this case the output can be set transient, so the seed tracks are not written to disk.\par
 As the finding algorithm performs a linear regression, which is equivalent to a $\chi^2$ minimisation for straight tracks, all track parameters are available and the track fitting can be skipped. In this case the output collection name should be changed to T\-P\-C\-Tracks.


\begin{DoxyParams}{Parameters}
{\em Min\-Track\-Hits} & Minimum number of hits on the track \\
\hline
{\em Max\-Skip\-Rows} & Maximum number of subsequently missing hits \\
\hline
{\em Delta\-X} & Maximum x distances between predicted and measured hit \\
\hline
{\em Delta\-Y} & Maximum y distances between predicted and measured hit \\
\hline
{\em Delta\-Z} & Maximum z distances between predicted and measured hit \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!do\-Regression@{do\-Regression}}
\index{do\-Regression@{do\-Regression}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{do\-Regression}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::do\-Regression (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-Track $\ast$}]{track\-Candidate}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ae2432fad6feb47c0d97d78ac8f81e4f3}


Calculate the track parameters from the hits. 

This is done by linear regression, which is equivalent to a $\chi^2$ minimisation for a straight line.

The straight line is parameterised in the xy and the zy plane\-: \par
 x=ay+b ; z=c$\ast$y+d \par
 Calculate a and b ; c and d analytically by linear regression. (As track is going predominantly along the y direction, this coordinate is set to the centre of the pad and regarded without uncertainty) \[a=\frac{\sum y_i\sum x_i-n\sum y_i x_i} {(\sum y_i)^2 - n \sum y_i^2}\] \[b=\frac{\sum y_i\sum y_i x_i - n\sum y_i^2 x_i} {(\sum y_i)^2 - n \sum y_i^2}\] (see for instance W. Walcher, Praktikum der Physik, Teubner Taschenb\"{u}cher Physik, 1994) 

References \-\_\-verbosity\-Level, and straight\-Line.



Referenced by process\-Event().

\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!init@{init}}
\index{init@{init}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a670886b2850772b9c02a066e270e3fa7}


Called at the begin of the job before anything is read. 

Use to initialize the processor, e.\-g. book histograms. 

References \-\_\-n\-Evt, \-\_\-n\-Run, \-\_\-pad\-Layout, and \-\_\-verbosity\-Level.



\subsection{Member Data Documentation}
\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!\-\_\-input\-Col\-Name@{\-\_\-input\-Col\-Name}}
\index{\-\_\-input\-Col\-Name@{\-\_\-input\-Col\-Name}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{\-\_\-input\-Col\-Name}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::\-\_\-input\-Col\-Name\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ab74e3b6e679437c921f9f7b50c44dc8c}

\begin{DoxyItemize}
\item the name of the input collection 
\end{DoxyItemize}

Referenced by process\-Event().

\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!\-\_\-n\-Run@{\-\_\-n\-Run}}
\index{\-\_\-n\-Run@{\-\_\-n\-Run}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{\-\_\-n\-Run}]{\setlength{\rightskip}{0pt plus 5cm}int marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::\-\_\-n\-Run\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_ad2cce04ee247a6eea5499da42db3564b}


!!!!! This information should come from the conditions data! Implemented as processor parameter for first tests! 

The number of runs 

Referenced by end(), init(), and process\-Run\-Header().

\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!\-\_\-output\-Col\-Name@{\-\_\-output\-Col\-Name}}
\index{\-\_\-output\-Col\-Name@{\-\_\-output\-Col\-Name}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{\-\_\-output\-Col\-Name}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::\-\_\-output\-Col\-Name\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a3915fb2968482288365964e449eaa03a}

\begin{DoxyItemize}
\item the name of the output collection 
\end{DoxyItemize}

Referenced by process\-Event().

\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!\-\_\-verbosity\-Level@{\-\_\-verbosity\-Level}}
\index{\-\_\-verbosity\-Level@{\-\_\-verbosity\-Level}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{\-\_\-verbosity\-Level}]{\setlength{\rightskip}{0pt plus 5cm}int marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::\-\_\-verbosity\-Level\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a446db81acb21d9e4ca81d705c0ffb701}


Flag about verbosity of the processor. 

To help to understand and to debug the algorithm a lot of output can be switched on. \begin{DoxyItemize}
\item {\ttfamily 0} \-: quiet, only report errors \item {\ttfamily 1} \-: normal, default, status of processor parameters and event statistics \item {\ttfamily 2} \-: rebort about every event \item {\ttfamily 3} \-: report about every track candidate \item {\ttfamily 4} \-: report about every hit \item {\ttfamily 5} \-: rebort about everything \end{DoxyItemize}


Referenced by add\-Track\-Candidate\-Flags(), do\-Regression(), end(), extrapolate\-Next\-Hit(), init(), process\-Event(), and zero\-Flags().

\index{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}!straight\-Line@{straight\-Line}}
\index{straight\-Line@{straight\-Line}!marlintpc::TrackFinderRectangularProcessor@{marlintpc\-::\-Track\-Finder\-Rectangular\-Processor}}
\subsubsection[{straight\-Line}]{\setlength{\rightskip}{0pt plus 5cm}struct \{ ... \}   marlintpc\-::\-Track\-Finder\-Rectangular\-Processor\-::straight\-Line\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1TrackFinderRectangularProcessor_a05374a8c809dc27ab84a4b48393415ef}


Straight line for linear regression. 

\par
 The staright line is defined with 4 parameters\-:\par
 x=ay+b ; z=cy+d 

Referenced by do\-Regression(), extrapolate\-Next\-Hit(), and process\-Event().



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