\section{marlintpc\-:\-:Pulse\-Finder\-Tester Class Reference}
\label{classmarlintpc_1_1PulseFinderTester}\index{marlintpc\-::\-Pulse\-Finder\-Tester@{marlintpc\-::\-Pulse\-Finder\-Tester}}


A class which is friend of \doxyref{Pulse\-Finder}{p.}{classmarlintpc_1_1PulseFinder} so it can access the protected members for testing.  




{\ttfamily \#include $<$Pulse\-Finder\-Tester.\-h$>$}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct {\bf Candidate\-Properties}
\begin{DoxyCompactList}\small\item\em A reference consists of a vector of \doxyref{Iterator\-Properties}{p.}{structmarlintpc_1_1PulseFinderTester_1_1IteratorProperties} structs and the corresponding begin and end iterators of the data vectors. \end{DoxyCompactList}\item 
struct {\bf Iterator\-Properties}
\begin{DoxyCompactList}\small\item\em A helper struct to store the distance to the begin iterator and the value which should be at the iterator position. \end{DoxyCompactList}\item 
struct {\bf Pulse\-Properties}
\begin{DoxyCompactList}\small\item\em A struct to store the pulse properties we are checking. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Pulse\-Finder\-Tester} ()\label{classmarlintpc_1_1PulseFinderTester_ac871c5c7a7c80399017b02287daec567}

\begin{DoxyCompactList}\small\item\em The constructor. \end{DoxyCompactList}\item 
{\bf $\sim$\-Pulse\-Finder\-Tester} ()\label{classmarlintpc_1_1PulseFinderTester_a5c76281996bbb1e3646b500e1b76a005}

\begin{DoxyCompactList}\small\item\em The destructor. \end{DoxyCompactList}\item 
int {\bf run\-All\-Tests} ()
\begin{DoxyCompactList}\small\item\em Run all tests and return the number of failed tests. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
bool {\bf evaluate\-Brute\-Search\-Result} (std\-::vector$<$ std\-::pair$<$ std\-::vector$<$ float $>$\-::const\-\_\-iterator, std\-::vector$<$ float $>$\-::const\-\_\-iterator $>$ $>$ const \&brute\-Search\-Result, std\-::vector$<$ {\bf Iterator\-Properties} $>$ const \&reference\-Values, std\-::vector$<$ float $>$\-::const\-\_\-iterator begin\-Iterator, std\-::vector$<$ float $>$\-::const\-\_\-iterator end\-Iterator)
\begin{DoxyCompactList}\small\item\em this function gets the search result of the brute search and compares it to the reference values given. \end{DoxyCompactList}\item 
bool {\bfseries evaluate\-Split\-Result} (std\-::vector$<$ {\bf Pulse\-Finder\-::\-Internal\-Split\-Pulse} $>$ const \&split\-Result, std\-::vector$<$ {\bf Iterator\-Properties} $>$ const \&reference\-Values, std\-::vector$<$ float $>$\-::const\-\_\-iterator begin\-Iterator, std\-::vector$<$ float $>$\-::const\-\_\-iterator end\-Iterator)\label{classmarlintpc_1_1PulseFinderTester_aeee0b3081f071d88441ca26a35ebf0ab}

\item 
bool {\bfseries evaluate\-Pulse\-Candidate} (std\-::vector$<$ std\-::pair$<$ Tracker\-Data\-Impl $\ast$, int $>$ $>$ candidates, std\-::vector$<$ {\bf Candidate\-Properties} $>$ const \&reference\-Candidate\-Properties)\label{classmarlintpc_1_1PulseFinderTester_a857804670d79f01ffe9ebf483294a0da}

\item 
bool {\bfseries evaluate\-Pulses} (std\-::vector$<$ Tracker\-Pulse $\ast$ $>$ const \&pulses, std\-::vector$<$ {\bf Pulse\-Properties} $>$ const \&reference\-Pulse\-Properties)\label{classmarlintpc_1_1PulseFinderTester_ae5584d9f23bbec8a168903e4c79f896c}

\item 
bool {\bf evaluate\-Plateau\-Cutoff} (std\-::vector$<$ Tracker\-Pulse $\ast$ $>$ const \&pulses, std\-::vector$<$ std\-::pair$<$ size\-\_\-t, size\-\_\-t $>$ $>$ const \&reference\-Positions, E\-V\-E\-N\-T\-::\-Float\-Vec const \&reference\-A\-D\-C\-Values)
\begin{DoxyCompactList}\small\item\em Compare the adc values in the pulses to the reference\-A\-D\-C\-Values. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
{\bf Pulse\-Finder} $\ast$ {\bfseries \-\_\-pulse\-Finder}\label{classmarlintpc_1_1PulseFinderTester_a2198c6268db43b15fe298062059f2a90}

\item 
{\bf Pulse\-Finder} $\ast$ {\bfseries \-\_\-pulse\-Finder\-Pre\-Post\-Plateau}\label{classmarlintpc_1_1PulseFinderTester_af8d0661ad59a32cbccf2787bc28b58ea}

\item 
float {\bf \-\_\-readout\-Frequency}\label{classmarlintpc_1_1PulseFinderTester_a3400a1a72f281195d8c8fa1eafbd5b78}

\begin{DoxyCompactList}\small\item\em The reference value. Has to be returned correctly. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A class which is friend of \doxyref{Pulse\-Finder}{p.}{classmarlintpc_1_1PulseFinder} so it can access the protected members for testing. 

\subsection{Member Function Documentation}
\index{marlintpc\-::\-Pulse\-Finder\-Tester@{marlintpc\-::\-Pulse\-Finder\-Tester}!evaluate\-Brute\-Search\-Result@{evaluate\-Brute\-Search\-Result}}
\index{evaluate\-Brute\-Search\-Result@{evaluate\-Brute\-Search\-Result}!marlintpc::PulseFinderTester@{marlintpc\-::\-Pulse\-Finder\-Tester}}
\subsubsection[{evaluate\-Brute\-Search\-Result}]{\setlength{\rightskip}{0pt plus 5cm}bool marlintpc\-::\-Pulse\-Finder\-Tester\-::evaluate\-Brute\-Search\-Result (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ std\-::pair$<$ std\-::vector$<$ float $>$\-::const\-\_\-iterator, std\-::vector$<$ float $>$\-::const\-\_\-iterator $>$ $>$ const \&}]{brute\-Search\-Result, }
\item[{std\-::vector$<$ {\bf Iterator\-Properties} $>$ const \&}]{reference\-Values, }
\item[{std\-::vector$<$ float $>$\-::const\-\_\-iterator}]{begin\-Iterator, }
\item[{std\-::vector$<$ float $>$\-::const\-\_\-iterator}]{end\-Iterator}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1PulseFinderTester_a0a0f9aa0257b954eea7fa3330c16ac5b}


this function gets the search result of the brute search and compares it to the reference values given. 

Returns true if all values are ok. 

Referenced by run\-All\-Tests().

\index{marlintpc\-::\-Pulse\-Finder\-Tester@{marlintpc\-::\-Pulse\-Finder\-Tester}!evaluate\-Plateau\-Cutoff@{evaluate\-Plateau\-Cutoff}}
\index{evaluate\-Plateau\-Cutoff@{evaluate\-Plateau\-Cutoff}!marlintpc::PulseFinderTester@{marlintpc\-::\-Pulse\-Finder\-Tester}}
\subsubsection[{evaluate\-Plateau\-Cutoff}]{\setlength{\rightskip}{0pt plus 5cm}bool marlintpc\-::\-Pulse\-Finder\-Tester\-::evaluate\-Plateau\-Cutoff (
\begin{DoxyParamCaption}
\item[{std\-::vector$<$ Tracker\-Pulse $\ast$ $>$ const \&}]{pulses, }
\item[{std\-::vector$<$ std\-::pair$<$ size\-\_\-t, size\-\_\-t $>$ $>$ const \&}]{reference\-Positions, }
\item[{E\-V\-E\-N\-T\-::\-Float\-Vec const \&}]{reference\-A\-D\-C\-Values}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1PulseFinderTester_ad354780f53ac48cd96ab12765548b370}


Compare the adc values in the pulses to the reference\-A\-D\-C\-Values. 

The positions (first and last sample) are given in the reference\-Positions. As usual the last sample points to the position after the last sample in the pulse. Only to be used with plateau pulses (checks on the flag and requires the spectrum to be saved). 

Referenced by run\-All\-Tests().

\index{marlintpc\-::\-Pulse\-Finder\-Tester@{marlintpc\-::\-Pulse\-Finder\-Tester}!run\-All\-Tests@{run\-All\-Tests}}
\index{run\-All\-Tests@{run\-All\-Tests}!marlintpc::PulseFinderTester@{marlintpc\-::\-Pulse\-Finder\-Tester}}
\subsubsection[{run\-All\-Tests}]{\setlength{\rightskip}{0pt plus 5cm}int marlintpc\-::\-Pulse\-Finder\-Tester\-::run\-All\-Tests (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PulseFinderTester_ac30d8efd994980b0331bff52ab9d6df8}


Run all tests and return the number of failed tests. 

This is the variance, which is not the error. No idea how to calculate it correctly float reference\-Time\-Error\-Derivative\-Method = sqrt( 20$\ast$20$\ast$(6.-\/mean\-Bin)$\ast$(6.-\/mean\-Bin)
\begin{DoxyItemize}
\item 100$\ast$100$\ast$(7.-\/mean\-Bin)$\ast$(7.-\/mean\-Bin)
\item 55$\ast$55$\ast$(8.-\/mean\-Bin)$\ast$(8.-\/mean\-Bin) ) / (20.+100.+55.)$\ast$ 1\-E3 / \-\_\-readout\-Frequency; //conversion to ns
\end{DoxyItemize}

\begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]\-: \doxyref{Pulse\-Finder\-Tester}{p.}{classmarlintpc_1_1PulseFinderTester}\-: calculate correct time error and test it \end{DoxyRefDesc}


\begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]\-: \doxyref{Pulse\-Finder\-Tester}{p.}{classmarlintpc_1_1PulseFinderTester}\-: calculate correct charge error and test it \end{DoxyRefDesc}


\begin{DoxyRefDesc}{Todo}
\item[{\bf Todo}]\-: \doxyref{Pulse\-Finder\-Tester}{p.}{classmarlintpc_1_1PulseFinderTester}\-: calculate expected charge fit value and test it \end{DoxyRefDesc}


References marlintpc\-::\-Pulse\-Finder\-::\-\_\-noise\-Value\-Pedestal\-Width\-Factor, \-\_\-readout\-Frequency, marlintpc\-::\-Pulse\-Finder\-::brute\-Pulse\-Search(), marlintpc\-::\-Pulse\-Finder\-::calc\-Pulse\-Charge\-Max\-Q(), marlintpc\-::\-Pulse\-Finder\-::calc\-Pulse\-Charge\-Sum\-Q(), marlintpc\-::\-Pulse\-Finder\-::calc\-Pulse\-Time\-At\-Maximum(), marlintpc\-::\-Pulse\-Finder\-::calc\-Pulse\-Time\-Centre\-Of\-Gravity(), marlintpc\-::\-Pulse\-Finder\-::calc\-Pulse\-Time\-First\-Bin\-Above\-Threshold(), marlintpc\-::\-Pulse\-Finder\-::calc\-Pulse\-Time\-Inflexion\-Point(), marlintpc\-::\-Pulse\-Finder\-::calculate\-Pulse\-With\-Fit(), evaluate\-Brute\-Search\-Result(), evaluate\-Plateau\-Cutoff(), marlintpc\-::\-Pulse\-Finder\-::find\-Pulse\-Candidates(), marlintpc\-::\-Pulse\-Finder\-::find\-Pulses(), marlintpc\-::\-Pulse\-Finder\-::get\-Pedestal\-Width(), marlintpc\-::\-Pulse\-Finder\-::set\-Force\-Spectrum\-Save(), and marlintpc\-::\-Pulse\-Finder\-::split\-Multiple\-Pulses().



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