\section{marlintpc\-:\-:Charge\-Distribution\-Processor Class Reference}
\label{classmarlintpc_1_1ChargeDistributionProcessor}\index{marlintpc\-::\-Charge\-Distribution\-Processor@{marlintpc\-::\-Charge\-Distribution\-Processor}}


This processor takes the coordinates of the drifted electrons and the charge from amplification and smears the charge on the padplane.  




{\ttfamily \#include $<$Charge\-Distribution\-Processor.\-h$>$}

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

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

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

\begin{DoxyCompactList}\small\item\em Called for every event -\/ the working horse. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static std\-::list$<$ std\-::pair\\*
$<$ {\bf Voxel\-T\-P\-C\-::\-Voxel\-Index}, int $>$ $>$ $\ast$ {\bf fetch\-Voxel\-List} ()
\begin{DoxyCompactList}\small\item\em A function to directly get the voxels from the internal map. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::string {\bf \-\_\-input\-Collection\-Name}
\begin{DoxyCompactList}\small\item\em Input/output collection names. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-output\-Collection\-Name}\label{classmarlintpc_1_1ChargeDistributionProcessor_a6580523d4e5b98984296c33c80aa27e3}

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

\begin{DoxyCompactList}\small\item\em Name of collection containing the T\-P\-C\-Conditions. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-alt\-T\-P\-C\-Conditions\-Name}\label{classmarlintpc_1_1ChargeDistributionProcessor_a230d02c05a89818eacf39241eb6f4083}

\begin{DoxyCompactList}\small\item\em Name of the newly created T\-P\-C\-Conditons\-Collection if the original one is not writeable. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-gas}\label{classmarlintpc_1_1ChargeDistributionProcessor_a799194d846c2ecb02024222e48b129a6}

\begin{DoxyCompactList}\small\item\em Name of the gas mixture. \end{DoxyCompactList}\item 
float {\bf \-\_\-\-E\-Trans1}\label{classmarlintpc_1_1ChargeDistributionProcessor_adfa201d3acae04960a703b9c76353d3c}

\begin{DoxyCompactList}\small\item\em First transfer field. \end{DoxyCompactList}\item 
float {\bf \-\_\-\-E\-Trans2}\label{classmarlintpc_1_1ChargeDistributionProcessor_a77d329e36ff1f78f15f596b920fc0cb5}

\begin{DoxyCompactList}\small\item\em Second transfer field. \end{DoxyCompactList}\item 
float {\bf \-\_\-\-E\-Ind}\label{classmarlintpc_1_1ChargeDistributionProcessor_a1150275cfd61dbc64f75bbee86d524fa}

\begin{DoxyCompactList}\small\item\em Induction field. \end{DoxyCompactList}\item 
bool {\bfseries \-\_\-output\-Is\-Persistent}\label{classmarlintpc_1_1ChargeDistributionProcessor_a2efa4dd51acaa900ac2b31d5deda9ba0}

\item 
double {\bf \-\_\-sigma}
\begin{DoxyCompactList}\small\item\em If true the output collection is written. \end{DoxyCompactList}\item 
double {\bf \-\_\-sigma\-Long}\label{classmarlintpc_1_1ChargeDistributionProcessor_aeb3ea453f885c43149fe79f5a5aa2c53}

\begin{DoxyCompactList}\small\item\em Value of the longitudinal defocussing. \end{DoxyCompactList}\item 
float {\bf \-\_\-\-B\-Field}\label{classmarlintpc_1_1ChargeDistributionProcessor_a32e65462ae9e19c18f29908820f56fe6}

\begin{DoxyCompactList}\small\item\em Strength of the magnetic field in T. \end{DoxyCompactList}\item 
double {\bf \-\_\-bunch\-Intervall}\label{classmarlintpc_1_1ChargeDistributionProcessor_a0e125cfaa67291496a13949ba470b337}

\begin{DoxyCompactList}\small\item\em Time between two bunch crossings in ns. \end{DoxyCompactList}\item 
double {\bf \-\_\-z\-Bin\-Length}\label{classmarlintpc_1_1ChargeDistributionProcessor_a1b2890eb360386e4b58625ba12d9a3a3}

\begin{DoxyCompactList}\small\item\em Length of a z-\/bin in ns. \end{DoxyCompactList}\item 
int {\bf \-\_\-write\-After\-N\-Events}\label{classmarlintpc_1_1ChargeDistributionProcessor_a90516d3f3eb148adb9e59bbe21b3d61b}

\begin{DoxyCompactList}\small\item\em Number of overlayed events after which the T\-P\-C is read out. \end{DoxyCompactList}\item 
const gear\-::\-T\-P\-C\-Parameters $\ast$ {\bfseries \-\_\-tpc\-Parameters}\label{classmarlintpc_1_1ChargeDistributionProcessor_a636e9b5ceb03b5d13935da1523d67c62}

\item 
{\bf marlintpc\-::\-Voxel\-T\-P\-C} $\ast$ {\bfseries \-\_\-tracker\-Data}\label{classmarlintpc_1_1ChargeDistributionProcessor_a29beccbbfffc8c2a67705bb13d1ca439}

\item 
bool {\bf \-\_\-is\-First\-Event}\label{classmarlintpc_1_1ChargeDistributionProcessor_a3e8aa8d796fb66e7aa20a0e876b4c1fe}

\begin{DoxyCompactList}\small\item\em Test if this is the first event to be processed at all. \end{DoxyCompactList}\item 
double {\bf \-\_\-ionisation\-Energy}\label{classmarlintpc_1_1ChargeDistributionProcessor_a263d974555877b1b0af65e03e50741a9}

\begin{DoxyCompactList}\small\item\em Ionisation energy of the gas. \end{DoxyCompactList}\item 
bool {\bf \-\_\-improve\-Memory\-Footprint}\label{classmarlintpc_1_1ChargeDistributionProcessor_a060a5602e077d314b551821e195ed01c}

\begin{DoxyCompactList}\small\item\em Flag whether to use the memory saving shotcut. \end{DoxyCompactList}\item 
double {\bf \-\_\-sigma\-Override}\label{classmarlintpc_1_1ChargeDistributionProcessor_a5e435fce2fdd1ea7da9a0d2da7d4a5b4}

\begin{DoxyCompactList}\small\item\em Optional override parameter for the charge broadening. \end{DoxyCompactList}\item 
double {\bf \-\_\-\-B\-Override}\label{classmarlintpc_1_1ChargeDistributionProcessor_a09e12034eae494733fc0cacd50dff4ef}

\begin{DoxyCompactList}\small\item\em Optional override parameter for the magnetic field. \end{DoxyCompactList}\item 
double {\bf \-\_\-induction\-Factor}\label{classmarlintpc_1_1ChargeDistributionProcessor_a8daa4316195865f84aded2c93138aa52}

\begin{DoxyCompactList}\small\item\em Size of induction on neighbour pads in percent of charge on central pad. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Protected Attributes}
\begin{DoxyCompactItemize}
\item 
static std\-::list$<$ std\-::pair\\*
$<$ {\bf Voxel\-T\-P\-C\-::\-Voxel\-Index}, int $>$ $>$ $\ast$ {\bf \-\_\-fetched\-List} = 0
\begin{DoxyCompactList}\small\item\em A subset of voxels which has been removed (fetched) from the \doxyref{Voxel\-T\-P\-C}{p.}{classmarlintpc_1_1VoxelTPC}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This processor takes the coordinates of the drifted electrons and the charge from amplification and smears the charge on the padplane. 

Broadening of the charge cloud due to diffussion between the G\-E\-Ms is included as well as charge transfer parameters in dependence on the G\-E\-M settings. The processor adds the transversale defocussing in the G\-E\-M stack to the conditions data. If the conditions data is write protected and therefor the defocussing can not be added a new writeable T\-P\-C\-Conditions object is added to the data stream. The new object is a copy of the original T\-P\-C\-Conditions and additionally holds the value for the mean amplification of an single electron. Later processors should only use the newly created object.

Do not use the marlin\-::\-Conditions\-Processor to manage T\-P\-C\-Conditions set or modified by the G\-E\-M\-Processor!!!

The Write\-After\-N\-Events parameter is optional. It is inteded for a C\-L\-I\-C-\/like bunch train structure where the bunch train length is much shorter than the readout time of the T\-P\-C. The T\-P\-C is read out completely if ( event\-Nr \% Write\-After\-N\-Events == (Write\-After\-N\-Events -\/ 1) ). All events up to this point are empty, the whole T\-P\-C picture is written to one event.

The {\ttfamily Improve\-Memory\-Footprint} flag disables the output collection. Instead the static fetch\-Voxel\-Map() function has to be called by the subsequent processors.

\subparagraph*{Input -\/ Prerequisites}

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

\subparagraph*{Output}

Collection with T\-P\-C\-Voxels containing charges on pads


\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 {\ttfamily true} the output collection is written (default\-: true)", \\
\hline
{\em x\-Bin\-Length} & Length of the bins in z direction in ns \\
\hline
{\em E\-Trans1} & Value of first transfer field in V/cm \\
\hline
{\em E\-Trans2} & Value of second transfer field in V/cm \\
\hline
{\em E\-Ind} & Value of Induction field in V/cm \\
\hline
{\em Gas} & Gas mixture \\
\hline
{\em Bunch\-Intervall} & Time between two bunch crossings in ns \\
\hline
{\em T\-P\-C\-Conditions} & Name of the collection with T\-P\-C\-Conditons to be read in \\
\hline
{\em Alternative\-T\-P\-C\-Conditions\-Name} & Name of newly created T\-P\-C\-Condtions collection if original object is writeable \\
\hline
{\em Ionisation\-Energy} & Mean ionisation energy of the chambers gas in [Ge\-V] (default\-: 26\-E-\/9 (argon)) \\
\hline
{\em Write\-After\-N\-Events} & Force readout of the full T\-P\-C after overlaying n events (optional) \\
\hline
{\em Improve\-Memory\-Footprint} & Flag whether to use fetch\-Voxel\-Collection instead of the output collection (default\-:false) \\
\hline
{\em Sigma\-Override} & Override the sigma which usually is calculated from the diffusion in the G\-E\-M stack (optional)\\
\hline
\end{DoxyParams}
\begin{DoxyAuthor}{Author}
Thorsten Krautscheid 
\end{DoxyAuthor}


\subsection{Member Function Documentation}
\index{marlintpc\-::\-Charge\-Distribution\-Processor@{marlintpc\-::\-Charge\-Distribution\-Processor}!fetch\-Voxel\-List@{fetch\-Voxel\-List}}
\index{fetch\-Voxel\-List@{fetch\-Voxel\-List}!marlintpc::ChargeDistributionProcessor@{marlintpc\-::\-Charge\-Distribution\-Processor}}
\subsubsection[{fetch\-Voxel\-List}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<$ std\-::pair$<$ {\bf Voxel\-T\-P\-C\-::\-Voxel\-Index}, int $>$ $>$ $\ast$ marlintpc\-::\-Charge\-Distribution\-Processor\-::fetch\-Voxel\-List (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1ChargeDistributionProcessor_a1c54a221af40b89bae9b00a9fa9de8eb}


A function to directly get the voxels from the internal map. 

Like this the data does not go to the event and thus reduces the memory footprint. Sort of a hack which bypasses the processor interface, but necessary due to the huge memory consumption. Make sure to delete it in order not to leak memory. 

References \-\_\-fetched\-List.



Referenced by marlintpc\-::\-T\-P\-C\-Electronics\-Processor\-::process\-Event().

\index{marlintpc\-::\-Charge\-Distribution\-Processor@{marlintpc\-::\-Charge\-Distribution\-Processor}!init@{init}}
\index{init@{init}!marlintpc::ChargeDistributionProcessor@{marlintpc\-::\-Charge\-Distribution\-Processor}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Charge\-Distribution\-Processor\-::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1ChargeDistributionProcessor_a89d40d64af85ec6fe106db133d066e9b}


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

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

References \-\_\-\-B\-Field, \-\_\-\-B\-Override, \-\_\-\-E\-Ind, \-\_\-\-E\-Trans1, \-\_\-\-E\-Trans2, \-\_\-gas, \-\_\-induction\-Factor, \-\_\-is\-First\-Event, \-\_\-sigma, \-\_\-sigma\-Long, \-\_\-sigma\-Override, \-\_\-z\-Bin\-Length, marlintpc\-::\-T\-P\-C\-Gas\-::\-Calculate\-Gas\-Parameters(), marlintpc\-::\-T\-P\-C\-Gas\-::\-Get\-Longitudinal\-Diffusion(), marlintpc\-::\-T\-P\-C\-Gas\-::\-Get\-Transverse\-Diffusion(), marlintpc\-::\-T\-P\-C\-Gas\-::\-Set\-B\-Field(), and marlintpc\-::\-T\-P\-C\-Gas\-::\-Set\-E\-Field().



\subsection{Member Data Documentation}
\index{marlintpc\-::\-Charge\-Distribution\-Processor@{marlintpc\-::\-Charge\-Distribution\-Processor}!\-\_\-fetched\-List@{\-\_\-fetched\-List}}
\index{\-\_\-fetched\-List@{\-\_\-fetched\-List}!marlintpc::ChargeDistributionProcessor@{marlintpc\-::\-Charge\-Distribution\-Processor}}
\subsubsection[{\-\_\-fetched\-List}]{\setlength{\rightskip}{0pt plus 5cm}std\-::list$<$ std\-::pair$<$ {\bf Voxel\-T\-P\-C\-::\-Voxel\-Index}, int $>$ $>$ $\ast$ marlintpc\-::\-Charge\-Distribution\-Processor\-::\-\_\-fetched\-List = 0\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [protected]}}\label{classmarlintpc_1_1ChargeDistributionProcessor_a3eae7dbf567cd156a183989f516cb05a}


A subset of voxels which has been removed (fetched) from the \doxyref{Voxel\-T\-P\-C}{p.}{classmarlintpc_1_1VoxelTPC}. 

It is to be fetched by the subsequent processor using fetch\-Voxel\-List. 

Referenced by fetch\-Voxel\-List(), and process\-Event().

\index{marlintpc\-::\-Charge\-Distribution\-Processor@{marlintpc\-::\-Charge\-Distribution\-Processor}!\-\_\-input\-Collection\-Name@{\-\_\-input\-Collection\-Name}}
\index{\-\_\-input\-Collection\-Name@{\-\_\-input\-Collection\-Name}!marlintpc::ChargeDistributionProcessor@{marlintpc\-::\-Charge\-Distribution\-Processor}}
\subsubsection[{\-\_\-input\-Collection\-Name}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string marlintpc\-::\-Charge\-Distribution\-Processor\-::\-\_\-input\-Collection\-Name\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1ChargeDistributionProcessor_ae5b45628b332d228f621a7a2ea2efce6}


Input/output collection names. 

Name of the input collection 

Referenced by process\-Event().

\index{marlintpc\-::\-Charge\-Distribution\-Processor@{marlintpc\-::\-Charge\-Distribution\-Processor}!\-\_\-sigma@{\-\_\-sigma}}
\index{\-\_\-sigma@{\-\_\-sigma}!marlintpc::ChargeDistributionProcessor@{marlintpc\-::\-Charge\-Distribution\-Processor}}
\subsubsection[{\-\_\-sigma}]{\setlength{\rightskip}{0pt plus 5cm}double marlintpc\-::\-Charge\-Distribution\-Processor\-::\-\_\-sigma\hspace{0.3cm}{\ttfamily [protected]}}\label{classmarlintpc_1_1ChargeDistributionProcessor_a9d604af31f80cc087c2ef1b8e4b74b98}


If true the output collection is written. 

Value of the transverse defocussing 

Referenced by init(), and process\-Event().



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