\documentclass[11pt]{article}
\title{TRIUMF E614 \\ TWIST Magnet: Field Map Study Final Report}
\author{By Roberto Armenta}
\date{August 23, 2002}

\usepackage{amsmath,amssymb,amsfonts} 
\usepackage{graphics}                 
\usepackage{color}                    
\usepackage{hyperref}                 

\oddsidemargin 0cm
\evensidemargin 0cm
\textwidth 15.5cm
\topmargin -2cm
\parindent 0cm
\textheight 24cm
\parskip 2.5mm

\begin{document}
\thispagestyle{empty}
\vspace*{7cm}
\begin{center}
\huge TRIUMF E614 \\
\vspace{0.5cm}
\huge TWIST Magnet: Field Map Study Final Report \\
\vspace*{1cm} 
\large By Roberto Armenta \\
\vspace*{1cm}
\large August 27, 2002 \\
\normalsize
\end{center}

\newpage
\vspace*{4cm}
\begin{abstract}
The purpose of this study was to determine how accurately the magnetic field inside the spectometer is known.
To do this, the Hall probe mapper was used to take a series of maps at different field strength settings.
The comparison between the OPERA ($field\_map.0003$) and the measured maps that were taken in April of 2002 has 
been completed and three main discrepancies were found: the measured maps have an upstream-downstream asymmetry of 
$7Gauss$ that is not predicted by OPERA; the measured field falls faster than $field\_map.0003$ 
as we move away from the center of the yoke (i.e. field gradient is different as we move away from the 
center); and the axis of the coils seems to be shifted in $x$ and $y$ by one to two millimeters.

To introduce modifications to correct and study these discrepancies the following new OPERA maps were produced:

\begin{center}
\begin{tabular}{|c|c|} \hline
Map                     & Comment on modification \\ \hline
$field\_map.0004$       & BH curve \\ \hline
$field\_map.0005$       & BH curve + asymmetry + gradient corrections\\ \hline
$field\_map.0006$       & BH curve + coil shift of $\Delta x=-1.54cm$ and $\Delta y=-1.83cm$ \\ \hline
$field\_map.0006a$      & BH curve + coil shift of $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$ \\ \hline
$field\_map.0007$       & \begin{tabular}{c} BH curve + coil shift of $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$ \\ + asymmetry + gradient corrections \end{tabular} \\ \hline
\end{tabular}
\end{center}

$field\_map.0005$ is meant to be the new official CFM map to be used by GEANT and MOFIA. 
Agreement between OPERA ($field\_map.0005$) and the measured field was achieved to within $\pm 5Gauss$
for the region $-600mm~\leq~z~\leq~600mm$ (which covers all the PC and DC chambers) and within $\pm 2Gauss$ for 
the region $-500mm~\leq~z~\leq~500mm$ (which only covers the DC chambers and the target PC chambers). These 
uncertainties are representative of the accuracy with which the field is known inside the tracking volume.
\end{abstract}

\newpage
\begin{center} \large
TRIUMF E614 \\ TWIST Magnet: Field Map Study Final Report \\
\end{center} \normalsize

The purpose of this study was to determine how accurately the magnetic field inside the spectometer is known.
To do this, the Hall probe mapper was used to take a series of maps at different field strength settings.
The analysis of the maps has been completed. This report summarises the work done, the 
obtained results, and provides some recommendations for future studies.

\section{Data Taken}

\subsection{Combined Maps}

All the available mapper files were combined to obtain four maps: one at $19.6kGauss$, two at $20.0kGauss$ and 
one at $20.4kGauss$. Each map contains the average values of all the measurements that were taken under the same conditions. 
The mapper files were merged in the following way:

\subsubsection{19.6 kGauss Map} \small
\begin{center}
\begin{tabular}{|c|c|c|c|}                                  					  \hline
 	File	    & 	 	$z$       &	 $\phi$   &   		Comment		       \\ \hline
2002-04-25-16-24-22.dat &    -650,650,50  &    0,345,15   &   19.600 kG, phi misses 200, -7 at 500 \\ \hline
2002-04-26-15-52-59.dat &    -650,650,50  &    0,345,15   &   19.600 kG                            \\ \hline
2002-04-27-15-23-15.dat &    -650,-400,25 &    0,345,15   &   19.600 kG                            \\ \hline
2002-04-28-15-41-16.dat &    400,625,25   &    0,345,15   &   19.600 kG                            \\ \hline
2002-05-01-17-19-01.dat &    -450,600,50  &    0,90,15    &   19.600 kG, NMR(0) and Lock           \\ \hline
2002-05-02-10-14-11.dat &    -450,700,50  &    0,180,90   &   19.600 kG, NMR(0) and Lock           \\ \hline
2002-05-02-11-41-00.dat &   -450,700,50   &    0,180,90   &   19.600 kG, NMR(0) and Lock           \\ \hline
\end{tabular}
\end{center} \normalsize

\subsubsection{20.0 kGauss Map (map without NMR measurements)} \small
\begin{center}
\begin{tabular}{|c|c|c|c|}                                     \hline    
	File		&	$z$ 	 &   $\phi$       &     Comment                             \\ \hline
2002-04-17-16-08-51.dat &    -650,650,50 &    0,345,15    &    120.6 G                              \\ \hline
2002-04-19-16-56-15.dat &    -650,650,50 &    0,345,15    &    20.000 kG, phi limit -10.6            \\ \hline
2002-04-20-11-48-54.dat &    -650,650,50 &    0,345,15    &    20.000 kG, phi misses 500,550         \\ \hline
2002-04-21-13-00-59.dat &    -650,500,50 &    0,345,15    &    20.000 kG, phi misses 500, quits      \\ \hline
2002-04-22-16-29-03.dat &    -650,500,50 &    0,345,15    &    20.000 kG, phi limit -6.3, misses 550 \\ \hline
2002-04-23-09-27-25.dat &    -650,-400,25 &    0,345,15   &     20.000 kG                            \\ \hline
2002-04-23-12-38-21.dat &    400,625,25  &    0,345,15    &    20.000 kG, phi misses 500             \\ \hline
\end{tabular}
\end{center} \normalsize

\subsubsection{20.0 kGauss Map (map with NMR measurements)} \small
\begin{center}
\begin{tabular}{|c|c|c|c|}                                     \hline
	File		&	$z$	 &    $\phi$      &       Comment			\\ \hline
2002-05-02-15-36-56.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(0) and Lock	\\ \hline
2002-05-03-11-54-28.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(3.25) and Lock	\\ \hline
2002-05-04-10-58-40.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(3.25) and Lock	\\ \hline
2002-05-05-12-51-48.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(3.25) and Lock	\\ \hline
2002-05-05-21-15-34.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(6.5) and Lock	\\ \hline
2002-05-06-09-54-22.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(6.5) and Lock	\\ \hline
2002-05-06-15-19-08.dat &    -450,700,50 &    0,180,15    &    20.000 kG, NMR(6.5) and Lock	\\ \hline
\end{tabular} 
\end{center} \normalsize

\subsubsection{20.4 kGauss Map} \small
\begin{center}
\begin{tabular}{|c|c|c|c|}					\hline
	File		&	$z$	  &     $\phi$   &        Comment			\\ \hline
2002-04-23-17-22-59.dat &    -650,650,50  &   0,345,15   &     20.400 kG, phi misses 500	\\ \hline
2002-04-24-09-56-34.dat &    -650,-400,25 &   0,345,15   &     20.400 kG			\\ \hline
2002-04-24-13-36-05.dat &    400,625,25   &   0,345,15   &     20.400 kG, phi wanders		\\ \hline
2002-04-24-17-39-16.dat &    -650,650,50  &   0,345,15   &     20.400 kG			\\ \hline
\end{tabular} 
\end{center} \normalsize

\subsection{Volume of Interest}

The maps cover the cylindrical region defined by
\begin{equation}
\begin{array}{ccccc}
-650mm  & \leq &  z   & \leq  & 650mm     \\
0\deg   & \leq & \phi &    <  & 360\deg   \\
0mm     & \leq &  r   & \leq  & 247.56mm
\end{array}
\label{ecuacion1}
\end{equation}
in standard TWIST coordinate system (with $\phi$ measured from the positive x-axis).

The data is spaced at intervals of $50mm$ in $z$, $15\deg$ in $\phi$ and $41.3mm$ in $r$ (the $r$ figure corresponds to 
the spacing between Hall probes in the arm of the mapper). At least two measurements were taken at each point at different 
times. As a reminder, PC plane \#1 is located at $z=-59.73mm$ and PC plane \#12 is located at $z=59.79mm$.

\subsection{Calibration}

Since the calibration of the Hall probes varies drastically every time the power is turned off, the probes were 
calibrated using a NMR probe; the calibration values were obtained at $z=0mm$.  The reproducibility of the Hall Probes is 
within $\pm0.25 Gauss$ while the reproducibility of the NMR probe is within $\pm0.05Gauss$.

Since NMR probes measure the total magnitude of the field, and Hall probes measure only the $z$ component of the field, 
a study was made to determine the impact of this difference on the calibration. The study was carried out in 
OPERA, and it demonstrated that \begin{equation}|B|-|B_{z}|~\leq~10^{-6}kGauss \label{ecuacion2} \end{equation} 
within the volume
\begin{equation} 
\begin{array}{ccccc}
-200mm  & \leq &  z   & \leq  & 200mm     \\
0\deg   & \leq & \phi &    <  & 360\deg   \\
0mm     & \leq &  r   & \leq  & 247.56mm
\end{array},
\label{ecuacion3}
\end{equation}
where the calibration was taken. 

\subsection{Error Analysis}

Since at least two points were available at each point covered by all four maps, standard deviations
\footnote{Standard deviations were calculated in the following way: \\
\($For each~$(x,y,z)$~point,~$ \sigma_{(x,y,z)}^{2}=\frac{1}{n-1} \sum_{i=1}^{n} (B_{i}-\overline{B})^{2} \), 
where $i$ represents each of the $n$ available measurements at each $(x,y,z)$ point.} 
were obtained at each point for each of the four maps. For most points, the values turned out to be in the order 
of $0.25Gauss$. The standard deviation in the measurements has probe dependence, and to show this, an average 
value of the standard deviation per probe was obtained by averaging the standard deviation of all the available 
measurements. The results are 

\begin{equation} 
\begin{array}{ccccc} $Probe 1$ & : & \sigma_{1} & = & 0.1925 Gauss   \\
$Probe 2$ & : & \sigma_{2} & = & 0.1974 Gauss   \\
$Probe 3$ & : & \sigma_{3} & = & 0.2265 Gauss   \\
$Probe 4$ & : & \sigma_{4} & = & 0.2073 Gauss   \\
$Probe 5$ & : & \sigma_{5} & = & 0.2015 Gauss   \\
$Probe 6$ & : & \sigma_{6} & = & 0.2334 Gauss   \\
$Probe 7$ & : & \sigma_{7} & = & 0.2827 Gauss   \\
\end{array}, 
\label{ecuacion4}
\end{equation}

where Probe 1 is the probe at the center of the mapper and Probe 7 is the outermost probe in the arm. Note that the highest 
value corresponds to Probe 7 and the smallest one corresponds to Probe 1. 

As stated in the previous subsection, all probes were calibrated using a NMR probe; however, for reasons not fully 
understood, a poor calibration for Probe 2 was obtained. The rest of the probes have relatively good 
calibrations. Probe 2 had to be calibrated from an interpolation of the measurements in the remaining probes. 

These standard deviations represent only the constraint in the reproducibility of the measurements. To obtain the final
uncertainties, the error in the calibration (plus the error in the interpolation if applicable) has to be considered. It 
was concluded that in order to obtain consistent results, a criteria of at least plus-minus four average standard 
deviations (i.e. $\pm 4\sigma_{i}$ for $i=1,2,...,7$) must be used to give a final uncertainty for each probe. Using 
this criteria, it can be said that {\bf most values in the measured maps can be trusted to $\pm 1Gauss$}. As will 
be shown later, if a criteria that produces smaller uncertainties is used, the measured maps present features that 
are unlikely to be real.

\section{Shape of Measured Field Maps}

Before discussing any features of interest produced by the analysis, a review of the measured field shape is presented to 
familiarize the reader with some features of the field that play a relevant role in the discussion ahead. For simplicity, 
only the $20.0kGauss$ field is presented, but the fields at $19.6kGauss$ and $20.4 kGauss$ present the same general shape.

\subsection{Field Variation as a Function of $z$}

\begin{figure}
\begin{picture}(100,450)
\put(-60,250){\resizebox{10cm}{!}{\includegraphics{graph_x0_y0}}} 
\put(240,250){\resizebox{10cm}{!}{\includegraphics{graph_x0_y83}}}
\put(-60,0){\resizebox{10cm}{!}{\includegraphics{graph_x0_y165}}}
\put(240,0){\resizebox{10cm}{!}{\includegraphics{graph_x0_y248}}}
\end{picture}
\caption{$B_{z}$ vs. $z$ plots for measured 20.0kGauss map (without NMR measurements) for various positions along the
$y$-axis. All plots are in the same scale.}
\label{figura1}
\end{figure}

The various plots in Figure~\ref{figura1} show the measured $B_{z}$ component of the $20.0kGauss$ field map as a
function of $z$ for different ($x,y$) points moving up in the positive $y$ direction; all the plots have the same
scale and correspond to positions of the first, third, fifth and seventh probes respectively. The dashes represent
the location of the measurements and the solid line represents a polynomial fit of the function 
$f(x)=ax^{4}+bx^{3}+cx^{2}+dx+e$ to the measurements. This shape with ``lobes'' at $z=\pm400mm$ is characteristic 
of all ($x,y$) points; note that the height of the lobes with respect to the field value at $z=0mm$ increases as 
we move outwards in $r$.

\subsection{Field Variation in the Radial Direction}
To analyze the field variation as a function of $r$, the field map can be divided into three main regions:
\begin{equation} 
\begin{array}{ccccccc}
$Region 1$ & : & -650mm & \leq & z & <    & -325mm \\
$Region 2$ & : & -325mm & \leq & z & \leq & +325mm \\
$Region 3$ & : & +325mm & <    & z & \leq & +650mm \\
\end{array}.
\label{ecuacion5}
\end{equation}

The reason for dividing the map into three regions is that the field has inflection points at roughly $z=\pm325mm$,
and the  pattern of the field as a function of $r$ changes drastically in these three regions. Figure~\ref{figura2}
shows five two-dimensional plots that show how the field varies as a function $r$ (and $\phi$) in each of the
three different regions. The plot at the top of the figure shows a typical plot of the field in Region 2; the two 
plots at the center show the field at the inflection points; and the two plots at the bottom show the field in 
regions 1 and 3 respectively. The five plots have the same scale for all the three dimensions and the $B_{z}$-axis 
covers a range of $70Gauss$.

The plot at the top of Figure~\ref{figura2} shows the field in the center of Region 2 (i.e. $z=0mm$). At $z=0mm$, the
field is roughly flat and smooth with a difference between its maximum and minimum value of roughly $11Gauss$. As we 
move away from the center of Region 2 towards Region 1 or 3, the overall field increases and the center values of the 
field increase faster than the values at the edge forming a central plateau at $z=\pm325mm$ (see the two plots at the
center of Figure~\ref{figura2}). At $z=\pm325mm$ the difference between the maximum and minimum value is roughly
$20Gauss$.

As we move away from the boundaries at $z=\pm325mm$ into regions 1 and 3, the values at the edge of the mesh plots tend
to be higher than the values at the center forming a cone (see the two plots at the bottom of Figure~\ref{figura2}). The
difference between the maximum and minimum value in the two plots at the bottom of Figure~\ref{figura2} is 
roughly $35Gauss$. As we move in $z$ towards the outer edges of regions 1 and 3, the field preserves the same 
conical shape shown in the two plots at the bottom of Figure~\ref{figura2}, but the difference between the maximum 
and minimum value of the field can be as large as $250Gauss$.

\begin{figure}
\begin{picture}(100,670)
\put(70,480){\resizebox{10cm}{!}{\includegraphics{mesh_z0}}}
\put(-60,240){\resizebox{10cm}{!}{\includegraphics{mesh_z325}}}
\put(240,240){\resizebox{10cm}{!}{\includegraphics{mesh_z-325}}}
\put(-60,0){\resizebox{10cm}{!}{\includegraphics{mesh_z400}}}
\put(240,0){\resizebox{10cm}{!}{\includegraphics{mesh_z-400}}}
\end{picture}
\caption{Mesh plots for measured $20.0kGauss$ map (without NMR measurements). All plots are in the same scale.}
\label{figura2}
\end{figure}

\section{Current OPERA Model}

The CFM field map that is for use in GEANT and MOFIA is $field\_map.0003$. This map is based on the as 
built geometry of the spectrometer and corresponds to the OPERA map generated by Mike Barnes in May 
of 2002. The OPERA model used to generate this map is:
\begin{center}
E614\_iron\_cube5b\_YZ\_noreg\_X+0\_Y+0\_Z+0\_221A\_BH106\_BHus106\_BHds106.op3.
\end{center}
This model has been presented in previous reports and assumes a coil current of $221A$, which 
generates a field perfectly symmetric about $z$ with center $B_{z}$ value of $20.039kGauss$.

The same model that was used to generate $field\_map.0003$ was used to generate maps at $20.4kGauss$ and $19.6kGauss$ 
for comparison purposes. All four measured maps at the three different field strength values were compared with 
OPERA maps. In the next section, results are presented only for the comparison between $field\_map.0003$ and 
one of the $20.0kGauss$ maps. Similar results hold for the $20.4kGauss$ and $19.6kGauss$ maps and the extra relevant 
information is included in section~\ref{sec_1}.

Out of the two $20.0kGauss$ maps, only one covers the entire tracking volume (the map that was taken without NMR 
measurements). The comparison at $20.0kGauss$ was based mainly on this map; the other $20.0kGauss$ map (the one 
with NMR measurements) was used only to do a consistency check. 

\section{Comparison between current OPERA model and 20.0kGauss Measured Map}

\subsection{Comparison along the $z$-axis}
\label{sec_2}

Figure~\ref{figura4} presents a difference plot for $field\_map.0003$ and the measured field map as a function 
of $z$ for the point $x=y=0mm$. The error bars in the plot represent plus-minus one standard deviation in the 
values obtained for a given point; the plot is normalised at $z=0$. There are three features of this plot that 
deserve highlights. First, note that the measured field has an {\bf upstream-downstream asymmetry} of about 
$7Gauss$. Second, note that as we move away from the center towards $z=\pm600mm$, the {\bf measured field falls 
much faster than predicted by OPERA}; an OPERA study demonstrated that two main variables dominate this effect: 
the BH curve of the yoke and the position of the two sets of outer coils with respect to the $z$-axis. Third, 
note that the error bars in the measurements increase for values close to $z=600mm$; this is due to a mechanical 
problem in the positioning of the mapper which was significant enough to slightly increase the standard 
deviation of the measurements.

\begin{figure}
\begin{picture}(100,200)
\put(70,0){\resizebox{10cm}{!}{\includegraphics{Compare}}} 
\end{picture}
\caption{$B_{z}$ vs. $z$ for OPERA $field\_map.0003$ minus measured $20.0kGauss$ (map without NMR measurements) at $x=0mm,y=0mm$.}
\label{figura4}
\end{figure}

Now, for completeness, Figure~\ref{figura5} presents how the difference between $field\_map.0003$ and the measured 
field for different ($x,y$) points moving radially outwards. The figure is composed of four plots, all on the 
same scale. The upper-left plot in Figure~\ref{figura5} corresponds to the plot shown in Figure~\ref{figura4}.
The upper-right, lower-left and lower-right plots present difference plots for positions corresponding to the 
third, fifth and seventh probes respectively. Note how the measured field map is quite irregular as we move 
outwards in the radial direction.

\begin{figure}
\begin{picture}(100,450)
\put(-60,250){\resizebox{10cm}{!}{\includegraphics{graph_x0_y0_d}}}
\put(240,250){\resizebox{10cm}{!}{\includegraphics{graph_x0_y83_d}}}
\put(-60,0){\resizebox{10cm}{!}{\includegraphics{graph_x0_y165_d}}}
\put(240,0){\resizebox{10cm}{!}{\includegraphics{graph_x0_y248_d}}}
\end{picture}
\caption{$B_{z}$ vs. $z$ plots for $field\_map.0003$ minus measured $20.0kGauss$ map (without NMR 
measurements). All plots are in the same scale.}
\label{figura5}
\end{figure}

\subsection{Comparison in the Radial Direction}

Figure~\ref{figura6} shows three plots of $B_{z}$ vs. $r$ at $z=0,+400$ and $-400mm$ respectively. The plots have 
two solid lines, one represents the OPERA map (the perfectly symmetric one) and the other represents a fit of 
$f(x)=ax^{4}+bx^{3}+cx^{2}+dx+e$. Note that the apparent irregularity in the measured field shown in the upper plot 
of Figure~\ref{figura6} is just a calibration artifact. Considering the smoothness of the calibration independent 
measurements (i.e. measurements along the $z$-axis), it is very unlikely that this irregularity is a true feature 
of the field.

\begin{figure}
\begin{picture}(100,450)
\put(70,250){\resizebox{10cm}{!}{\includegraphics{graph_phi0_z0}}}
\put(-60,0){\resizebox{10cm}{!}{\includegraphics{graph_phi0_z-400}}}
\put(240,0){\resizebox{10cm}{!}{\includegraphics{graph_phi0_z400}}}
\end{picture}
\caption{Plots of $B_{z} $ vs. $r$ at $\phi=0\deg$ and $z=0,-400$ and $400mm$ respectively. The scale in the upper plot is
$2Gauss$ per grid square and the scale in the lower plots is $5Gauss$ per grid square.}
\label{figura6}
\end{figure}

\subsection{Map Scaling}

As a remark, to be able to compare $field\_map.0003$ with the measured map, $field\_map.0003$ was scaled to match the 
value of the measured map at the center value. This scaling assumes that for a factor very close to one, OPERA 
generated fields scale linearly. This is a safe assumption that was demonstrated in OPERA and that was made 
because it is not practical to generate an OPERA field that exactly matches the center value of each of the 
measured fields. OPERA demonstrated that within a rage of $\pm100Gauss$ is safe to scale the field up or down 
without failing to predict the correct shape of the field.

\section{19.6 kGauss and 20.4kGauss Maps}
\label{sec_1}

As far as the comparisons of the $19.6kGauss$ and $20.4kGauss$ maps are concerned, the only significant result is 
that the upstream-downstream asymmetry mentioned earlier increases with increasing field.

\section{Axis of Symmetry}

In theory, the field produced by the solenoid should be perfectly symmetric about $z$ (i.e. no $\phi$ 
dependence), and a study was made to determine to what extent the measured maps have this property. For the 
purpose of this investigation, an axis of symmetry is defined as the ($x,y$) point where the center of the field 
lies for every available $x$-$y$ plane in the measured maps. With this in mind, the results for one of the 
$20.0kGauss$ maps are now presented. Similar results hold for the $19.6kGauss$ and $20.4kGauss$ maps without any 
significant differences.

\subsection{Axis Profile}

To obtain a quantitative approximation of the axis of symmetry, the following technique was used: a polynomial of 
the type $f(x)=ax^{4}+bx^{3}+cx^{2}+dx+e$ was fit to points corresponding to probes 3 to 7 along the $x$ and 
$y$ axis. Then, the location of the minimum in the fitted polynomial that is closest to $x=y=0$ was calculated. 
This was done for each available $x$-$y$ plane in the measurements. Ideally, this fit should produce a polynomial 
that is perfectly symmetric about $x=y=0$, and the shift of the minimum with respect to the center of each 
$x$-$y$ plane is a measure of the overall shift in $x$ and $y$.

The profile for the axis of symmetry obtained this way for the $20.0kGauss$ map is shown in 
Figure~\ref{figura9}. The calculated $x$ and $y$ components of the field center are plotted as a function of 
$z$; the plot at the top shows the profile for the $x$-axis and the plot at the bottom shows the same for 
the $y$-axis. 

Figure~\ref{figura9} needs some explanation to be interpreted. In the region defined by \begin{equation} -325mm 
\leq z \leq 325mm, \label{ecuacion6} \end{equation} where the field shape is dominated by the coils (this has been 
confirmed in OPERA), the center of the field is shifted in $x$ and $y$ by approximately $\Delta x=-1.54cm$ 
and $\Delta y=-1.83cm$. Note that both profiles go to very large values at about $z=\pm350mm$; this does not mean 
that the center of the axis goes to infinity, it just means that, at the field inflection points ($z=\pm325mm$), 
the field center is ill-defined. Figure~\ref{figura9} seems to suggests that physically the coils are shifted in 
$x$ and $y$ by an amount that is in the order of $\Delta x=-1.54cm$ and $\Delta y=-1.83cm$
\footnote{The exact numbers are $\Delta x=-1.54129cm$ and $\Delta y=-1.83495cm$}.

\begin{figure}
\begin{picture}(100,450)
\put(60,0){\resizebox{10cm}{!}{\includegraphics{Y_center2}}}
\put(60,240){\resizebox{10cm}{!}{\includegraphics{X_center2}}}
\end{picture}
\caption{$20.0kGauss$ Map Axis Profile. Upper plot shows the $x$-axis profile. Lower plot shows $y$-axis profile.}
\label{figura9}
\end{figure}

As a remark, better methods have been suggested and can be used to define and calculate an axis of symmetry; 
however, for the given resolution, the method used was found sufficiently accurate. Other methods (some of 
which might be more accurate) were used, but the overall conclusion did not change. Because fitting simple 
polynomials is computationally very easy, the presented technique was used.

\subsection{Axis Profile OPERA Study}

To determine whether or not the method used to obtain the profile of the axis of symmetry has a real physical 
meaning regarding the position of the coils, the following OPERA study was made: the coils in the model were 
shifted in $x$ and $y$ by $\Delta x=-1.54cm$ and $\Delta y=-1.83cm$ as suggested by Figure~\ref{figura9}, and 
the profile of the axis of symmetry was calculated for this model using the same routine that was used for the 
measured map. This study was carried out only at the $20.0kGauss$ field strength value, and the results are now 
presented.

The OPERA models used for this study are:
\begin{center}
\begin{itemize}
\item E614\_iron\_cube5b\_YZ\_X+0\_Y+0\_Z+0\_221A\_BH10\_BHus10\_BHds10.op3
\item E614\_iron\_cube5b\_XY\_X-154\_Y-183\_Z+0\_221A\_BH10\_BHus10\_BHds10.op3
\item E614\_iron\_cube5b\_XY\_X-015\_Y-018\_Z+0\_221A\_BH10\_BHus10\_BHds10.op3
\end{itemize}
\end{center}

The three models are fully based on the as built geometry and use the nominal ten-ten steel BH curve. 
The first model was used to produce a new map named $field\_map.0004$ and it is fully based on the as built 
geometry; the only difference between the current OPERA model (used to produce $field\_map.0003$) and 
$field\_map.0004$ is that in the current OPERA model the nominal ten-ten steel BH curve was scaled by a factor of 
1.06. 

The second model was used to produce $field\_map.0006$. The only difference between the first model and 
second model is that in the second model all the coils were shifted by $\Delta x=-1.54cm$ and $\Delta 
y=-1.83cm$. 

The third model was used to produce $field\_map.0006a$. The only difference between the first and the third
model is that in $field\_map.0006a$ all the coils were shifted by $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$.
That is, in the third model the coils were shifted by an order of magnitude less than in the second model.

Figure~\ref{figura10} shows the calculated axis of symmetry profile for $field\_map.0006$.
The outstanding result shown by Figure~\ref{figura10} is that the routine used to calculate the axis of 
symmetry {\bf overestimates the coil shift by roughly one order of magnitude}. When the real shift in the coils 
is $\Delta x=-1.54cm$ and $\Delta y=-1.83cm$, the routine used to calculate the axis of symmetry suggests that 
the shift is in the order of 15cm to 18cm. This means that it is not possible that the coils in the magnet are 
out of place by more than two millimeters. 

\begin{figure}
\begin{picture}(100,450)
\put(60,0){\resizebox{10cm}{!}{\includegraphics{centero_y}}}
\put(60,240){\resizebox{10cm}{!}{\includegraphics{centero_x}}}
\end{picture}
\caption{$field\_map.0006$ Axis Profile. Upper plot shows the $y$-axis profile. Lower plot shows $x$-axis 
profile. Coil shift corresponds to $\Delta x=-1.54cm$ and $\Delta y=-1.83cm$.}
\label{figura10}
\end{figure}

To actually reproduce in OPERA the output of the measured field as shown in Figure~\ref{figura9}, the coils had 
to be shifted by $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$. Figure~\ref{figura11} shows the axis profile 
produced by $field\_map.0006a$, where the coils were shifted by this amount. Figure~\ref{figura11} is the closest 
resemblance of Figure~\ref{figura9} that was obtained and confirms that {\bf the actual shift in the coils is 
not greater than two millimeters}. Due to the uncertainty in the calibration, its not possible to do 
better than a one digit estimate of the actual shift, but two millimeters offers a good bound. It is therefore 
safe to say that {\bf the coils are aligned with the $z$-axis of the yoke to within at least two millimeters}.

\begin{figure}
\begin{picture}(100,450)
\put(60,0){\resizebox{10cm}{!}{\includegraphics{centero_y1}}}
\put(60,240){\resizebox{10cm}{!}{\includegraphics{centero_x1}}}
\end{picture}
\caption{$field\_map.0006a$ Axis Profile. Upper plot shows the $y$-axis profile. Lower plot shows $x$-axis 
profile. Coil shift corresponds to $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$.}
\label{figura11}
\end{figure}

Finally, to show that the method used to calculate the axis of symmetry is representative of the position 
of the coils and does not introduce a constant bias, the axis of symmetry was calculated for $field\_map.0004$ 
where there is no coil shift. The resulting profile turned out perfectly flat, just as expected.

In summary, the routine used to calculate the axis of symmetry is helpful visualizing where the coils are in $x$ 
and $y$; however, when there is a shift, it has an amplification effect of roughly one order of magnitude.
The real magnitude of the shift is something in the order of one to two millimeters. 

\section{New OPERA Models}

Thus far, the comparison between the current OPERA model (used for $field\_map.0003$) and the measured map 
yielded three features of interest: the measured map has an upstream-downstream asymmetry of $7Gauss$ that is 
not predicted by OPERA; the measured field falls faster than OPERA predicted as we move away from the center of 
the yoke (i.e. field gradient is different as we move away from the center); and the axis of the coils seems to 
be shifted in $x$ and $y$ by one to two millimeters. Since the ultimate goal of this study is to produce an  
OPERA model that is as close as possible to the real field, new OPERA models were produced that introduce
modifications to correct these discrepancies or to study them in GEANT.

The new OPERA models produced as a result of this study are shown in Table~\ref{tabla1}. The BH curve for all 
the models in Table~\ref{tabla1} is for nominal ten-ten steel. The main reason for a change in BH curve is 
that the nominal curve seems to produce field gradients that are closer to the measured fields than those 
produced by the current model, which had the nominal ten-ten steel BH curve scaled by 1.06.

\begin{table}
\begin{tabular}{|c|} \hline
File name: E614\_iron\_cube5b\_YZ\_X+0\_Y+0\_Z+0\_221A\_BH10\_BHus10\_BHds10.op3	 \\ Modification: New BH curve \\ Map file: $field\_map.0004$ \\ \hline	
File name: E614\_iron\_cube5b\_XY\_X-154\_Y-183\_Z+0\_221A\_BH10\_BHus10\_BHds10.op3 \\ Modifications: $\left\{ \mbox{\begin{tabular}{c} New BH curve \\ Coil shift\end{tabular}} \right.$ \\ Map file: $field\_map.0006$ \\ \hline
File name: E614\_iron\_cube5b\_XY\_X-015\_Y-018\_Z+0\_221A\_BH10\_BHus10\_BHds10.op3 \\ Modifications: $\left\{ \mbox{\begin{tabular}{c} New BH curve \\ Coil shift\end{tabular}} \right.$ \\ Map file: $field\_map.0006a$ \\ \hline
File name: E614\_iron\_cube5b\_YZ\_X+0\_Y+0\_Z+0\_221A\_BH10\_BHus10\_BHds10\_Z\_shift\_0018.op3 \\ Modifications: $\left\{ \mbox{\begin{tabular}{c}New BH curve\\ Field gradient \\ Upstream-downstream asymmetry \end{tabular}} \right.$ \\ Map file: $field\_map.0005$ \\ \hline
File name: E614\_iron\_cube5b\_XY\_X-015\_Y-018\_Z+0\_221A\_BH10\_BHus10\_BHds10\_Z\_shift\_0018.op3 \\ Modifications: 
$\left\{ \mbox{ \begin{tabular}{c}New BH curve\\ Coil shift \\ Field gradient \\ Upstream-downstream asymmetry \end{tabular}} \right.$ \\ Map file: $field\_map.0007$ \\ \hline
\end{tabular}
\caption{New OPERA models.}
\label{tabla1}
\end{table}

The first three models in Table~\ref{tabla1} have already been discussed. The last two models
were used to produce $field\_map.0005$ and $field\_map.0007$; these are the models that offer the closest match 
to the measured field. $field\_map.0005$ is intended to replace $field\_map.0003$ and $field\_map.0007$ was 
produced to study what is the effect of a misalignment in the position of the coils with respect to $x$ and 
$y$. Maps $field\_map.0005$ and $field\_map.0007$ are now discussed.

\subsection{field\_map.0005}

In section~\ref{sec_2}, Figure~\ref{figura4} was presented and two discrepancies were highlighted: an 
upstream-downstream asymmetry and a difference in the field gradient. To correct for these two discrepancies, 
two modifications were introduced to the as built geometry to produce $field\_map.0005$. First, the two 
sets of outer coils were moved towards the center of the yoke by $0.18cm$; this shift together with the change 
in BH curve corrected the gradient of the model to match the gradient of the measured map. Second, to correct 
for the upstream-downstream asymmetry, the current density in three of the inner coils was scaled; 
Figure~\ref{figura12} shows the scaling factors that were used.

\begin{figure}
\begin{picture}(100,150)
\put(70,0){\resizebox{10cm}{!}{\includegraphics{coils}}}
\end{picture}
\caption{Coil scaling factors used to produce $field\_map.0005$. The current densities in the inner coils were
scaled by the factors shown at the bottom of the coils; the OPERA coil numbers are shown at the top of the coils.}
\label{figura12}
\end{figure}

Back in section~\ref{sec_2}, Figure~\ref{figura5} presented difference plots for $field\_map.0003$ and the 
$20.0kGauss$ measured map that documented the upstream-downstream asymmetry and the gradient difference. The 
exact same set of difference plots were made for $field\_map.0005$ and are presented in Figure~\ref{figura13}. 
Note that the gradient of the field has been significantly corrected and the maximum difference is now in the 
order of $\pm 5Gauss$. Inside the volume defined by 
\begin{equation} 
\begin{array}{ccccc}
-600mm  & \leq &  z   & \leq  & 600mm     \\
0\deg   & \leq & \phi &    <  & 360\deg   \\
0mm     & \leq &  r   & \leq  & 170mm
\end{array}, 
\label{ecuacion7}
\end{equation}
which includes the PC and the DC chambers, the maximum difference (in absolute value) was found to be 
$4.84Gauss$. However, inside the volume defined by 
\begin{equation} 
\begin{array}{ccccc}
-500mm  & \leq &  z   & \leq  & 500mm     \\
0\deg   & \leq & \phi &    <  & 360\deg   \\
0mm     & \leq &  r   & \leq  & 170mm
\end{array},
\label{ecuacion8}
\end{equation}
which includes only the DC chambers, agreement was achieved to within $\pm 2Gauss$.

\begin{figure}
\begin{picture}(100,450)
\put(-60,250){\resizebox{10cm}{!}{\includegraphics{graph_x0_y0_d1}}}
\put(240,250){\resizebox{10cm}{!}{\includegraphics{graph_x0_y83_d1}}}
\put(-60,0){\resizebox{10cm}{!}{\includegraphics{graph_x0_y165_d1}}}
\put(240,0){\resizebox{10cm}{!}{\includegraphics{graph_x0_y248_d1}}}
\end{picture}
\caption{$B_{z}$ vs. $z$ plots for $field\_map.0005$ minus measured $20.0kGauss$ map (without NMR
measurements). All plots are in the same scale.}
\label{figura13}
\end{figure}

It is important to keep in mind that the changes introduced in $field\_map.0005$ to the as built geometry (i.e. 
change in current densities and coil position) are not necessarily real. The model used to generate 
$field\_map.0005$ is a black box (whose contents are known) that produces an output similar to the black box in 
the field (whose contents are ignored). With the currently available tools, it is not possible to make a 
study that will discriminate among all possible solutions.

\subsection{field\_map.0007}

To study the effect of a coil shift in all the calculations that assume knowledge of the 
magnetic field, $field\_map.0007$ was produced. This map has all the changes that were introduced in 
$field\_map.0005$ and, in addition, all the coils were shifted by $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$.

\section{OPERA Systematics}

It is worth mentioning that many precautions were taken to ensure that OPERA did not introduce any bias in 
the solution of the model. Different models were used to make sure that the solution was independent of finite 
element mesh size, regularisation of the air and material volumes and the type of potentials used. It should 
also been mentioned that OPERA has been upgraded from the version that was used to make $field\_map.0003$. 
Maps $field\_map.0004$ to $field\_map.0007$ were made in OPERA V8.53 and this allowed for a better assessment of 
the software systematics. 

\section{Conclusions}

In summary, the comparison between the current OPERA model (used to generate $field\_map.0003$) and the measured 
maps that were taken in April of 2002 has been completed and the main discrepancies found are: the measured maps 
have an upstream-downstream asymmetry of $7Gauss$ that is not predicted by OPERA; the measured field falls 
faster than $field\_map.0003$ predicted as we move away from the center of the yoke (i.e. field gradient is 
different as we move away from the center); and the axis of the coils seems to be shifted in $x$ and $y$ by one 
to two millimeters. 

To introduce modifications to correct and study these discrepancies the following new OPERA maps were produced:

\begin{center}
\begin{tabular}{|c|c|} \hline
Map			& Comment on modification \\ \hline
$field\_map.0004$ 	& BH curve \\ \hline
$field\_map.0005$       & BH curve + asymmetry + gradient corrections\\ \hline
$field\_map.0006$       & BH curve + coil shift of $\Delta x=-1.54cm$ and $\Delta y=-1.83cm$ \\ \hline
$field\_map.0006a$      & BH curve + coil shift of $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$ \\ \hline
$field\_map.0007$       & \begin{tabular}{c} BH curve + coil shift of $\Delta x=-0.154cm$ and $\Delta y=-0.183cm$ \\ + asymmetry + gradient corrections \end{tabular} \\ \hline
\end{tabular}
\end{center}

Based on the results of the OPERA and measured map comparisons, the following conclusions were made:

\begin{itemize}
\item Agreement between OPERA ($field\_map.0005$) and the measured field was achieved to within $\pm 5Gauss$
for all the chambers in $-600mm~\leq~z~\leq~600mm$ and within $\pm 2Gauss$ for all the chambers in 
$-500mm~\leq~z~\leq~500mm$. These uncertainties are representative of the accuracy with which field predictions can 
be made inside their respective volumes.

\item If a measured field map with final uncertainties of less than $\pm1Gauss$ and in agreement with 
OPERA is needed, a denser map with better calibrations will have to be taken.

\item The coils are aligned in $x$ and $y$ to within at least $\pm 2mm$. A misalignment in $z$ has not been 
observed.
\end{itemize}

\section{Recomendations}

Based on the results of the OPERA and measured map comparisons, the following recommendations are made:

\begin{itemize}
\item The current OPERA map in CFM ($field\_map.0003$) must be replaced by $field\_map.0005$ since this map is 
the closest approximation available to the measured map. 

\item A study in GEANT must be made to determine if the achieved agreement between OPERA and the measured maps is 
good enough for all calculations and assumptions that rely on knowledge of the magnetic field.

\item $field\_map.0007$ should not be used as the official CFM version; it was only created to document the 
observed misalignment. A better estimation in the coil shifts will have to be made if this feature 
needs to be incorporated into the model. 

\item When another set of maps is taken again, some measurements should be taken nearby the yoke doors ($z=\pm 
139cm$) and as far upstream as possible ($-300cm \leq z \leq -150cm$); this would allow a better determination 
of the BH curve and asses the accuracy of the upstream extrapolations made for beam studies. 
\end{itemize}

\begin{thebibliography}{99}

\bibitem{mike} M. Barnes, ``OPERA-3D Magnetic Field Calculations for the as built TWIST Magnet,''
\textit{TWIST Bulletin Board}, May 2002.

\bibitem{magnet_group} G. Marshal J. Macdonald and K. Olchanski, private communication, 2002.

\bibitem{opera_3d} OPERA-3D Reference Manual, Vector Fields Ltd., 2002.

\end{thebibliography}

\end{document}
