\section{marlintpc\-:\-:Hit\-Candidate Class Reference}
\label{classmarlintpc_1_1HitCandidate}\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}}


A helper class for hit parameter calculation.  




{\ttfamily \#include $<$Hit\-Candidate.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Hit\-Candidate} (const gear\-::\-T\-P\-C\-Parameters \&tpc\-Params, double v\-Drift, E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$pulse=0)
\begin{DoxyCompactList}\small\item\em The constructor needs a reference to T\-P\-C\-Parameters and the dirft velocity Optionally the first pulse can be given. \end{DoxyCompactList}\item 
void {\bf add\-Pulse} (E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$)\label{classmarlintpc_1_1HitCandidate_aebfb11be5782016fc1de7fa5410c02e9}

\begin{DoxyCompactList}\small\item\em Add a pulse to the hit. \end{DoxyCompactList}\item 
void {\bfseries add\-Dead\-Pad} ()\label{classmarlintpc_1_1HitCandidate_ad356faa2e9a073896964f6ec09ff58f9}

\item 
void {\bf set\-Boundary\-Flag} ()\label{classmarlintpc_1_1HitCandidate_ad2caf5edbac00b4d324e258cf56ee0df}

\begin{DoxyCompactList}\small\item\em Manually turn on the boundary flag. \end{DoxyCompactList}\item 
const E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$ {\bf get\-Maximum\-Pulse} () const \label{classmarlintpc_1_1HitCandidate_a380351ebf07a3036a0dab696c06bdd28}

\begin{DoxyCompactList}\small\item\em Return the highest pulse in this hit. \end{DoxyCompactList}\item 
double {\bf get\-Charge} ()\label{classmarlintpc_1_1HitCandidate_ab6a12e71a91d1770554ed16d554a24dc}

\begin{DoxyCompactList}\small\item\em Get the overall charge in the hit. \end{DoxyCompactList}\item 
double {\bf get\-Max\-Pulse\-Height} () const \label{classmarlintpc_1_1HitCandidate_a25b59dde625555e87af93945ad35ad4f}

\begin{DoxyCompactList}\small\item\em Get the maximal pulse heigt in this hit. \end{DoxyCompactList}\item 
const std\-::vector\\*
$<$ E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$ $>$ \& {\bf get\-Pulses} () const \label{classmarlintpc_1_1HitCandidate_afe2e987757da4372b223f7f647e1b48a}

\begin{DoxyCompactList}\small\item\em Get a vector with the pulses contributing to this hits candidate. \end{DoxyCompactList}\item 
unsigned int {\bf get\-Width} () const 
\begin{DoxyCompactList}\small\item\em Return the number of pulses contributing to this hits candidate. \end{DoxyCompactList}\item 
bool {\bf is\-At\-Boundary} () const 
\begin{DoxyCompactList}\small\item\em Return whether the hit contains pulses on the boundary pads of a module. \end{DoxyCompactList}\item 
double {\bf get\-Local\-Fixed\-Coordinate} ()\label{classmarlintpc_1_1HitCandidate_a768259111d71423c82342202d3edbb85}

\begin{DoxyCompactList}\small\item\em Get the middle of the pad row (y or r) \end{DoxyCompactList}\item 
double {\bf get\-Local\-Free\-Coordinate} ()\label{classmarlintpc_1_1HitCandidate_a8b78ee98cb70b3befca29537937892f8}

\begin{DoxyCompactList}\small\item\em Get the coordinate along the pad row (x or phi) \end{DoxyCompactList}\item 
double {\bf get\-Z\-Coordinate} ()\label{classmarlintpc_1_1HitCandidate_ad08507444c6b8475751f4975f265fb82}

\begin{DoxyCompactList}\small\item\em Get the z coordinate. \end{DoxyCompactList}\item 
double {\bf get\-Local\-Fixed\-Variance} ()\label{classmarlintpc_1_1HitCandidate_a19fca94e6f0de1c2de655883ee8bcfd5}

\begin{DoxyCompactList}\small\item\em Get the variance (estimated error) perpendicular to the pad row (y or r) \end{DoxyCompactList}\item 
double {\bf get\-Local\-Free\-Variance} ()\label{classmarlintpc_1_1HitCandidate_ae8127b2e6a15b28c0935cd05f80e0027}

\begin{DoxyCompactList}\small\item\em Get the variance (estimated error) along the pad row (in x or phi) \end{DoxyCompactList}\item 
double {\bf get\-Local\-Skewness} ()\label{classmarlintpc_1_1HitCandidate_ac11f76a2399b8a00afc8f85faec72b3a}

\begin{DoxyCompactList}\small\item\em Get the skewness along the pad row. \end{DoxyCompactList}\item 
double {\bf get\-Z\-Variance} ()\label{classmarlintpc_1_1HitCandidate_ae76ef036b4bb1d0d9c303561ba4a8052}

\begin{DoxyCompactList}\small\item\em Get the variance (estimated error) in z. \end{DoxyCompactList}\item 
lcio\-::\-Double\-Vec {\bf get\-Local\-Coordinates} ()
\begin{DoxyCompactList}\small\item\em Get the local coordinates (polar or cartesian, depending on the pad plane). \end{DoxyCompactList}\item 
lcio\-::\-Double\-Vec {\bf get\-Global\-Coordinates} ()
\begin{DoxyCompactList}\small\item\em Get the global coordinates (polar or cartesian, depending on the coordinate system). \end{DoxyCompactList}\item 
lcio\-::\-Double\-Vec {\bf get\-Global\-Cartesian\-Coordinates} ()
\begin{DoxyCompactList}\small\item\em Get the global coordinates in cartesian format (in lcio it is always cartesian). \end{DoxyCompactList}\item 
lcio\-::\-Float\-Vec {\bf get\-Global\-Covariance\-Matrix} ()
\begin{DoxyCompactList}\small\item\em Get the covariance matrix in global coordinates (polar or cartesian, depending on the coordinate system). \end{DoxyCompactList}\item 
lcio\-::\-Float\-Vec {\bf get\-Global\-Cartecian\-Covariance\-Matrix} ()
\begin{DoxyCompactList}\small\item\em Get the global covariance matrix in cartesian coordinates. \end{DoxyCompactList}\item 
I\-M\-P\-L\-::\-Tracker\-Hit\-Impl $\ast$ {\bf create\-Tracker\-Hit} ()\label{classmarlintpc_1_1HitCandidate_a6cbe71284cfeedb31e03ce6b136ee4af}

\begin{DoxyCompactList}\small\item\em Convenience function that allocates a new Tracker\-Hit\-Impl in memory, sets all parameters and adds the pulses in this \doxyref{Hit\-Candidate}{p.}{classmarlintpc_1_1HitCandidate}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf calculate\-Hit\-Properties} ()
\begin{DoxyCompactList}\small\item\em (re)calculate the properties of this hit candidate \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::vector\\*
$<$ E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$ $>$ {\bfseries \-\_\-the\-Pulses}\label{classmarlintpc_1_1HitCandidate_a937d195ed628f2f2a27ae8b8e602f6b1}

\item 
E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$ {\bfseries \-\_\-max\-Pulse}\label{classmarlintpc_1_1HitCandidate_a7dc2266e8c6d8f76ffe5c2ff25a0fdb6}

\item 
double {\bfseries \-\_\-max\-Pulse\-Charge}\label{classmarlintpc_1_1HitCandidate_ac23da69cd068e4386362b16098eed013}

\item 
int {\bfseries \-\_\-number\-Of\-Dead\-Pads}\label{classmarlintpc_1_1HitCandidate_acaae13ad2aa2f6fdff8256190e6ddd7d}

\item 
bool {\bfseries \-\_\-is\-At\-Boundary}\label{classmarlintpc_1_1HitCandidate_a999389951fe361eb14982c13ae40b50f}

\item 
double {\bfseries \-\_\-v\-Drift}\label{classmarlintpc_1_1HitCandidate_a26b0941cd5d4b1cf79f03120f30b4c5f}

\item 
double {\bfseries \-\_\-z\-Anode}\label{classmarlintpc_1_1HitCandidate_a6ce9b07b129dd274864784befe2b4e22}

\item 
const gear\-::\-T\-P\-C\-Parameters \& {\bfseries \-\_\-tpc\-Parameters}\label{classmarlintpc_1_1HitCandidate_ab4927ac260271638d0f749e958b841d4}

\item 
const gear\-::\-T\-P\-C\-Module $\ast$ {\bfseries \-\_\-tpc\-Module}\label{classmarlintpc_1_1HitCandidate_a5462e383abeacf3b94dc96286dd919f4}

\item 
lcio\-::\-Double\-Vec {\bfseries \-\_\-local\-Coordinates}\label{classmarlintpc_1_1HitCandidate_ae300e968e5b91d6ee93f22988efd5e99}

\item 
lcio\-::\-Double\-Vec {\bfseries \-\_\-global\-Coordinates}\label{classmarlintpc_1_1HitCandidate_a5c574af53e94a8645ce9050d8b6fbce2}

\item 
lcio\-::\-Float\-Vec {\bfseries \-\_\-global\-Covariance}\label{classmarlintpc_1_1HitCandidate_ab79077b3a118574f9eb07ff56bcb69cb}

\item 
double {\bfseries \-\_\-charge}\label{classmarlintpc_1_1HitCandidate_abe25095d3d3f5a2d94b6758ff954089a}

\item 
double {\bfseries \-\_\-local\-Fixed\-Variance}\label{classmarlintpc_1_1HitCandidate_aede6bbafa1c45f92bb92f98abcea6ff3}

\item 
double {\bfseries \-\_\-local\-Free\-Variance}\label{classmarlintpc_1_1HitCandidate_af274e4274b4151db7733aeb731e79268}

\item 
double {\bf \-\_\-local\-Skewness}\label{classmarlintpc_1_1HitCandidate_a2a51f9606cbe95539f8af09a2c341a92}

\begin{DoxyCompactList}\small\item\em The skewness in local coordinates. \end{DoxyCompactList}\item 
double {\bfseries \-\_\-z\-Variance}\label{classmarlintpc_1_1HitCandidate_a1836408b174b028825351cfe236a6d88}

\item 
bool {\bfseries \-\_\-hit\-Parameters\-Are\-Valid}\label{classmarlintpc_1_1HitCandidate_a7889ed95470d1754566b9539175de218}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A helper class for hit parameter calculation. 

It contains a vector of pulses and functions to calculate coordinates and errors. This functionality is needed at several places, so it has been decoupled from the processors to avoid code duplication.

\begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]F\-I\-X\-M\-E\-: Calculation of covariance matrix is missing, currently is unity. It should be the estimated error of the coordinates, not the varianve of the charge distribution. \end{DoxyRefDesc}


\subsection{Constructor \& Destructor Documentation}
\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!Hit\-Candidate@{Hit\-Candidate}}
\index{Hit\-Candidate@{Hit\-Candidate}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{Hit\-Candidate}]{\setlength{\rightskip}{0pt plus 5cm}marlintpc\-::\-Hit\-Candidate\-::\-Hit\-Candidate (
\begin{DoxyParamCaption}
\item[{const gear\-::\-T\-P\-C\-Parameters \&}]{tpc\-Params, }
\item[{double}]{v\-Drift, }
\item[{E\-V\-E\-N\-T\-::\-Tracker\-Pulse $\ast$}]{pulse = {\ttfamily 0}}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1HitCandidate_a508ceb6382946c892c5594e00da7090d}


The constructor needs a reference to T\-P\-C\-Parameters and the dirft velocity Optionally the first pulse can be given. 



\subsection{Member Function Documentation}
\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!calculate\-Hit\-Properties@{calculate\-Hit\-Properties}}
\index{calculate\-Hit\-Properties@{calculate\-Hit\-Properties}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{calculate\-Hit\-Properties}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Hit\-Candidate\-::calculate\-Hit\-Properties (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1HitCandidate_ac2459e1dbe03ff06569a78b24dbd189b}


(re)calculate the properties of this hit candidate 

Implement calcuclation of errors 

Referenced by create\-Tracker\-Hit(), get\-Charge(), get\-Global\-Coordinates(), get\-Global\-Covariance\-Matrix(), get\-Local\-Coordinates(), get\-Local\-Fixed\-Coordinate(), get\-Local\-Fixed\-Variance(), get\-Local\-Free\-Coordinate(), get\-Local\-Free\-Variance(), get\-Z\-Coordinate(), and get\-Z\-Variance().

\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!get\-Global\-Cartecian\-Covariance\-Matrix@{get\-Global\-Cartecian\-Covariance\-Matrix}}
\index{get\-Global\-Cartecian\-Covariance\-Matrix@{get\-Global\-Cartecian\-Covariance\-Matrix}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{get\-Global\-Cartecian\-Covariance\-Matrix}]{\setlength{\rightskip}{0pt plus 5cm}lcio\-::\-Float\-Vec marlintpc\-::\-Hit\-Candidate\-::get\-Global\-Cartecian\-Covariance\-Matrix (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1HitCandidate_a11968af9935fdd94b3ecedfe263cb3a8}


Get the global covariance matrix in cartesian coordinates. 

This is what will be in the lcio hit \index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!get\-Global\-Cartesian\-Coordinates@{get\-Global\-Cartesian\-Coordinates}}
\index{get\-Global\-Cartesian\-Coordinates@{get\-Global\-Cartesian\-Coordinates}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{get\-Global\-Cartesian\-Coordinates}]{\setlength{\rightskip}{0pt plus 5cm}lcio\-::\-Double\-Vec marlintpc\-::\-Hit\-Candidate\-::get\-Global\-Cartesian\-Coordinates (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1HitCandidate_ad9f7326a5b9a355a4354bfc546420fed}


Get the global coordinates in cartesian format (in lcio it is always cartesian). 

\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!get\-Global\-Coordinates@{get\-Global\-Coordinates}}
\index{get\-Global\-Coordinates@{get\-Global\-Coordinates}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{get\-Global\-Coordinates}]{\setlength{\rightskip}{0pt plus 5cm}lcio\-::\-Double\-Vec marlintpc\-::\-Hit\-Candidate\-::get\-Global\-Coordinates (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1HitCandidate_a0ecbf0f88f20fd77c2ecdbd2d87dadf6}


Get the global coordinates (polar or cartesian, depending on the coordinate system). 



References calculate\-Hit\-Properties().

\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!get\-Global\-Covariance\-Matrix@{get\-Global\-Covariance\-Matrix}}
\index{get\-Global\-Covariance\-Matrix@{get\-Global\-Covariance\-Matrix}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{get\-Global\-Covariance\-Matrix}]{\setlength{\rightskip}{0pt plus 5cm}lcio\-::\-Float\-Vec marlintpc\-::\-Hit\-Candidate\-::get\-Global\-Covariance\-Matrix (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1HitCandidate_a654bb4ed2562dc5c2193c362597afadd}


Get the covariance matrix in global coordinates (polar or cartesian, depending on the coordinate system). 



References calculate\-Hit\-Properties().

\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!get\-Local\-Coordinates@{get\-Local\-Coordinates}}
\index{get\-Local\-Coordinates@{get\-Local\-Coordinates}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{get\-Local\-Coordinates}]{\setlength{\rightskip}{0pt plus 5cm}lcio\-::\-Double\-Vec marlintpc\-::\-Hit\-Candidate\-::get\-Local\-Coordinates (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1HitCandidate_ae570ed648758681def668c41d8c4b1e6}


Get the local coordinates (polar or cartesian, depending on the pad plane). 



References calculate\-Hit\-Properties().

\index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!get\-Width@{get\-Width}}
\index{get\-Width@{get\-Width}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{get\-Width}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int marlintpc\-::\-Hit\-Candidate\-::get\-Width (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}\label{classmarlintpc_1_1HitCandidate_a212bd1181494b240c72448c7070750f2}


Return the number of pulses contributing to this hits candidate. 

This might not be the real width if there are multiple pulses per channel. \index{marlintpc\-::\-Hit\-Candidate@{marlintpc\-::\-Hit\-Candidate}!is\-At\-Boundary@{is\-At\-Boundary}}
\index{is\-At\-Boundary@{is\-At\-Boundary}!marlintpc::HitCandidate@{marlintpc\-::\-Hit\-Candidate}}
\subsubsection[{is\-At\-Boundary}]{\setlength{\rightskip}{0pt plus 5cm}bool marlintpc\-::\-Hit\-Candidate\-::is\-At\-Boundary (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}\label{classmarlintpc_1_1HitCandidate_a37ff327241ec82938e9ec7768547106a}


Return whether the hit contains pulses on the boundary pads of a module. 

Currently this flag has to be set manually \begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]F\-I\-X\-M\-E\-: Calculation of boudary condition should be done automatically when adding a pulse \end{DoxyRefDesc}


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