\section{marlintpc\-:\-:Row\-Based\-Hit\-Finder\-Processor Class Reference}
\label{classmarlintpc_1_1RowBasedHitFinderProcessor}\index{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor@{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor}}


A hit finder for row based (pad) geometries It searches for connected pulses in a row and combines them into a hit.  




{\ttfamily \#include $<$Row\-Based\-Hit\-Finder\-Processor.\-h$>$}

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

\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_1RowBasedHitFinderProcessor_ae840ccea545e2c862fe99d1272ab6fab}

\begin{DoxyCompactList}\small\item\em Called for every run. \end{DoxyCompactList}\item 
virtual void {\bf process\-Event} (lcio\-::\-L\-C\-Event $\ast$evt)
\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_1RowBasedHitFinderProcessor_a4ffcb171b92dd464373571d6dc0af4e2}

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

\begin{DoxyCompactList}\small\item\em Called after data processing for clean up. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A hit finder for row based (pad) geometries It searches for connected pulses in a row and combines them into a hit. 

The position inside the row is calculated by a center-\/of-\/gravity w.\-r.\-t. to the charge of the individual pulses. The position on the row is fixed by the r/y coordinate of the row. The z-\/position is inherited from the pulse with the highest charge within the hit.

\begin{DoxyAuthor}{Author}
Christoph Rosemann, D\-E\-S\-Y
\end{DoxyAuthor}
\subparagraph*{Input -\/ Prerequisites}

\begin{DoxyItemize}
\item Tracker\-Pulse collection \item \doxyref{tpcconddata\-::\-T\-P\-C\-Conditions}{p.}{classtpcconddata_1_1TPCConditions} for the drift velicity (optionally provided as processor parameter) \begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]Hit quality flag (including inheritance of pulse flags) 

Handling of dead and noisy channels.\end{DoxyRefDesc}
\end{DoxyItemize}
\subparagraph*{Output}

\begin{DoxyItemize}
\item Tracker\-Hit collection\end{DoxyItemize}

\begin{DoxyParams}{Parameters}
{\em Input\-Tracker\-Pulses} & Name of input Tracker\-Pulses collection (default\-: T\-P\-C\-Pulses) \\
\hline
{\em Output\-Tracker\-Hits} & Name of output Tracker\-Hits collection (default\-: T\-P\-C\-Hits) \\
\hline
{\em Input\-T\-P\-C\-Conditions} & {\ttfamily O\-P\-T\-I\-O\-N\-A\-L\-:} Name of the input collection containing the T\-P\-C conditions data (default\-: tpcconddata\-::\-T\-P\-C\-Conditions\-::get\-Default\-Col\-Name() ) \\
\hline
{\em Write\-Output\-To\-Storage\-:bool} & If true the output collection is written to file (default\-: true) \\
\hline
{\em Charge\-Conversion\-Is\-Calibrated\-:bool} & Set true, if the charge conversion factor from A\-D\-C values to primary electrons is known (default\-:true). \\
\hline
{\em Max\-Empty\-Pads\-Override} & Maximum number of consecutive empty pads in a row (default\-: 1) \\
\hline
{\em Min\-Hit\-Size\-Override} & Minimum size of hit in number of pads (default\-: 1) \\
\hline
{\em Min\-Max\-Pulse\-Slice\-Height\-Overrid} & Minimum size of the maximum pulse slice of the highest pulse in the hit (default\-: 12.) \\
\hline
{\em Max\-Time\-Spread\-Override} & Maximum time between pulses in a hit [in ns] (default\-: 200) \\
\hline
{\em V\-Drift\-Override} & {\ttfamily O\-P\-T\-I\-O\-N\-A\-L\-:} Set drift velocity in case there is no conditions data [in mm/us] (default\-: 0) \\
\hline
{\em Dead\-Pads\-Override} & {\ttfamily O\-P\-T\-I\-O\-N\-A\-L\-:} a vector of geometry indices of dead channels, default should be conditions data \\
\hline
{\em Charge\-Conversion\-Factor\-Override} & {\ttfamily O\-P\-T\-I\-O\-N\-A\-L} The factor to convert adc counts into number of primary electrons (-\/$>$ should be conditions data) \\
\hline
{\em Use\-Global\-Coordinates} & {\ttfamily O\-P\-T\-I\-O\-N\-A\-L} If set to true, the output coordinate system will be forced to global/cartesian; otherwise it is the local coordinate system of the pad plan (either polar or cartesian) (default\-: false)\\
\hline
\end{DoxyParams}
List of open issues/questions\-:
\begin{DoxyItemize}
\item extend debug output
\item incorporate damaged pad info
\item incorporate inheritance of pulse quality
\item separation of hits? +++ needs testing! 
\end{DoxyItemize}

\subsection{Member Function Documentation}
\index{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor@{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor}!init@{init}}
\index{init@{init}!marlintpc::RowBasedHitFinderProcessor@{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor\-::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1RowBasedHitFinderProcessor_a15442e044e1b749febd94c55d671782b}


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

Use to initialize the processor, e.\-g. book histograms. \index{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor@{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor}!process\-Event@{process\-Event}}
\index{process\-Event@{process\-Event}!marlintpc::RowBasedHitFinderProcessor@{marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor}}
\subsubsection[{process\-Event}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Row\-Based\-Hit\-Finder\-Processor\-::process\-Event (
\begin{DoxyParamCaption}
\item[{lcio\-::\-L\-C\-Event $\ast$}]{evt}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1RowBasedHitFinderProcessor_a95131d4bf1808b40cf5cb14adb6f1f8c}


Called for every event -\/ the working horse. 

the processor is supposed to find \char`\"{}hits\char`\"{} in \char`\"{}rows\char`\"{} input are pulses\-: (charge,time,module\-I\-D,cell\-I\-D + quality\-Flag) output are hits\-: ( [x,y,z] + covariance matrix, charge + quality\-Flag )

steering input\-: -\/ minimal hit size
\begin{DoxyItemize}
\item max number of dead/empty pads within a hit
\item max distance in z/time between pulses external input\-: -\/ dead pads
\item drift velocity
\item charge conversion factor
\end{DoxyItemize}

\begin{DoxyVerb}structurally this happens in a decomposition of:
(A) sort the pulses by module & row
(B) LOOP: look for pulses that belong together in a row (for all rows in a module, for all modules)
(C) create the "Hit" by calculating all numbers
\end{DoxyVerb}




 the basic data structure for the hit search is a single row; the row is a simple vector of the Pulse pointers\-: vector$<$\-Tracker\-Pulse$\ast$$>$

this is repeated for every (unique) row on a module -\/$>$ use a map of these repeat this for every possible module, since the module id is unique use a map

so the final data structure for the hit search is\-: map$<$int module\-I\-D, map$<$int row\-I\-D, vector$<$\-Tracker\-Pulse$\ast$$>$$\ast$ $>$ (no typedef is introduced, although arguably this might improve the readability)

a helper class is instantiated to hold the hit candidates\-: \char`\"{}hit\-Candidate\char`\"{} the temporary result of the hit candidate finding is stored in a vector of these the key is again a map -- since it is stored per /unique/ module

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