\section{marlintpc\-:\-:G\-E\-M\-Processor Class Reference}
\label{classmarlintpc_1_1GEMProcessor}\index{marlintpc\-::\-G\-E\-M\-Processor@{marlintpc\-::\-G\-E\-M\-Processor}}


This Processor takes drifted electrons and uses a triple G\-E\-M structure for amplification.  




{\ttfamily \#include $<$G\-E\-M\-Processor.\-h$>$}

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

\item 
{\bf G\-E\-M\-Processor} ()\label{classmarlintpc_1_1GEMProcessor_a07928ebe88f0642989e112c3e4cb8412}

\begin{DoxyCompactList}\small\item\em C'tor. \end{DoxyCompactList}\item 
virtual {\bf $\sim$\-G\-E\-M\-Processor} ()\label{classmarlintpc_1_1GEMProcessor_a9b11d24bb3351678cce4caad2e9eff8f}

\begin{DoxyCompactList}\small\item\em D'tor. \end{DoxyCompactList}\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_1GEMProcessor_a0d1893e23d51aaad2ea744a872a7db3f}

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

\begin{DoxyCompactList}\small\item\em Called for every event -\/ the working horse. \end{DoxyCompactList}\item 
void {\bf Load\-G\-E\-M\-Settings} ()\label{classmarlintpc_1_1GEMProcessor_a2034acd30ad03a1aa6911805bec7fd0e}

\begin{DoxyCompactList}\small\item\em Reads parameter file with G\-E\-M parametrisations and sets collection and extraction efficiencies as well as the gain for the single G\-E\-Ms. \end{DoxyCompactList}\item 
int {\bf G\-E\-M\-\_\-\-Collection} (int G\-E\-M\-Nr, int enumber)\label{classmarlintpc_1_1GEMProcessor_a2ff6ff82cd5d0f9a7bbc0591574c4e28}

\begin{DoxyCompactList}\small\item\em Gives the Collection into G\-E\-M i=G\-E\-M\-Nr for enumber of electrons in front of G\-E\-M hole. \end{DoxyCompactList}\item 
double {\bf G\-E\-M\-\_\-\-Gain} (int G\-E\-M\-Nr, int enumber)\label{classmarlintpc_1_1GEMProcessor_a210b9349f74143040b0e8b6f6b829067}

\begin{DoxyCompactList}\small\item\em Gives the gain in G\-E\-M i=G\-E\-M\-Nr using an exponential distribution for the gain in one G\-E\-M. \end{DoxyCompactList}\item 
int {\bf G\-E\-M\-\_\-\-Extraction} (int G\-E\-M\-Nr, int enumber)\label{classmarlintpc_1_1GEMProcessor_aa78063d52b417c1a86955372649e27ba}

\begin{DoxyCompactList}\small\item\em Gives the Extraction out of G\-E\-M i=G\-E\-M\-Nr for enumber of electrons indside G\-E\-M hole. \end{DoxyCompactList}\item 
double {\bf Calculate\-Attachment} (double E)\label{classmarlintpc_1_1GEMProcessor_a5c332701716f4e12b2b801dcfc6047d7}

\begin{DoxyCompactList}\small\item\em Claculates the attachment between G\-E\-Ms. \end{DoxyCompactList}\item 
double {\bfseries Attachment\-Param} (double E, double a0, double a1, double a2, double a3, double a4, double a5)\label{classmarlintpc_1_1GEMProcessor_ac42b8118066d79d9300895c67d59096d}

\item 
int {\bf Calculate\-Nr\-Electrons} (double attachment1, double attachment2, double attachment3, int charge)
\begin{DoxyCompactList}\small\item\em Function to claculate number of electrons after passing through the G\-E\-M structure. \end{DoxyCompactList}\item 
virtual void {\bf end} ()\label{classmarlintpc_1_1GEMProcessor_ac620c014ac62b67147da909d09cbc1ed}

\begin{DoxyCompactList}\small\item\em Called after data processing for clean up. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::string {\bf \-\_\-input\-Collection\-Name}\label{classmarlintpc_1_1GEMProcessor_adbeee06218db45788b8625881e224621}

\begin{DoxyCompactList}\small\item\em Name of input collection. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-output\-Collection\-Name}\label{classmarlintpc_1_1GEMProcessor_a12b13ae5dd00153bb201ed6739581c88}

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

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

\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 paramfile}\label{classmarlintpc_1_1GEMProcessor_a0149c7562fdc8b501f993dce70f53983}

\begin{DoxyCompactList}\small\item\em Name of file containig G\-E\-M parametrization. \end{DoxyCompactList}\item 
std\-::string {\bf gas}\label{classmarlintpc_1_1GEMProcessor_ab888b0f5bb3e4cc4aba203b5d84f7299}

\begin{DoxyCompactList}\small\item\em Name of gas in T\-P\-C (P5, P10 or T\-D\-R) \end{DoxyCompactList}\item 
float {\bf U\-G\-E\-M1}\label{classmarlintpc_1_1GEMProcessor_a4570aad4f5a6afbba1734f2f4c7fa4dd}

\begin{DoxyCompactList}\small\item\em Voltage of G\-E\-M 1 in [V]. \end{DoxyCompactList}\item 
float {\bf U\-G\-E\-M2}\label{classmarlintpc_1_1GEMProcessor_a09d06a22ba526288903f8834d2887314}

\begin{DoxyCompactList}\small\item\em Voltage of G\-E\-M 2 in [V]. \end{DoxyCompactList}\item 
float {\bf U\-G\-E\-M3}\label{classmarlintpc_1_1GEMProcessor_a69d306f24a15d46383e63d2cd4933339}

\begin{DoxyCompactList}\small\item\em Voltage of G\-E\-M 3 in [V]. \end{DoxyCompactList}\item 
float {\bf E\-Trans1}\label{classmarlintpc_1_1GEMProcessor_a179c902b1368e8864ff1d74626aa064d}

\begin{DoxyCompactList}\small\item\em Strength of first transversal field in [V/cm]. \end{DoxyCompactList}\item 
float {\bf E\-Trans2}\label{classmarlintpc_1_1GEMProcessor_a727671fd36976c0a7db7823e496942f7}

\begin{DoxyCompactList}\small\item\em Strength of second transversal field in [V/cm]. \end{DoxyCompactList}\item 
float {\bf E\-Ind}\label{classmarlintpc_1_1GEMProcessor_a317be9c563d1875f6d72e5d8031ddd0d}

\begin{DoxyCompactList}\small\item\em Strength of induction field in [V/cm]. \end{DoxyCompactList}\item 
float {\bf \-\_\-gain\-Factor}\label{classmarlintpc_1_1GEMProcessor_ac18d7ca07b9be93f954b7b2bb52eb55e}

\begin{DoxyCompactList}\small\item\em Correction factor for G\-A\-I\-N. \end{DoxyCompactList}\item 
int {\bf \-\_\-transient}\label{classmarlintpc_1_1GEMProcessor_a19aca30b7eb598d51599e65b8bf980ff}

\begin{DoxyCompactList}\small\item\em Sets output collection to transient when set to another value than 0. \end{DoxyCompactList}\item 
float {\bf \-\_\-drift\-Field}\label{classmarlintpc_1_1GEMProcessor_a9b47731ac2d882859011eef1247234c8}

\begin{DoxyCompactList}\small\item\em Strength of the drift field in [V/cm]. \end{DoxyCompactList}\item 
double {\bfseries Extr} [3]\label{classmarlintpc_1_1GEMProcessor_a1747faceb12877918cbeda0c57251bf6}

\item 
double {\bfseries Coll} [3]\label{classmarlintpc_1_1GEMProcessor_af9ef2e0d739f33d2e05f07843f5fa938}

\item 
double {\bfseries Gain} [3]\label{classmarlintpc_1_1GEMProcessor_ab2b55215d0336e4aacd0e7dde70410d8}

\item 
double {\bfseries gainmean} [3]\label{classmarlintpc_1_1GEMProcessor_a722aeac7e9a127d9a404f2cd8a20dd7b}

\item 
double {\bfseries A1}\label{classmarlintpc_1_1GEMProcessor_a1a26b6efa8c7a60eedcee5153a3b7a92}

\item 
double {\bfseries A2}\label{classmarlintpc_1_1GEMProcessor_a65d3ddc50d89b0695875cc4e1699ba62}

\item 
double {\bfseries A3}\label{classmarlintpc_1_1GEMProcessor_ab190a7942f64b128c823c42d2934969b}

\item 
int {\bfseries \-\_\-n\-Run}\label{classmarlintpc_1_1GEMProcessor_a1eacac38541fd443033294f8b52260ed}

\item 
int {\bfseries \-\_\-n\-Evt}\label{classmarlintpc_1_1GEMProcessor_a91db4a89a5e32a9a4c7856765de4227d}

\item 
double {\bf \-\_\-mean\-Amp}\label{classmarlintpc_1_1GEMProcessor_abc679d478ce75db3a0d4d34b68d1e3bd}

\begin{DoxyCompactList}\small\item\em Mean amplification in G\-E\-Ms. \end{DoxyCompactList}\item 
double {\bf \-\_\-ionisation\-Energy}\label{classmarlintpc_1_1GEMProcessor_a126820f3c364aae07f5901e1f2bbbe45}

\begin{DoxyCompactList}\small\item\em Ionisation energy of the gas. \end{DoxyCompactList}\item 
bool {\bf \-\_\-full\-Curler\-Backward\-Compatibility}\label{classmarlintpc_1_1GEMProcessor_a056fe1985d9f2169a02b88b116be411b}

\begin{DoxyCompactList}\small\item\em Flag whether to multiply hits in curlers with 10. \end{DoxyCompactList}\item 
bool {\bfseries \-\_\-\-G\-E\-M\-Gain\-Polya}\label{classmarlintpc_1_1GEMProcessor_ad6abcac0e111e20d2571ac3625d8830b}

\item 
std\-::map$<$ int, T\-F1 $\ast$ $>$ {\bf \-\_\-gain\-Polya}\label{classmarlintpc_1_1GEMProcessor_ae89384445fd7f56714b3e58e1c2d2ecf}

\begin{DoxyCompactList}\small\item\em Polya function for gain in G\-E\-Ms, if option selected. \end{DoxyCompactList}\item 
double {\bf \-\_\-polya\-Theta\-P1}\label{classmarlintpc_1_1GEMProcessor_a6ecb9ffccd5c6562c42749b1f68ae94a}

\begin{DoxyCompactList}\small\item\em value for the parameter theta+1 of the polya gain distribution \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This Processor takes drifted electrons and uses a triple G\-E\-M structure for amplification. 

The amplified electrons are safed as Sim\-Tracker\-Hits with charge safed in d\-Edx. A\-T\-T\-E\-N\-T\-I\-O\-N!\-This processor checks also for electrons arriving on padplane. Those not on padplane are dumped and not amplified. Correctly this should be done in the digitisation part but it is done here for reasons of performance. This has to be kept in mind when the processor is not used in combination with the \doxyref{Charge\-Distribution\-Processor}{p.}{classmarlintpc_1_1ChargeDistributionProcessor}. The processor adds the mean amplification value of an single electron to the conditions data. If the conditions data is write protected and therefor the amplification value 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!!!

\subparagraph*{Input -\/ Prerequisites}

Collection of Sim\-Tracker\-Hits with drifted electrons

\subparagraph*{Output}

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


\begin{DoxyParams}{Parameters}
{\em Input\-Collection\-Name} & Name of input collection (default\-: Drifted\-Electrons) \\
\hline
{\em Output\-Collection\-Name} & Name of output collection (default\-: Amplified\-Electrons) \\
\hline
{\em Transient} & If not 0 the output collection is set transient (default\-: 0) \\
\hline
{\em Param\-File} & Name of the file containing G\-E\-M-\/parametrisation (default\-: parameterfile) \\
\hline
{\em Gain\-Factor} & Correction factor for the gain (default\-: 1) \\
\hline
{\em Drift\-Field} & Value of the drift field (default\-: 240) \\
\hline
{\em E\-Trans1} & Value of transfer field 1 in V/cm \\
\hline
{\em E\-Trans2} & Value of transfer field 2 in V/cm \\
\hline
{\em E\-Ind} & Value of the induction field in V/cm \\
\hline
{\em U\-G\-E\-M1} & Voltage on G\-E\-M 1 in V (default\-: 315) \\
\hline
{\em U\-G\-E\-M2} & Voltage on G\-E\-M 2 in V (default\-: 315) \\
\hline
{\em U\-G\-E\-M3} & Voltage on G\-E\-M 3 in V (default\-: 315) \\
\hline
{\em Gas} & Name of the gas in the T\-P\-C (default\-: T\-D\-R) \\
\hline
{\em Ionisation\-Energy} & Mean ionisation energy of the chambers gas in [Ge\-V] (default\-: 26\-E-\/9 (argon)) \\
\hline
{\em Full\-Curler\-Backward\-Compatibility} & Turn on for data from Primary\-Ionisation $<$ r1876 and Full\-Curler turned off (default\-: false)\par
 Without Full\-Curler the old versions of Primary\-Ionisation grouped 10 electrons but did not set the charge currectly. \\
\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 G\-E\-M\-Gain\-Polya} & Switch from default exponential gain to polya distribution for gain in G\-E\-M\-S \\
\hline
{\em Polya\-Theta\-Plus\-One} & Parameter Theta+1 for the polya distributed G\-E\-M gain (default\-: 1.\-2)\\
\hline
\end{DoxyParams}
\begin{DoxyAuthor}{Author}
Astrid Muennich and Thorsten Krautscheid 
\end{DoxyAuthor}


\subsection{Member Function Documentation}
\index{marlintpc\-::\-G\-E\-M\-Processor@{marlintpc\-::\-G\-E\-M\-Processor}!Calculate\-Nr\-Electrons@{Calculate\-Nr\-Electrons}}
\index{Calculate\-Nr\-Electrons@{Calculate\-Nr\-Electrons}!marlintpc::GEMProcessor@{marlintpc\-::\-G\-E\-M\-Processor}}
\subsubsection[{Calculate\-Nr\-Electrons}]{\setlength{\rightskip}{0pt plus 5cm}int marlintpc\-::\-G\-E\-M\-Processor\-::\-Calculate\-Nr\-Electrons (
\begin{DoxyParamCaption}
\item[{double}]{attachment1, }
\item[{double}]{attachment2, }
\item[{double}]{attachment3, }
\item[{int}]{charge}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1GEMProcessor_a2c981531aeada911691d63794344fff7}


Function to claculate number of electrons after passing through the G\-E\-M structure. 

This function makes use of the parametrisation of the charge transfer through the G\-E\-Ms. 

References G\-E\-M\-\_\-\-Collection(), G\-E\-M\-\_\-\-Extraction(), and G\-E\-M\-\_\-\-Gain().



Referenced by process\-Event().

\index{marlintpc\-::\-G\-E\-M\-Processor@{marlintpc\-::\-G\-E\-M\-Processor}!init@{init}}
\index{init@{init}!marlintpc::GEMProcessor@{marlintpc\-::\-G\-E\-M\-Processor}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-G\-E\-M\-Processor\-::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classmarlintpc_1_1GEMProcessor_a99618a5857c136bcfe9f1bc9757ec31a}


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

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

References \-\_\-gain\-Factor, \-\_\-gain\-Polya, \-\_\-mean\-Amp, \-\_\-polya\-Theta\-P1, E\-Ind, E\-Trans1, E\-Trans2, gas, marlintpc\-::\-T\-P\-C\-Gas\-::\-Get\-Attachment(), and Load\-G\-E\-M\-Settings().



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