\section{marlintpc\-:\-:Photoelectric\-X\-M\-L\-File Class Reference}
\label{classmarlintpc_1_1PhotoelectricXMLFile}\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}


This provides some tools on handling the xml file used to store information on the Photoelectric analysis.  




{\ttfamily \#include $<$Photoelectric\-X\-M\-L\-Helper.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Photoelectric\-X\-M\-L\-File} (std\-::string xml\-File)
\begin{DoxyCompactList}\small\item\em Constructor expecting a xml file with the true photodot positions stored as follows\-: \end{DoxyCompactList}\item 
std\-::vector$<$ std\-::pair$<$ double, \\*
std\-::vector$<$ {\bf Photodot} $>$\\*
\-::const\-\_\-iterator $>$ $>$ {\bf Get\-Sorted\-Photodots} (double center\-\_\-x, double center\-\_\-y)
\begin{DoxyCompactList}\small\item\em This methods sorts the photodots from the photodot file. \end{DoxyCompactList}\item 
std\-::vector$<$ std\-::vector\\*
$<$ {\bf Photodot} $>$\-::const\-\_\-iterator $>$ {\bf Get\-Photodots} ()
\begin{DoxyCompactList}\small\item\em Photodots are sorted by the index found in the xml file. \end{DoxyCompactList}\item 
std\-::vector$<$ std\-::vector\\*
$<$ {\bf Photoline} $>$\-::const\-\_\-iterator $>$ {\bf Get\-Photolines} ()
\begin{DoxyCompactList}\small\item\em Photodots are sorted by the index found in the xml file. \end{DoxyCompactList}\item 
void {\bf Set\-Time\-Info} (float start, float end)
\begin{DoxyCompactList}\small\item\em This adds the time information to the xml file. \end{DoxyCompactList}\item 
bool {\bf Get\-Time\-Info} (float \&start, float \&end)
\begin{DoxyCompactList}\small\item\em This reads the time information from the xml file. \end{DoxyCompactList}\item 
void {\bf Save\-File} (std\-::string file\-Name)
\begin{DoxyCompactList}\small\item\em Save the internal xml file. \end{DoxyCompactList}\item 
gear\-::\-Ti\-Xml\-Element $\ast$ {\bf Get\-Photo\-Electric\-Element} ()
\begin{DoxyCompactList}\small\item\em This return the main element in the xml file. \end{DoxyCompactList}\item 
void {\bf Add\-Photodot\-Projection} (int photodot\-\_\-id, const C\-L\-H\-E\-P\-::\-Hep2\-Vector centroid, const std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ \&pads)
\begin{DoxyCompactList}\small\item\em Add information about the associated pads to a photodot. \end{DoxyCompactList}\item 
void {\bf Add\-Photodot\-Projection} (const C\-L\-H\-E\-P\-::\-Hep2\-Vector centroid, const std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ \&pads)
\begin{DoxyCompactList}\small\item\em Add information about pads in a cluster not connected to a photodot. \end{DoxyCompactList}\item 
std\-::map$<$ int, std\-::set\\*
$<$ gear\-::\-Global\-Pad\-Index $>$ $>$ {\bf Get\-Photodot\-Pads} ()
\begin{DoxyCompactList}\small\item\em Get pads associated to each photodot. \end{DoxyCompactList}\item 
std\-::map$<$ int, std\-::set\\*
$<$ gear\-::\-Global\-Pad\-Index $>$ $>$ {\bf Get\-Photoline\-Pads} ()
\begin{DoxyCompactList}\small\item\em Get pads associated to each photoline. \end{DoxyCompactList}\item 
void {\bf Add\-Photoline\-Projection} (int module\-\_\-id, const std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ \&pads)
\begin{DoxyCompactList}\small\item\em Add pads associated to each photoline. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This provides some tools on handling the xml file used to store information on the Photoelectric analysis. 

\begin{DoxyAuthor}{Author}
K. Zenker (D\-E\-S\-Y)
\end{DoxyAuthor}
Up to now it allows to\-:\par

\begin{DoxyEnumerate}
\item Read photodot/line positions from a xml file and sort them by the distance to the center.\par
This is useful if clusters should be connected to the true photodot position, since in the center of the magnet distortions are at minimum. Therefore one can start in the center.\par

\item Add information about clusters connected to photodots.\par

\item Add information about clusters not connected to photodots.\par

\item Add start and end time to be used by processors to do a time cut on pulses.\par
 \begin{DoxyRemark}{Remarks}
Keep in mind that most of the function return only pointers or iterators to internal stored information. Thus you should not delete the \doxyref{Photoelectric\-X\-M\-L\-File}{p.}{classmarlintpc_1_1PhotoelectricXMLFile} object as long as you want to use these information! 
\end{DoxyRemark}

\end{DoxyEnumerate}

\subsection{Constructor \& Destructor Documentation}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Photoelectric\-X\-M\-L\-File@{Photoelectric\-X\-M\-L\-File}}
\index{Photoelectric\-X\-M\-L\-File@{Photoelectric\-X\-M\-L\-File}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Photoelectric\-X\-M\-L\-File}]{\setlength{\rightskip}{0pt plus 5cm}Photoelectric\-X\-M\-L\-File\-::\-Photoelectric\-X\-M\-L\-File (
\begin{DoxyParamCaption}
\item[{std\-::string}]{xml\-File}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a35cf6445eb371f885381cc459d572f8e}


Constructor expecting a xml file with the true photodot positions stored as follows\-: 


\begin{DoxyCode}
<photoelectric\_geometry>
  < photodot>
    <centroid>1256.77,-171.959</centroid>
  </photodot>
</photoelectric\_geometry>
\end{DoxyCode}
 
\begin{DoxyParams}{Parameters}
{\em xml\-File} & \doxyref{Photodot}{p.}{structmarlintpc_1_1Photodot} file name including the path \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Add\-Photodot\-Projection@{Add\-Photodot\-Projection}}
\index{Add\-Photodot\-Projection@{Add\-Photodot\-Projection}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Add\-Photodot\-Projection}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Photoelectric\-X\-M\-L\-File\-::\-Add\-Photodot\-Projection (
\begin{DoxyParamCaption}
\item[{int}]{photodot\-\_\-id, }
\item[{const C\-L\-H\-E\-P\-::\-Hep2\-Vector}]{centroid, }
\item[{const std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ \&}]{pads}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a1e59c51d3b94fcb141954cf01fe8aed8}


Add information about the associated pads to a photodot. 


\begin{DoxyCode}
<photoelectric\_geometry>
  <photodot>
    <centroid x=\textcolor{stringliteral}{"192.1"} y=\textcolor{stringliteral}{"12"} />
    <projection>
     <pad pad\_index=\textcolor{stringliteral}{"1769614"} module\_id=\textcolor{stringliteral}{"5"} />
    </projection>
  </photodot>
</photoelectric\_geometry>
\end{DoxyCode}
 \index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Add\-Photodot\-Projection@{Add\-Photodot\-Projection}}
\index{Add\-Photodot\-Projection@{Add\-Photodot\-Projection}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Add\-Photodot\-Projection}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Photoelectric\-X\-M\-L\-File\-::\-Add\-Photodot\-Projection (
\begin{DoxyParamCaption}
\item[{const C\-L\-H\-E\-P\-::\-Hep2\-Vector}]{centroid, }
\item[{const std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ \&}]{pads}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_acd1c8362a4c43708fea6832915e4858a}


Add information about pads in a cluster not connected to a photodot. 


\begin{DoxyCode}
<photoelectric\_geometry>
  <centroid x=\textcolor{stringliteral}{"192.1"} y=\textcolor{stringliteral}{"12"} />
  <projection>
   <pad pad\_index=\textcolor{stringliteral}{"1769614"} module\_id=\textcolor{stringliteral}{"5"} />
  </projection>
</photoelectric\_geometry>
\end{DoxyCode}
 \index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Add\-Photoline\-Projection@{Add\-Photoline\-Projection}}
\index{Add\-Photoline\-Projection@{Add\-Photoline\-Projection}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Add\-Photoline\-Projection}]{\setlength{\rightskip}{0pt plus 5cm}void Photoelectric\-X\-M\-L\-File\-::\-Add\-Photoline\-Projection (
\begin{DoxyParamCaption}
\item[{int}]{module\-\_\-id, }
\item[{const std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ \&}]{pads}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_af89c27714b2d6f9a117466e6d57915e7}


Add pads associated to each photoline. 


\begin{DoxyParams}{Parameters}
{\em module\-\_\-id} & Give the module where the line belongs to. \\
\hline
{\em pads} & Global pad indices of the associated pads. \\
\hline
\end{DoxyParams}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Photodot\-Pads@{Get\-Photodot\-Pads}}
\index{Get\-Photodot\-Pads@{Get\-Photodot\-Pads}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Photodot\-Pads}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<$ int, std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ $>$ Photoelectric\-X\-M\-L\-File\-::\-Get\-Photodot\-Pads (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_ab27a94c46742e258b7705cf8ace5a28a}


Get pads associated to each photodot. 

If no pads are associated the set size is 0. \begin{DoxyReturn}{Returns}
Map holding for each photodot a set of pads. 
\end{DoxyReturn}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Photodots@{Get\-Photodots}}
\index{Get\-Photodots@{Get\-Photodots}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Photodots}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ vector$<$ {\bf Photodot} $>$\-::const\-\_\-iterator $>$ Photoelectric\-X\-M\-L\-File\-::\-Get\-Photodots (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a1d53f9788faae41ef4d5d97ae64d1fdb}


Photodots are sorted by the index found in the xml file. 

\begin{DoxyReturn}{Returns}
A vector of iterators to the internal photodots. 
\end{DoxyReturn}


Referenced by marlintpc\-::\-Photoelectric\-Pulse\-Processor\-::init().

\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Photo\-Electric\-Element@{Get\-Photo\-Electric\-Element}}
\index{Get\-Photo\-Electric\-Element@{Get\-Photo\-Electric\-Element}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Photo\-Electric\-Element}]{\setlength{\rightskip}{0pt plus 5cm}gear\-::\-Ti\-Xml\-Element $\ast$ Photoelectric\-X\-M\-L\-File\-::\-Get\-Photo\-Electric\-Element (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_aee56f8a4979e113ba9d6d8d4ce4d4993}


This return the main element in the xml file. 

It can be used to add additional information to the main (photoelectric\-\_\-geometry) element. 
\begin{DoxyCode}
<photoelectric\_geometry>
  <!-- add stuff here -->
</photoelectric\_geometry>
\end{DoxyCode}
 \index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Photoline\-Pads@{Get\-Photoline\-Pads}}
\index{Get\-Photoline\-Pads@{Get\-Photoline\-Pads}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Photoline\-Pads}]{\setlength{\rightskip}{0pt plus 5cm}std\-::map$<$ int, std\-::set$<$ gear\-::\-Global\-Pad\-Index $>$ $>$ Photoelectric\-X\-M\-L\-File\-::\-Get\-Photoline\-Pads (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_aff9d2744c9082dd07cc7ed1a4ecea416}


Get pads associated to each photoline. 

If no pads are associated the set size is 0. \begin{DoxyReturn}{Returns}
Map holding for each photoline a set of pads. 
\end{DoxyReturn}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Photolines@{Get\-Photolines}}
\index{Get\-Photolines@{Get\-Photolines}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Photolines}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ vector$<$ {\bf Photoline} $>$\-::const\-\_\-iterator $>$ Photoelectric\-X\-M\-L\-File\-::\-Get\-Photolines (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a6c76b6181211ffcac3d3c90717f0180b}


Photodots are sorted by the index found in the xml file. 

\begin{DoxyReturn}{Returns}
A vector of iterators to the internal photolines. 
\end{DoxyReturn}


Referenced by marlintpc\-::\-Photoelectric\-Pulse\-Processor\-::init().

\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Sorted\-Photodots@{Get\-Sorted\-Photodots}}
\index{Get\-Sorted\-Photodots@{Get\-Sorted\-Photodots}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Sorted\-Photodots}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ pair$<$ double, vector$<$ {\bf Photodot} $>$\-::const\-\_\-iterator $>$ $>$ Photoelectric\-X\-M\-L\-File\-::\-Get\-Sorted\-Photodots (
\begin{DoxyParamCaption}
\item[{double}]{center\-\_\-x, }
\item[{double}]{center\-\_\-y}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a78b06be5fcaad05c88560643dadf4af0}


This methods sorts the photodots from the photodot file. 

The distance to the given point (center\-\_\-x,center\-\_\-y) is calculated and than all dots are sorted by this distance. Shortest distance is at the beginning. The corresponding dot should be used to assign the clusters to the true position. This assumes that the distortions of the magnetic field are minimal in the center of the magnet/the given point. 
\begin{DoxyParams}{Parameters}
{\em center\-\_\-x} & x coordinate of the point with the most homogeneous magnetic field \\
\hline
{\em center\-\_\-y} & y coordinate of the point with the most homogeneous magnetic field \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns sorted iterators to the photodot map. \par
The map key is the id of each photodot. The pair consists of the xml element of this photodot and its position. 
\end{DoxyReturn}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Get\-Time\-Info@{Get\-Time\-Info}}
\index{Get\-Time\-Info@{Get\-Time\-Info}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Get\-Time\-Info}]{\setlength{\rightskip}{0pt plus 5cm}bool Photoelectric\-X\-M\-L\-File\-::\-Get\-Time\-Info (
\begin{DoxyParamCaption}
\item[{float \&}]{start, }
\item[{float \&}]{end}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a84554268e62d443c1b23e783f01b6c57}


This reads the time information from the xml file. 

Expected xml format\-: 
\begin{DoxyCode}
<photoelectric\_geometry>
 <arrival\_time start=\textcolor{stringliteral}{"1.400000000e+04"} end=\textcolor{stringliteral}{"1.425000000e+04"} />
</photoelectric\_geometry>
\end{DoxyCode}
 
\begin{DoxyParams}{Parameters}
{\em start} & The start time. \\
\hline
{\em end} & The end time. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true in case of success 
\end{DoxyReturn}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Save\-File@{Save\-File}}
\index{Save\-File@{Save\-File}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Save\-File}]{\setlength{\rightskip}{0pt plus 5cm}void marlintpc\-::\-Photoelectric\-X\-M\-L\-File\-::\-Save\-File (
\begin{DoxyParamCaption}
\item[{std\-::string}]{file\-Name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classmarlintpc_1_1PhotoelectricXMLFile_a6ef127bcc62ff80e15fee94fc2a68897}


Save the internal xml file. 

It consists of the information from the original photodot file and possibly additional information (pulse time cut, cluster connected to each dot,...). 
\begin{DoxyParams}{Parameters}
{\em file\-Name} & The file name of the xml file including the path. \\
\hline
\end{DoxyParams}
\index{marlintpc\-::\-Photoelectric\-X\-M\-L\-File@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}!Set\-Time\-Info@{Set\-Time\-Info}}
\index{Set\-Time\-Info@{Set\-Time\-Info}!marlintpc::PhotoelectricXMLFile@{marlintpc\-::\-Photoelectric\-X\-M\-L\-File}}
\subsubsection[{Set\-Time\-Info}]{\setlength{\rightskip}{0pt plus 5cm}void Photoelectric\-X\-M\-L\-File\-::\-Set\-Time\-Info (
\begin{DoxyParamCaption}
\item[{float}]{start, }
\item[{float}]{end}
\end{DoxyParamCaption}
)}\label{classmarlintpc_1_1PhotoelectricXMLFile_a33630b36269e4b5437b77a99597196a4}


This adds the time information to the xml file. 

This can be later on be used by processors to apply a time cut on pulses to reduce noise pulses. Will look like this\-: 
\begin{DoxyCode}
<photoelectric\_geometry>
 <arrival\_time start=\textcolor{stringliteral}{"1.400000000e+04"} end=\textcolor{stringliteral}{"1.425000000e+04"} />
</photoelectric\_geometry>
\end{DoxyCode}
 
\begin{DoxyParams}{Parameters}
{\em start} & The start time. \\
\hline
{\em end} & The end time. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Photoelectric\-X\-M\-L\-Helper.\-h\item 
Photoelectric\-X\-M\-L\-Helper.\-cc\end{DoxyCompactItemize}
