\section{marlintpc\-:\-:Ions\-In\-Voxels\-Processor Class Reference}
\label{classmarlintpc_1_1IonsInVoxelsProcessor}\index{marlintpc\-::\-Ions\-In\-Voxels\-Processor@{marlintpc\-::\-Ions\-In\-Voxels\-Processor}}


This processor takes all ions from the primary ionisation and stores there charges in voxels.  




{\ttfamily \#include $<$Ions\-In\-Voxels\-Processor.\-h$>$}

Inheritance diagram for marlintpc\-:\-:Ions\-In\-Voxels\-Processor\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classmarlintpc_1_1IonsInVoxelsProcessor}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual Processor $\ast$ {\bfseries new\-Processor} ()\label{classmarlintpc_1_1IonsInVoxelsProcessor_ac8799c5157e67cd5087bcf5ffb6ad5b3}

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

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

\begin{DoxyCompactList}\small\item\em Called for every event -\/ the working horse. \end{DoxyCompactList}\item 
virtual void {\bf end} ()\label{classmarlintpc_1_1IonsInVoxelsProcessor_a9451649043f3e4c147ecb01af1d5ec4d}

\begin{DoxyCompactList}\small\item\em Write the root file and close it porperly. \end{DoxyCompactList}\item 
int {\bf get\-Pad} (gear\-::\-Pad\-Row\-Layout2\-D const $\ast$pad\-Layout, Sim\-Tracker\-Hit $\ast$hit)\label{classmarlintpc_1_1IonsInVoxelsProcessor_abb95b1343ccffba77d25240928c5e518}

\begin{DoxyCompactList}\small\item\em Function to get the pad corresponding to a hit for the different pad layouts. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf fill\-Tree} (L\-C\-Collection\-Vec $\ast$output\-Voxel\-Collection)\label{classmarlintpc_1_1IonsInVoxelsProcessor_a306364d4a750e7afd1653aaf9e9a465e}

\begin{DoxyCompactList}\small\item\em a helper function to avoid code duplication. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::string {\bfseries \-\_\-input\-Ions\-Col\-Name}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a6b294fe4bc381a47aa87a0444832c534}

\item 
std\-::string {\bfseries \-\_\-output\-Voxel\-Col\-Name}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a39db779d854d34c058b74a7a9655d103}

\item 
gear\-::\-Pad\-Row\-Layout2\-D const $\ast$ {\bfseries \-\_\-pad\-Layout}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a696f2f8872199756628366396ec33943}

\item 
int {\bfseries \-\_\-pad\-Layout\-Type}\label{classmarlintpc_1_1IonsInVoxelsProcessor_aa8ff54949f64808dc2582bd3337760cd}

\item 
{\bf marlintpc\-::\-Voxel\-T\-P\-C} $\ast$ {\bfseries \-\_\-voxel\-T\-P\-C}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a49147217b8499bb232d535bc1767b064}

\item 
bool {\bf \-\_\-output\-Is\-Persistent}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a9f39c9e4600697ed60523f22fbeaba81}

\begin{DoxyCompactList}\small\item\em Flag whether to write the output to disk. \end{DoxyCompactList}\item 
int {\bf \-\_\-output\-Type}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a36cad684cf0dea69bfe94c6f579888f9}

\begin{DoxyCompactList}\small\item\em Output type\-: event based or total. \end{DoxyCompactList}\item 
int {\bfseries \-\_\-n\-Evt}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a6d993e2873bb9eaf1af6b48379c22bd0}

\item 
double {\bf \-\_\-bin\-Length}\label{classmarlintpc_1_1IonsInVoxelsProcessor_aff139a1485ac209edaaf8bd1c0b64b08}

\begin{DoxyCompactList}\small\item\em Length of the z\-Bins. \end{DoxyCompactList}\item 
double {\bf \-\_\-ionisation\-Energy}\label{classmarlintpc_1_1IonsInVoxelsProcessor_ac56b655c0506f60019b49bde3162bd5b}

\begin{DoxyCompactList}\small\item\em The mean ionisation energy in the gas. \end{DoxyCompactList}\item 
int {\bf \-\_\-write\-After\-N\-Events}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a6e5837499ed58147b85f3a4a7d6b02d5}

\begin{DoxyCompactList}\small\item\em Only write after n events (and summ up until then) \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-root\-File\-Name}\label{classmarlintpc_1_1IonsInVoxelsProcessor_ac58f9ecbcd8f03f3f22632b35eb13f50}

\begin{DoxyCompactList}\small\item\em Name of the file for the debug tree. \end{DoxyCompactList}\item 
double {\bfseries \-\_\-max\-Drift\-Length}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a35f4adfc748b2e227902de3240cef2f9}

\item 
std\-::vector$<$ double $>$ {\bf \-\_\-leaf\-\_\-charge\-Per\-Volume}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a2ee848a698cbd0f7bc4e9a9d115a3891}

\begin{DoxyCompactList}\small\item\em the charge per volume in the voxel (in C/mm$^\wedge$2) \end{DoxyCompactList}\item 
std\-::vector$<$ int $>$ {\bf \-\_\-leaf\-\_\-charge}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a2de61a6e7eeba9651e8412de2390ee06}

\begin{DoxyCompactList}\small\item\em charge per voxel \end{DoxyCompactList}\item 
std\-::vector$<$ int $>$ {\bf \-\_\-leaf\-\_\-pad\-Index}\label{classmarlintpc_1_1IonsInVoxelsProcessor_adf7e2a9369ebccc8e058d574fab97f10}

\begin{DoxyCompactList}\small\item\em the gear pad index \end{DoxyCompactList}\item 
std\-::vector$<$ int $>$ {\bf \-\_\-leaf\-\_\-z\-Index}\label{classmarlintpc_1_1IonsInVoxelsProcessor_ae47bd63412a394cdae3577ab6998ab9d}

\begin{DoxyCompactList}\small\item\em the z index \end{DoxyCompactList}\item 
std\-::vector$<$ double $>$ {\bfseries \-\_\-leaf\-\_\-x}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a648bd87e625ec80f50ba8cbe656e3df6}

\item 
std\-::vector$<$ double $>$ {\bfseries \-\_\-leaf\-\_\-y}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a859cbd75dabad6ca5c5731bee8dc9911}

\item 
std\-::vector$<$ double $>$ {\bf \-\_\-leaf\-\_\-z}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a5b7e43ab7727a436451256ac023058a4}

\begin{DoxyCompactList}\small\item\em the coordinates of the voxel centre \end{DoxyCompactList}\item 
T\-Tree $\ast$ {\bfseries \-\_\-charge\-In\-Voxels\-Tree}\label{classmarlintpc_1_1IonsInVoxelsProcessor_adcd06d9e41d8f05b771305b1753d9813}

\item 
T\-File $\ast$ {\bfseries \-\_\-root\-File}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a2136a91a3e710b88423dea99ec9e8b6e}

\item 
bool {\bfseries \-\_\-use\-Negative\-Half}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a4c58f209e9e496cc7b0a573860f3f9b3}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
This processor takes all ions from the primary ionisation and stores there charges in voxels. 

The binning of the voxels is given in the x,y-\/plane by the pads of the readout plane. The length of the voxel in the z-\/direction can be chosen via the steering file. For storing and management of the voxels the helper class \doxyref{Voxel\-T\-P\-C}{p.}{classmarlintpc_1_1VoxelTPC} is used. Output collections contain the charges of all the ions which emerged to the given event or all ions which appeared up to the given events in the T\-P\-C.

A root tree for debugging can be written out. This happens for every event if Output\-Type==0 or once at the end if Output\-Type==1. I case Write\-After\-N\-Events is turned on, the tree is also written after n events.

\subparagraph*{Input -\/ Prerequisites}

Collection of Sim\-Tracker\-Hits with charge values set as d\-Edx

\subparagraph*{Output}

Collection containing the charges of the primary ions in T\-P\-C\-Voxels.


\begin{DoxyParams}{Parameters}
{\em Input\-Collection\-Name} & Name of input collection, Sim\-Tracker\-Hits \\
\hline
{\em Output\-Collection\-Name} & Name of output collection, \doxyref{T\-P\-C\-Voxel}{p.}{classmarlintpc_1_1TPCVoxel} \\
\hline
{\em Write\-Output\-To\-Storage} & If true the output collection is written (default\-: true) \\
\hline
{\em Output\-Type} & If 0 only ions from one event are written, else all events are summed up (default 0) \\
\hline
{\em Bin\-Length} & Length of the bins in z direction ( default\-: 2.\-5 mm) \\
\hline
{\em Ionisation\-Energy} & The energy in Ge\-V needed to ionize a gas particle (default\-: 26.\-E-\/9 = Argon) \\
\hline
{\em Write\-After\-N\-Events} & Force readout of the full T\-P\-C after overlaying n events (optional) Forses the Output\-Type to 1 \\
\hline
{\em Write\-Root\-File} & File name for a root tree with the charge per voxel for debugging (optional) \\
\hline
{\em Use\-Negative\-Half\-T\-P\-C} & Use the negative instead of the positive half T\-P\-C (default\-: false)\\
\hline
\end{DoxyParams}
\begin{DoxyAuthor}{Author}
Thorsten Krautscheid (University of Bonn) 

Martin Killenberg (C\-E\-R\-N) 
\end{DoxyAuthor}


\subsection{Member Function Documentation}
\index{marlintpc\-::\-Ions\-In\-Voxels\-Processor@{marlintpc\-::\-Ions\-In\-Voxels\-Processor}!init@{init}}
\index{init@{init}!marlintpc::IonsInVoxelsProcessor@{marlintpc\-::\-Ions\-In\-Voxels\-Processor}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Ions\-In\-Voxels\-Processor\-::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1IonsInVoxelsProcessor_a2d730ac12435a16383d43a3f2a3cdf6a}


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

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

References \-\_\-bin\-Length, \-\_\-leaf\-\_\-charge, \-\_\-leaf\-\_\-charge\-Per\-Volume, \-\_\-leaf\-\_\-pad\-Index, \-\_\-leaf\-\_\-z, \-\_\-leaf\-\_\-z\-Index, \-\_\-output\-Type, and \-\_\-root\-File\-Name.



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