%=============================================================================
\documentclass[10pt,a4paper]{article}
%
\input{DD4hep-setup.tex}
%
\pagestyle{fancyplain}{\fancyfoot[C]{\sffamily{DRAFT -- DDEve User Manual -- DRAFT}}}
%
\begin{document}   
%
\mytitle{
DDEve
}{
An Event Display for \\
\vspace{0.5cm}
DD4hep Geometries \\
\vspace{2.5cm}
-- DRAFT -- \\
}
{M. Frank \\
{CERN, 1211 Geneva 23, Switzerland}}
%
%
%==  Abstract  ===============================================================
\pagestyle{plain}
\pagenumbering{Roman}
\setcounter{page}{1}
\begin{abstract}
%=============================================================================

\noindent
\normalsize
\DDE is a framework implementing a event display for detector geometries
implemented using DD4hep. \DDE hereby takes advantage of the TEve toolkit
naturally provided by the ROOT framework like the ROOT geometry toolkit
TGeo. 
\noindent
\DDE actively uses the collaboration between TEve and TGeo as well 
as the various object collaborations provided by the toolkits.
\DDE does in no way intend to hide any of the two toolkits, but 
rather provides facilities to construct various detector views 
in the most suitable manner using predefined configurations.
\end{abstract}

\vspace{8cm}

\begin{center}
{\large{\bf{
\begin{tabular} {| l | l | l |}
\hline
\multicolumn{3}{| c |}{} \\[0.2cm]
\multicolumn{3}{| c |}{Document History} \\[0.2cm]
\multicolumn{3}{| c |}{} \\[0.2cm]
\hline
                 &      &        \\
Document         &      &        \\
version          & Date & Author \\[0.2cm] \hline
                 &      &        \\
1.0              & 15/08/2014 & Markus Frank CERN/LHCb  \\
                 &      &        \\        \hline 
\end{tabular}
}}}
\end{center}

\clearpage
%
%
%==  TOC  ====================================================================
\tableofcontents
\clearpage
%
%
%=============================================================================
% Manual
%=============================================================================
\pagenumbering{arabic}
\setcounter{page}{1}

%=============================================================================
\section{Introduction}
\label{sec:ddeve-user-manual-introduction}
%=============================================================================
\noindent
Short usage description of \DDE.

\noindent
\DDE is a purely experimental package. It was developed to 
\begin{itemize}
\item visually debug developed detector geometries including partial views 
       using predefined displays.
\item compensate the frustration caused by the slow progress of subdetector 
       geometry implementers, which did not get up to speed and hence did not
       require any support from me.....
\end{itemize}
Since up to now \DDE is a hobby of mine, please do not expect a great deal 
of documentation and support.

%=============================================================================
\section{Running the CLICSiD Example}
\label{sec:ddeve-user-manual-introduction}
%=============================================================================
\noindent
DDEve is started using the root executable. In the following we describe 
how to start a display application of \DDE using the CLICSiD example.
\begin{unnumberedcode}
$> root.exe $DD4hepINSTALL/examples/DDEve/DDEve.C 
\end{unnumberedcode}
When the command is issued the following display shows up:
\begin{figure}[h]
  \begin{center}
    \includegraphics[height=90mm] {DDEve_1.png}
    \caption{The \DDE startup view.}
    \label{fig:DDEve_1.png}
  \end{center}
\end{figure}
\newpage
\noindent
Click on "Dismiss" then the file browser opens and you have to select 
a \DDE configuration file:
\begin{figure}[h]
  \begin{center}
    \includegraphics[height=120mm] {DDEve_2.png}
    \caption{The \DDE popup dialog to open the XML configuration file.}
    \label{fig:DDEve_2.png}
  \end{center}
\end{figure}

\noindent
Move to the directory \tts{\$DD4hepINSTALL/examples/CLIDSid/eve} and open the 
\DDE configuration file \tts{DDEve.xml}. The basic idea is that \DDE as an 
application is truely generic and that all subsequent behavior 


\newpage
\noindent
Next you should see the default pane with the instantiated CLICSiD detector:

\begin{figure}[t]
  \begin{center}
    \includegraphics[height=120mm] {DDEve_3.png}
    \caption{The \DDE default view showing the loaded detector.}
    \label{fig:DDEve_3.png}
  \end{center}
\end{figure}

\newpage
\noindent
Then open from the \tts{"DD4hep"} menu the item \tts{"Open Event Data"}. Move again to the 
directory \tts{\$DD4hepINSTALL/examples/CLIDSid/eve} and open the sample file
\tts{CLICSiD\_Events.root} containing a sample of events being the output of 
a \DDG simulation step:

\begin{figure}[h]
  \begin{center}
    \includegraphics[height=130mm] {DDEve_4.png}
    \caption{The popup dialog to open event data files.}
    \label{fig:DDEve_4.png}
  \end{center}
\end{figure}
Using the \tts{"Views"} menu other predefined detector views may be used.

\newpage
\noindent 
The \tts{"Eve"} tab on the pane to the left allows to further customize the 
predefined views, the \tts{Evt I/O} tab to control which event should 
be displayed.

\begin{figure}[h]
  \begin{center}
    \includegraphics[height=130mm] {DDEve_5.png}
    \caption{An example of a customized view with sub-panes. Please proceed 
               to the XML configuration file how to create a predefined view.}
    \label{fig:DDEve_5}
  \end{center}
\end{figure}

\newpage
\noindent
\begin{figure}[h]
  \begin{center}
    \includegraphics[height=130mm] {DDEve_7.png}
    \caption{Calorimetr energy deposits in the ECAL (red) and the HCAL(blue).}
    \label{fig:DDEve_5}
  \end{center}
\end{figure}

\newpage
\noindent
\begin{figure}[h]
  \begin{center}
    \includegraphics[height=130mm] {DDEve_8.png}
    \caption{HCAL calorimeter deposits together with Monte-Carlo tracks.}
    \label{fig:DDEve_5}
  \end{center}
\end{figure}


%=============================================================================
\section{View Configuration}
\label{sec:ddeve-user-manual-display-configuration}
%=============================================================================
\noindent
This part of the \DDE application is not really stable. to configure displays
other than for the \tts{CLICSiD} example, you have to use the trial and error 
approach. Starting from the \tts{CLICSiD} example is not too bad an approach.


%=============================================================================
\newpage
\begin{thebibliography}{9}
\input{DD4hep-bibliography.tex}
\end{thebibliography}
%=============================================================================
\end{document}
