@@ -183,17 +183,23 @@ The accuracy of this method is good for all elements except for those that overl

The \texttt{OrbitThreader} integrates a design particle through the lattice and setups up a multi map structure (\texttt{IndexMap}). Furthermore when the reference particle hits an rf-structure for the first time then it auto-phases the rf-structure, see Appendix~\ref{autophasing}. The multi map structure speeds up the search for elements that influence the particles at a given position in 3D space by minimizing the looping over elements when integrating an ensemble of particles. For each time step, \texttt{IndexMap} returns a set of elements $\mathcal{S}_{\text{e}}\subset{e_0\ldots e_n}$ in case of the example given in Figure~\ref{KS1}. An implicit drift is modelled as an empty set $\emptyset$.

\subsection{Flow Diagram of \textit{OPAL-t}}

\input{figures/opalt/flowdiagram}

\begin{figure}[!htb]

\centering

\includegraphics{figures/opalt/flowdiagram.png}

\caption{Schematic workflow of \opalt's execute method.}

\label{fig:OPALTSchemeSimple}

\end{figure}

A regular time step in \textit{OPAL-t} is sketched in Figure~\ref{OPALTSchemeSimple}. In order to compute the coordinate system transformation from the reference coordinate system $K_s$ to the local coordinate systems $K'_n$ we join the transformation from floor coordinate system $K$ to $K'_n$ to the transformation from $K_s$ to $K$. All computations of rotations which are involved in the computation of coordinate system transformations are performed using quaternions. The resulting quaternions are then converted to the appropriate matrix representation before applying the rotation operation onto the particle positions and momenta.

As can be seen from Figure~\ref{OPALTSchemeSimple} the integration of the trajectories of the particles are integrated and the computation of the statistics of the six-dimensional phase space are performed in the reference coordinate system.

\section{Output}

In addition to the progress report that \textit{OPAL-t} writes to the standard output (stdout) it also writes different files for various purposes.

This file is used to log the statistical properties of the bunch in the ASCII variant of the SDDS format \ref{bib:borland1995}. It can be viewed with the SDDS Tools \ref{bib:borland2016} or GNUPLOT. The frequency with which the statistics are computed and written to file can be controlled With the option \texttt{STATDUMPFREQ}. The information that is stored are found in the following table.

\textit{OPAL-t} computes the statistics of the bunch for every \texttt{MONITOR} that it passes. The information that is written can be found in the following table.

\textit{OPAL-t} copies the input file into this file and replaces all occurrences of \texttt{ELEMEDGE} with the corresponding position using \texttt{X}, \texttt{Y}, \texttt{Z}, \texttt{THETA}, \texttt{PHI} and \texttt{PSI}.

\textit{OPAL-t} stores for every element the position of the entrance and the exit. Additionally the reference trajectory inside dipoles is stored. On the first column the name of the element is written prefixed with ``BEGIN: '', ``END: '' and ``MID: '' respectively. The remaining columns store the z-component then the x-component and finally the y-component of the position in floor coordinates.

This Python script can be used to generate visualizations of the beam line in different formats. Beside an ASCII file that can be printed using GNUPLOT a VTK file and an HTML file can be generated. The VTK file can then be opened in e.g. ParaView \ref{paraview,bib:paraview} or VisIt \ref{bib:visit}. The HTML file can be opened in any modern web browser. Both the VTK and the HTML output are three-dimensional. For the ASCII format on the other hand you have provide the normal of a plane onto which the beam line is projected.

The script is not directly executable. Instead one has to pass it as argument to \texttt{python}:

...

...

@@ -335,7 +341,7 @@ The following arguments can be passed

\item\texttt{-{}-export-web} to export for the web

\item\texttt{-{}-project-to-plane x y z} to project the beam line to the plane with the normal with the components \texttt{x}, \texttt{y} and \texttt{z}

This file can be used when plotting the statistics of the bunch to indicate the positions of the magnets. It is written in the SDDS format. The information that is written can be found in the following table.