\section{marlintpc\-:\-:Row\-Based\-Fast\-Hough\-Transformation\-Processor Class Reference}
\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor}\index{marlintpc\-::\-Row\-Based\-Fast\-Hough\-Transformation\-Processor@{marlintpc\-::\-Row\-Based\-Fast\-Hough\-Transformation\-Processor}}


Track finder based on Fast Hough Transformation.  




{\ttfamily \#include $<$Row\-Based\-Fast\-Hough\-Transformation\-Processor.\-h$>$}

Inheritance diagram for marlintpc\-:\-:Row\-Based\-Fast\-Hough\-Transformation\-Processor\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual Processor $\ast$ {\bfseries new\-Processor} ()\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a9b91aff5cb48138202d71b9bc8daf5a2}

\item 
{\bf Row\-Based\-Fast\-Hough\-Transformation\-Processor} ()\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_ab52d84a32f9d1254b2f0361cb0eb9b34}

\begin{DoxyCompactList}\small\item\em Construct processor. \end{DoxyCompactList}\item 
virtual void {\bf init} ()\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_ae4eda1bf9f19e017c323553e7768dc17}

\begin{DoxyCompactList}\small\item\em Initialize processor. \end{DoxyCompactList}\item 
virtual void {\bfseries process\-Run\-Header} (E\-V\-E\-N\-T\-::\-L\-C\-Run\-Header $\ast$run)\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a66e5b44f4a691a629c81d6fc43628ba5}

\item 
virtual void {\bf process\-Event} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$evt)
\begin{DoxyCompactList}\small\item\em Process event. \end{DoxyCompactList}\item 
virtual void {\bfseries check} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$evt)\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a62704a562863ec592207b6ff474dfa50}

\item 
virtual void {\bfseries end} ()\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a6427c927b63f31db4dbc0c8c6fde7640}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::string {\bf \-\_\-input\-Col\-Name}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a700ae92aab1961b11294e5ef501e953a}

\begin{DoxyCompactList}\small\item\em Name of the input collection. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-output\-Col\-Name}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_aa7e0873be1275dba174b8beada476ef8}

\begin{DoxyCompactList}\small\item\em Name of the output collection. \end{DoxyCompactList}\item 
double {\bf \-\_\-bfield\-Scale\-Factor}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a0586fa1205ecdee9618d58f5e4b4c923}

\begin{DoxyCompactList}\small\item\em scale factor for magnetic field (default\-: 1.\-0) \end{DoxyCompactList}\item 
bool {\bf \-\_\-use\-X\-Y}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a13ae5fc6f8c8c7ad362b9b34a66f2409}

\begin{DoxyCompactList}\small\item\em Use X\-Y (anode plane) measurement. \end{DoxyCompactList}\item 
bool {\bf \-\_\-use\-X\-Z}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a0f9cfb60da54204a6dcbbe59c23c47d4}

\begin{DoxyCompactList}\small\item\em Use X\-Z (drift time) measurement. \end{DoxyCompactList}\item 
double {\bf \-\_\-center\-X\-Y}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a71507735da9ea903b0bd6900a428d0f7}

\begin{DoxyCompactList}\small\item\em Center of X\-Y (anode plane) measurement. \end{DoxyCompactList}\item 
double {\bf \-\_\-range\-X\-Y}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a4a5fd6d36c769ee5063a2f3950dfb18b}

\begin{DoxyCompactList}\small\item\em Range of X\-Y (anode plane) measurement. \end{DoxyCompactList}\item 
double {\bf \-\_\-center\-X\-Z}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a9e2620b47e4c65554c09c4017f5fde62}

\begin{DoxyCompactList}\small\item\em Center of X\-Z (drift time) measurement. \end{DoxyCompactList}\item 
double {\bf \-\_\-range\-X\-Z}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a6b77a341e599356c6194a4ab7f7ed414}

\begin{DoxyCompactList}\small\item\em Range of X\-Z (drift time) measurement. \end{DoxyCompactList}\item 
int {\bf \-\_\-min\-Row}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_aed0a3f2fe7cb535baff3d3622c919694}

\begin{DoxyCompactList}\small\item\em Minimal number of (correlated) rows. \end{DoxyCompactList}\item 
float {\bf \-\_\-frac\-Row}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a62105a92178dd7d189f9c56d04d192cb}

\begin{DoxyCompactList}\small\item\em Relative minimum cube content. \end{DoxyCompactList}\item 
int {\bf \-\_\-max\-Row\-Diff}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_ab9a50e7efbf86053e2cc258929219605}

\begin{DoxyCompactList}\small\item\em Row correation parameter. \end{DoxyCompactList}\item 
int {\bf \-\_\-max\-Cube}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a1831d8df3d0db723bf58c498f53c4051}

\begin{DoxyCompactList}\small\item\em Maximum number of (hyper) cubes to check. \end{DoxyCompactList}\item 
int {\bf \-\_\-min\-Level}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_aa4c352964caf6363d82cc5f0ab059c75}

\begin{DoxyCompactList}\small\item\em Minimum number of (hyper) cubes splittings. \end{DoxyCompactList}\item 
int {\bf \-\_\-max\-Level}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a6a1cda93c161b421a557d771a2cfaca8}

\begin{DoxyCompactList}\small\item\em Maximum number of (hyper) cubes splittings. \end{DoxyCompactList}\item 
float {\bf \-\_\-eff\-Cut}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_ae28d3aab046b4bc2a84fa93ddd7709b6}

\begin{DoxyCompactList}\small\item\em Minimum hit density (hits/tracklength) \end{DoxyCompactList}\item 
float {\bf \-\_\-pur\-Cut}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a6b0ffc866f0cc00081ed0d3caf9dd901}

\begin{DoxyCompactList}\small\item\em Maximum hit density (hits/tracklength) \end{DoxyCompactList}\item 
int {\bf \-\_\-max\-Hits\-Per\-Row}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a72b8975821efd96f864032a059b75ec3}

\begin{DoxyCompactList}\small\item\em Maximum number hits per row. \end{DoxyCompactList}\item 
double {\bf \-\_\-unused\-Cut}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_aa78935847b14d1680ba9434b7763a98e}

\begin{DoxyCompactList}\small\item\em Chi2 cut for matching unused hits in X\-Y and Z. \end{DoxyCompactList}\item 
int {\bf \-\_\-max\-Gap}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_af6ba7fbf63f736209122e48eebffbe30}

\begin{DoxyCompactList}\small\item\em Cut for (row) distance to segment for matching unused hits in X\-Y and Z. \end{DoxyCompactList}\item 
bool {\bf \-\_\-encoded\-Module\-I\-D}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_ac26fa02a0a11faf931004f1deaa71d70}

\begin{DoxyCompactList}\small\item\em Module I\-D is encoded in Cell\-I\-D0. \end{DoxyCompactList}\item 
bool {\bf \-\_\-ref\-At\-P\-C\-A}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_aac250f5ddde13f49386fb9676b7ca49c}

\begin{DoxyCompactList}\small\item\em Use Pca as reference point (else 1. hit) \end{DoxyCompactList}\item 
bool {\bf \-\_\-time\-Pix\-Flag}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a4f4d55a4ec861936361936bc0ac9c001}

\begin{DoxyCompactList}\small\item\em Is timepix data. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Track finder based on Fast Hough Transformation. 

Fast Hough transformation to construct tracks from space points.

The average track direction is in (local) X direction. The measured coordinates have to be shifted and rescaled to\-: X-\/$>$u in [-\/1, +1], Y,Z -\/$>$ v,w in [-\/0.\-5, 0.\-5]. The resolution in v and w should be comparable. The track projections v(u), w(u) are parametrized by series of Legendre polynomials L\-\_\-i, in the (X\-Y) bending plane up to order 2 and in the (X\-Z) plane with order 1.\-:
\begin{DoxyItemize}
\item v(u) = a\-\_\-0 $\ast$ L\-\_\-0(u) + a\-\_\-1 $\ast$ L\-\_\-1(u) (+ a\-\_\-2 $\ast$\-L\-\_\-2(u))
\item w(u) = b\-\_\-0 $\ast$ L\-\_\-0(u) + b\-\_\-1 $\ast$ L\-\_\-1(u)
\item with L\-\_\-0(u) = 1., L\-\_\-1(u) = u, L\-\_\-2(u) = 1.\-5$\ast$u$\ast$u -\/ 0.\-5
\end{DoxyItemize}

The track parameters a\-\_\-i, b\-\_\-i are in [-\/0.\-5, +0.5] (the initial hypercube). Each space point defines 2 hyperplanes (v(u)-\/v\-\_\-meas=0, w(u)-\/w\-\_\-meas=0) in the 5 (or 4) dimensional parameter space (a\-\_\-i, b\-\_\-i) with normal vectors (L\-\_\-i(u), 0.) and (0., L\-\_\-i(u)). The unit normal vector is used to calculate the distance of a hyperplane to the center of a hypercube. They intersect if the absolute value of the distance times the largest component of the unit normal vector is smaller than 0.\-5. The root cube is recursivly split for each dimension in two child cubes. Only childs containing a minimum number of rows are considered further until the hit density in a cube is compatible with a single track. The search stops with the first found track candidate.

Extended for timepix data (allow multiple hits per row).


\begin{DoxyParams}{Parameters}
{\em \char`\"{}\-Input\-Hits\char`\"{}\-:string} & The name of the input collection of T\-P\-C hits (default\-: \char`\"{}\-T\-P\-C\-Hits\char`\"{}) \\
\hline
{\em \char`\"{}\-Output\-Tracks\char`\"{}\-:string} & The name of the output collection with the found tracks (default\-: \char`\"{}\-F\-H\-T\-Tracks\char`\"{}) \\
\hline
{\em \char`\"{}\-Center\-X\-Y\-Measurement\char`\"{}\-:double} & Center of X\-Y (anode plane) measurement (default 60.) \\
\hline
{\em \char`\"{}\-Range\-X\-Y\-Measurement\char`\"{}\-:double} & Range of X\-Y (anode plane) measurement (default 200.) \\
\hline
{\em \char`\"{}\-Center\-X\-Z\-Measurement\char`\"{}\-:double} & Center of X\-Y (drift time) measurement (default 300.) \\
\hline
{\em \char`\"{}\-Range\-X\-Z\-Measurement\char`\"{}\-:double} & Range of X\-Y (drift time) measurement (default 600.) \\
\hline
{\em \char`\"{}\-B\-Field\-Scale\-Factor\char`\"{}\-:double} & {\ttfamily Optional} parameter, scales magnetic field (map), use 1.\-0 (default) for field O\-N or 0.\-0 for field O\-F\-F \\
\hline
{\em \char`\"{}\-Use\-X\-Y\-Measurement\char`\"{}\-:bool} & {\ttfamily Optional} parameter, flag for using X\-Y (anode plane) measurement (default true) \\
\hline
{\em \char`\"{}\-Use\-X\-Z\-Measurement\char`\"{}\-:bool} & {\ttfamily Optional} parameter, flag for using X\-Z (drift time) measurement (default true) \\
\hline
{\em \char`\"{}\-Minimum\-Rows\char`\"{}\-:int} & {\ttfamily Optional} parameter, minimal number of (correlated) rows (default 8) \\
\hline
{\em \char`\"{}\-Maximum\-Row\-Difference\char`\"{}\-:int} & {\ttfamily Optional} parameter, row correation parameter (max. distance of correlated rows) (default 1) \\
\hline
{\em \char`\"{}\-Fraction\-Of\-Rows\char`\"{}\-:float} & {\ttfamily Optional} parameter, relative minimum cube content (rows $>$= fraction $\ast$ (correlated) rows) (default 0.\-8) \\
\hline
{\em \char`\"{}\-Maximum\-Cubes\char`\"{}\-:int} & {\ttfamily Optional} parameter, maximum number of (hyper) cubes to check (default 250) \\
\hline
{\em \char`\"{}\-Minimum\-Level\char`\"{}\-:int} & {\ttfamily Optional} parameter, minimum number of (hyper) cubes splittings (default 5) \\
\hline
{\em \char`\"{}\-Maximum\-Level\char`\"{}\-:int} & {\ttfamily Optional} parameter, maximum number of (hyper) cubes splittings (default 8) \\
\hline
{\em \char`\"{}\-Efficieny\-Cut\char`\"{}\-:float} & {\ttfamily Optional} parameter, minimum hit density (hits/tracklength) (default 0.\-8) \\
\hline
{\em \char`\"{}\-Purity\-Cut\char`\"{}\-:float} & {\ttfamily Optional} parameter, maximum hit density (hits/tracklength) (default 1.\-1) \\
\hline
{\em \char`\"{}\-Max\-Hits\-Per\-Row\char`\"{}\-:int} & {\ttfamily Optional} parameter, mximum number of hits per row (default 1) \\
\hline
{\em \char`\"{}\-Unused\-Hit\-Matching\-Chi2\-Cut\char`\"{}\-:double} & {\ttfamily Optional} parameter, Chi2 cut for matching unused hits in X\-Y and Z (default 20.) \\
\hline
{\em \char`\"{}\-Unused\-Hit\-Max\-Gap\-Cut\-:int} & {\ttfamily Optional} parameter, maximal (row) gap for matching unused hits in X\-Y and Z (default 4) \\
\hline
{\em \char`\"{}\-Encoded\-Module\-I\-D\char`\"{}\-:bool} & {\ttfamily Optional} parameter, flag for encoding of module I\-D in Cell\-I\-D0 (default true) \\
\hline
{\em \char`\"{}\-Reference\-Point\-At\-Pca\char`\"{}\-:bool} & {\ttfamily Optional} parameter, use P\-C\-A as reference point, else 1. hit (default false) \\
\hline
{\em \char`\"{}\-Time\-Pix\-Flag\char`\"{}\-:bool} & {\ttfamily Optional} parameter, is timepix data(default false)\\
\hline
\end{DoxyParams}
\begin{DoxyAuthor}{Author}
C. Kleinwort (140205)
\end{DoxyAuthor}
\begin{DoxyParagraph}{Credits\-:}
The processor skeleton was generated by the script {\ttfamily create\-Processor.\-py} 
\end{DoxyParagraph}
\begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]
\begin{DoxyItemize}
\item (average) track direction different from X direction ?
\item hit cleaning for segment creation ?
\item replace hard coded radial row number for timepix data ?
\end{DoxyItemize}\end{DoxyRefDesc}


A detailed description is available as {\tt lcnote} L\-C-\/\-T\-O\-O\-L-\/2014-\/006. 

\subsection{Member Function Documentation}
\index{marlintpc\-::\-Row\-Based\-Fast\-Hough\-Transformation\-Processor@{marlintpc\-::\-Row\-Based\-Fast\-Hough\-Transformation\-Processor}!process\-Event@{process\-Event}}
\index{process\-Event@{process\-Event}!marlintpc::RowBasedFastHoughTransformationProcessor@{marlintpc\-::\-Row\-Based\-Fast\-Hough\-Transformation\-Processor}}
\subsubsection[{process\-Event}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Row\-Based\-Fast\-Hough\-Transformation\-Processor\-::process\-Event (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{evt}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1RowBasedFastHoughTransformationProcessor_a4a6ed1be1722a204b949c93d47f5256e}


Process event. 


\begin{DoxyItemize}
\item Prepare input\-: map of rows with vectors of hits
\item While sufficient input (unused (correlated) rows)
\end{DoxyItemize}
\begin{DoxyEnumerate}
\item From unused hits get x range and number of (correlated) rows (row $<$= last\-Row + \-\_\-max\-Row\-Diff)
\item Build hyperplanes, root cube entries (distances)
\item Subdivide root cube
\item Process candidate
\end{DoxyEnumerate}
\begin{DoxyItemize}
\item Fill output collection. 
\end{DoxyItemize}

References \-\_\-bfield\-Scale\-Factor, \-\_\-center\-X\-Y, \-\_\-center\-X\-Z, \-\_\-eff\-Cut, \-\_\-encoded\-Module\-I\-D, \-\_\-frac\-Row, \-\_\-input\-Col\-Name, \-\_\-max\-Cube, \-\_\-max\-Gap, \-\_\-max\-Hits\-Per\-Row, \-\_\-max\-Level, \-\_\-max\-Row\-Diff, \-\_\-min\-Level, \-\_\-min\-Row, \-\_\-output\-Col\-Name, \-\_\-pur\-Cut, \-\_\-range\-X\-Y, \-\_\-range\-X\-Z, \-\_\-ref\-At\-P\-C\-A, \-\_\-time\-Pix\-Flag, \-\_\-unused\-Cut, \-\_\-use\-X\-Y, \-\_\-use\-X\-Z, marlintpc\-::rb\-\_\-\-Segment\-::add\-Hit(), marlintpc\-::rb\-\_\-\-Hyper\-Cube\-::divide(), marlintpc\-::rb\-\_\-\-Segment\-::fill\-Row\-Map(), marlintpc\-::rb\-\_\-\-Segment\-::get\-First\-Row(), marlintpc\-::rb\-\_\-\-Segment\-::get\-Hit\-List(), marlintpc\-::rb\-\_\-\-Segment\-::get\-Last\-Row(), marlintpc\-::rb\-\_\-\-Segment\-::get\-Ndf(), and marlintpc\-::rb\-\_\-\-Segment\-::match().



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Row\-Based\-Fast\-Hough\-Transformation\-Processor.\-h\item 
Row\-Based\-Fast\-Hough\-Transformation\-Processor.\-cc\end{DoxyCompactItemize}
