\section{overlay\-:\-:Merger Class Reference}
\label{classoverlay_1_1Merger}\index{overlay\-::\-Merger@{overlay\-::\-Merger}}


Basic utility to merge two events or collections.  




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

\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void {\bf merge\-M\-C} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$src\-Event, E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$dest\-Event, std\-::string mc\-Dest\-String)
\begin{DoxyCompactList}\small\item\em Tries to merge collections with a name present in both events (like \doxyref{merge(\-E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$, E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$)}{p.}{classoverlay_1_1Merger_a53639d65a23cacb77c1c86fb6ca09c42} but the M\-C particle collection in src\-Event is merged with the collection named mc\-Dest\-String. \end{DoxyCompactList}\item 
static void {\bf merge\-M\-C} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$src\-Event, std\-::string mc\-Src\-String, E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$dest\-Event, std\-::string mc\-Dest\-String)
\begin{DoxyCompactList}\small\item\em merge function, takes two events and tries to merge collections with a name present in both events. \end{DoxyCompactList}\item 
static void {\bf merge} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$src\-Event, E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$dest\-Event)
\begin{DoxyCompactList}\small\item\em Tries to merge collections with a name present in both events. \end{DoxyCompactList}\item 
static void {\bf merge} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$src\-Event, E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$dest\-Event, std\-::map$<$ std\-::string, std\-::string $>$ $\ast$merge\-Map)
\begin{DoxyCompactList}\small\item\em Merges the collections of the two events according to a given map\par
 \end{DoxyCompactList}\item 
static void {\bf merge} (E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$src\-Event, std\-::string src\-String, E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$dest\-Event, std\-::string dest\-String)
\begin{DoxyCompactList}\small\item\em Merges the two named collections in the given events. \end{DoxyCompactList}\item 
static void {\bf merge} (E\-V\-E\-N\-T\-::\-L\-C\-Collection $\ast$src, E\-V\-E\-N\-T\-::\-L\-C\-Collection $\ast$dest)
\begin{DoxyCompactList}\small\item\em merge function, takes two collections and addes the elements from src to dest. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Basic utility to merge two events or collections. 

So far only simulation collections are supported.

\begin{DoxyAuthor}{Author}
N. Chiapolini, D\-E\-S\-Y 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}
\doxyref{Merger.\-h}{p.}{Merger_8h_source} 848 2012-\/09-\/11 09\-:12\-:03\-Z gaede 
\end{DoxyParagraph}


\subsection{Member Function Documentation}
\index{overlay\-::\-Merger@{overlay\-::\-Merger}!merge@{merge}}
\index{merge@{merge}!overlay::Merger@{overlay\-::\-Merger}}
\subsubsection[{merge}]{\setlength{\rightskip}{0pt plus 5cm}static void overlay\-::\-Merger\-::merge (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{src\-Event, }
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{dest\-Event}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classoverlay_1_1Merger_a53639d65a23cacb77c1c86fb6ca09c42}


Tries to merge collections with a name present in both events. 


\begin{DoxyParams}{Parameters}
{\em src\-Event} & source event. \\
\hline
{\em dest\-Event} & destination event\\
\hline
\end{DoxyParams}
calles \doxyref{merge(\-E\-V\-E\-N\-T\-::\-L\-C\-Collection$\ast$, E\-V\-E\-N\-T\-::\-L\-C\-Collection$\ast$)}{p.}{classoverlay_1_1Merger_a7fef6264d7b25e961aab4e3d1f9c7013} internally \index{overlay\-::\-Merger@{overlay\-::\-Merger}!merge@{merge}}
\index{merge@{merge}!overlay::Merger@{overlay\-::\-Merger}}
\subsubsection[{merge}]{\setlength{\rightskip}{0pt plus 5cm}static void overlay\-::\-Merger\-::merge (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{src\-Event, }
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{dest\-Event, }
\item[{std\-::map$<$ std\-::string, std\-::string $>$ $\ast$}]{merge\-Map}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classoverlay_1_1Merger_a55afd1705d763b9ca3425efba9cff7eb}


Merges the collections of the two events according to a given map\par
 


\begin{DoxyParams}{Parameters}
{\em src\-Event} & source event. \\
\hline
{\em dest\-Event} & destination event \\
\hline
{\em $\ast$merge\-Map} & Map containing the src-\/$>$dest association for the collection names \par
 Map structure\-: (src\-Col\-Name, dest\-Col\-Name)\par
 If src\-Col does not exist, the pair will be ignored, if dest\-Col does not exist, a new collection with the same type as src\-Col will be created.\par
\\
\hline
\end{DoxyParams}
calles \doxyref{merge(\-E\-V\-E\-N\-T\-::\-L\-C\-Collection$\ast$, E\-V\-E\-N\-T\-::\-L\-C\-Collection$\ast$)}{p.}{classoverlay_1_1Merger_a7fef6264d7b25e961aab4e3d1f9c7013} internally \index{overlay\-::\-Merger@{overlay\-::\-Merger}!merge@{merge}}
\index{merge@{merge}!overlay::Merger@{overlay\-::\-Merger}}
\subsubsection[{merge}]{\setlength{\rightskip}{0pt plus 5cm}static void overlay\-::\-Merger\-::merge (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{src\-Event, }
\item[{std\-::string}]{src\-String, }
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{dest\-Event, }
\item[{std\-::string}]{dest\-String}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classoverlay_1_1Merger_a2bc60b65f7358f52282c47c0551c169f}


Merges the two named collections in the given events. 


\begin{DoxyParams}{Parameters}
{\em src\-Event} & source event. \\
\hline
{\em src\-String} & name of the source collection \\
\hline
{\em dest\-Event} & destination event \\
\hline
{\em dest\-String} & name of the destination collection\\
\hline
\end{DoxyParams}
calles \doxyref{merge(\-E\-V\-E\-N\-T\-::\-L\-C\-Collection$\ast$, E\-V\-E\-N\-T\-::\-L\-C\-Collection$\ast$)}{p.}{classoverlay_1_1Merger_a7fef6264d7b25e961aab4e3d1f9c7013} internally \index{overlay\-::\-Merger@{overlay\-::\-Merger}!merge@{merge}}
\index{merge@{merge}!overlay::Merger@{overlay\-::\-Merger}}
\subsubsection[{merge}]{\setlength{\rightskip}{0pt plus 5cm}static void overlay\-::\-Merger\-::merge (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Collection $\ast$}]{src, }
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Collection $\ast$}]{dest}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classoverlay_1_1Merger_a7fef6264d7b25e961aab4e3d1f9c7013}


merge function, takes two collections and addes the elements from src to dest. 

Both collections need to have same type!\par
 Types merged\-:
\begin{DoxyItemize}
\item M\-C\-P\-A\-R\-T\-I\-C\-L\-E
\item S\-I\-M\-T\-R\-A\-C\-K\-E\-R\-H\-I\-T
\item S\-I\-M\-C\-A\-L\-O\-R\-I\-M\-E\-T\-E\-R\-H\-I\-T
\item T\-R\-A\-C\-K\-E\-R\-H\-I\-T
\item C\-A\-L\-O\-R\-I\-M\-E\-T\-E\-R\-H\-I\-T
\end{DoxyItemize}

Algorithm\-: M\-C\-P\-A\-R\-T\-I\-C\-L\-E, S\-I\-M\-T\-R\-A\-C\-K\-E\-R\-H\-I\-T, T\-R\-A\-C\-K\-E\-R\-H\-I\-T\-: All Hits from the source collection are copied into the destination collection. S\-I\-M\-C\-A\-L\-O\-R\-I\-M\-E\-T\-E\-R\-H\-I\-T, C\-A\-L\-O\-R\-I\-M\-E\-T\-E\-R\-H\-I\-T\}\-: If the destination collection contains a hit with the same cell\-I\-D, the energy of the source hit will be added to it. Otherwiese the hit will be copied into the destination collection. (In case of simulated data the M\-C\-Particle contributions will be preserved.)

!! It is the callers responsability to make sure the mc\-Particles pointed to by the hits do exist !!\par



\begin{DoxyParams}{Parameters}
{\em src} & Collection containing the entries that should be added to another collection. \\
\hline
{\em src} & Collection to which the new entries should be added. \\
\hline
\end{DoxyParams}
\index{overlay\-::\-Merger@{overlay\-::\-Merger}!merge\-M\-C@{merge\-M\-C}}
\index{merge\-M\-C@{merge\-M\-C}!overlay::Merger@{overlay\-::\-Merger}}
\subsubsection[{merge\-M\-C}]{\setlength{\rightskip}{0pt plus 5cm}static void overlay\-::\-Merger\-::merge\-M\-C (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{src\-Event, }
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{dest\-Event, }
\item[{std\-::string}]{mc\-Dest\-String}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classoverlay_1_1Merger_a2a8129b09982a12e687cff3583e6ecca}


Tries to merge collections with a name present in both events (like \doxyref{merge(\-E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$, E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$)}{p.}{classoverlay_1_1Merger_a53639d65a23cacb77c1c86fb6ca09c42} but the M\-C particle collection in src\-Event is merged with the collection named mc\-Dest\-String. 

\par



\begin{DoxyParams}{Parameters}
{\em src\-Event} & source event. \\
\hline
{\em dest\-Event} & destination event \\
\hline
{\em mc\-Dest\-String} & name of the collection that the M\-C\-P\-A\-R\-T\-I\-C\-L\-E collection should be merged with. If more then one collection of type M\-C\-P\-A\-R\-T\-I\-C\-L\-E exists in src\-Event the function exits without any action.\\
\hline
\end{DoxyParams}
calles \doxyref{merge\-M\-C(\-E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$, std\-::string, E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$, std\-::string)}{p.}{classoverlay_1_1Merger_a0060f5e7e830d43efd2cff0a81270aaf} internally \index{overlay\-::\-Merger@{overlay\-::\-Merger}!merge\-M\-C@{merge\-M\-C}}
\index{merge\-M\-C@{merge\-M\-C}!overlay::Merger@{overlay\-::\-Merger}}
\subsubsection[{merge\-M\-C}]{\setlength{\rightskip}{0pt plus 5cm}static void overlay\-::\-Merger\-::merge\-M\-C (
\begin{DoxyParamCaption}
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{src\-Event, }
\item[{std\-::string}]{mc\-Src\-String, }
\item[{E\-V\-E\-N\-T\-::\-L\-C\-Event $\ast$}]{dest\-Event, }
\item[{std\-::string}]{mc\-Dest\-String}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classoverlay_1_1Merger_a0060f5e7e830d43efd2cff0a81270aaf}


merge function, takes two events and tries to merge collections with a name present in both events. 

\par



\begin{DoxyParams}{Parameters}
{\em src\-Event} & source event. \\
\hline
{\em dest\-Event} & destination event \\
\hline
{\em mc\-Src\-String} & The M\-C particle collection in src\-Event \\
\hline
{\em mc\-Dest\-String} & The M\-C particle collection the source particles should be addet to. If this collection does not exist, a new collection is created.\par
\\
\hline
\end{DoxyParams}
calles \doxyref{merge(\-E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$, E\-V\-E\-N\-T\-::\-L\-C\-Event$\ast$)}{p.}{classoverlay_1_1Merger_a53639d65a23cacb77c1c86fb6ca09c42} internally (after merging the M\-C collections and removing mc\-Src\-String from the src\-Event) 

The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Merger.\-h\end{DoxyCompactItemize}
