\chapter{SpaCal Calibration}
\label{Chapspacalib}

As it was mentioned in the last chapter, the measurement of the proton
structure function is only possible if the event kinematic is correctly
and precisely reconstructed. The resolution of the reconstruction methods rely
directly on the precision of the measurement of the angles and
energies of the scattered electron and of the hadronical final state. 
 
Since the energy measurement enters directly to the event kinematic, specially
for the electron method and represent the 
largest systematic source for the measurement of $F_2$ in the high $x$ 
region, it is important on analysis level to perform a detailed 
calibration of the energy measured by the SpaCal calorimeter.
In this chapter the calibration of the SpaCal calorimeter and the
determination of its uncertainty is explained.

\section{Calibration Method}
\label{SecCalibmethod}

\begin{figure}[t]
\begin{center}
\includegraphics[height=8.0cm]{./spacal/figures/egen.eps}
\includegraphics[height=8.0cm]{./spacal/figures/energyq2xv2.eps}
\caption{(a) Scattered electron energy distribution for DIS
  events at generator level (b) Kinematical plane trayectories for
  different energies of the scattered electron.} 
\label{Figkinpeak}
\end{center}
\end{figure}

In DIS events at low values of $Q^2$, the energy distribution of the
scattered electron has a characteristic shape with a maximum close to
the electron beam energy and commonly is known as the {\it kinematic
  peak}. In Fig. \ref{Figkinpeak}(a) the energy distribution of the
scattered electron at generated level for a DIS selection is shown. 

The kinematical properties of events located in the kinematic peak
region, are unique and are used to determine the scale of the electron
energy measurement. In Fig. \ref{Figkinpeak}(b), the $Q^2-x$ plane is
shown with different contours of constant electron scattered energies.
If the energy of the scattered electron coincides with the energy of
the incoming electron, then the contour line does not depend on $Q^2$
for values of $x=E_{inc}/E_{p}=0.032$. This kinematic region is only
accessible for larger electron scattering angles as can be appreciate from
Fig. \ref{Figkinpeak}(b). At this high value of $x$, the proton structure function
$F_2$ is approximately flat (see Fig. \ref{}), therefore events
located in the kinematic peak region are almost independent of
structure function assumption and thus is an appropiate region to
perform calibration studies. 
%The kinematic peak region is exploited to calibrate the SpaCal calorimeter.  

The calibration of the SpaCal calorimeter begins in the data taking stage.
Variation of the gains of the photomultipliers are measured with the
help of the light-emiting-diode (LED) system situaded at the back side
of the calorimeter. Each photomultiplier receives well defined constant
light pulses and afterwards photodiodes are used to identify
instabilities of the LED intensity and thus any change of the
photomultiplier gain can be detected and corrected off\-line. 

After applying the correction factors of the LED system, the inner cells of 
the calorimeter are calibrated with events localized in the ``kinematic 
peak'' region \ref{}. Due to the decreasing statistic at larger $Q^2$
the outer  part of the calorimeter is calibrated with cosmic muons and proton
beam halo muons events \ref{}. 

Nevertheless a improved calibration of the SpaCal calorimeter, which
is able to 
reduce the uncertainty of the $F_2$ measurement at high values of $x$,
can only be achieved on analysis level. The energy calibration has
to provide: 

\begin{itemize}
  \item good energy resolution, therefore is vital to have a
  relative equalization of the response of the calorimeter
  cells.
  \item correct reconstruction of the event kinematic, therefore the
  absolute energy scale has to be determined.
\end{itemize}

The method to calibrate the Spacal calorimeter used in this analysis was
introduced in \ref{} and uses events localized in the kinematic peak
region. The Spacal energy measurement is compared with a reference
energy obtained by the DA reconstruction method. 

There are other calibration procedures, one compares the energy
distribution of the data and the MC simulation in the kinematic peak
region, in a region where both distributions are of gaussian shape
\ref{}. Nevertheless this method is restricted by statistics due to the
degradation of the resolution of the event kinematic at large values
of $x$. This method is used in this analysis only as a cross check of
the calibration with the DA method.

\section{Calibration with the Double angle method}
\label{Secdacalibration}

As we have seen in section \ref{SubSecdamethod} the event kinematic
can be completely reconstructed using the angle of the scattered
electron $\theta_e$ and of the hadronic final state
$\theta_{had}$. This allows to derive the energy of the scattered
electron independently of the SpaCal measurement. The double angle
(DA) energy is given by: 

\begin{equation}
E_{DA} = E_{inc} \frac{1-y_{DA}}{\sin ^{2} \theta_e /2}
\label{eqeda}
\end{equation}

where $Y_{DA}$ was defined by Eq. \ref{kinda}. In order to reconstruct
the DA energy in the kinematic peak region, events with larger
electron scattering angles $\theta_{e}$ and with low values 
of $y$ are necessary (see Eq. \ref{eqeda}). 

The scattered electron angle $\theta_e$ is measured by the BST. In 
case the event is out of the acceptance of the BST, then the BDC is used to
reconstruct the electron scattering angle. In both cases a well
reconstructed vertex around $30\,$cm is required.  

Events at low $y$ are selected applying a cut on the hadronic angle
$\theta_{h} < 80 ^{\circ}$, reaching a maximum value of $y$
of approximately $0.15$. The influence of events at very low $y$ where the 
hadronic final state escapes often undetected in the forward direction was
suppressed requiring $\theta_{h}>15^{\circ}$.

In order to minimize contributions of untergrund events, an additional
SpaCal selection is  
applied. Only events with exactly one cluster in the
SpaCal calorimeter with an energy in the kinematic peak
region $20\,$GeV$<E_{e}<32\,$Gev are accepted. In addition the 
radius of the cluster $R_{clog}$ must be less than $4\,$cm.  

The resolution of the DA energy and of the SpaCal energy measurement are
shown in Fig. \ref{Figdaresol}. The generated electron energy
$E_{gen}$ is compared with both the DA and the SpaCal measurement. A
deviation up to $1\%$ of the generated variable is observed 
in case of the SpaCal measurement, meanwhile the DA has a precision up
to $0.2\%$. Therefore the DA energy is well suitable to be the
reference energy scale for the SpaCal calibration.

\begin{figure}[t]
\begin{center}
%\includegraphics[width=12.0cm]{./spacal/psnoise/edaresol.eps}
\includegraphics[height=10.0cm]{./spacal/figures/calibeps/eps/resolutionda.eps}
\caption{(a) Generated and Reconstructed Energy distribution of the
  scattered electron. (b) Resolution of the reconstructed energy
  measured by SpaCal (area distribution) and determined by the Double 
  angle method (solid line)}
\label{Figdaresol}
\end{center}
\end{figure}

The calibration procedure is an iterative process, where the reference
energy $E_{DA}$ is compared to the measured energy $E_{SpaCal}$ for
the previous selection. The calibration gain factors 
are thus obtained as the deviation of $\delta = E_{DA}/E_{SpaCal}$ to
one. In order to ensure homogeneity over the whole
spacal plane the following calibration factors are required:

\begin{itemize}
\item Gains factors for each cell of the calorimeter.
\item Calibration factors which correct for the losses of energy due
  to the SpaCal 16-cell module geometry.
\item Calibration factors as function of the transversal distance of
  the impact point of the scattered electron to the beam pipe $R_{Spa}$.
\end{itemize}

\subsection{Cell Gains}

The first calibration constants are derived for each cell of the
SpaCal calo\-rimeter. As we have seen from section X, the energy
measured by SpaCal is constructed as the sum of the energies of
the cells which take part of the electron cluster. 

\begin{equation}
E_{SpaCal} = \sum_{cell_i} E(cell_i)= \sum_{cell_i} E_i
\label{EqenergySpa}
\end{equation}

\begin{figure}[t]
\begin{center}
%\includegraphics[height=7.0cm]{./spacal/figures/celldelta.eps}
\includegraphics[height=7.0cm]{./spacal/figures/calibeps/calnewbstinner9cm/gainsit_calnewbstinner9cm.eps}
\caption{$\delta$ pull distributions for two cells of the SpaCal
  calorimeter. The dashed line correspond to the first gain determation
  meanwhile the solid line is the pull distribution obtained after
  eight iterations}
\label{Figpulliter1}
\end{center}
\end{figure}

For each event of the calibration selection, the $\delta$ pull
distribution 

\begin{equation}
\delta = \frac{E_{DA}}{E_{SpaCal}}w_{i} \hspace{0.5cm} \textrm{with}
\hspace{0.5cm} w_{i} = \frac{E_{i}}{E_{SpaCal}} 
\label{Eqpulldist}
\end{equation}

for each cell which belongs to the electron cluster is constructed.

Each cell contributes to the pull distributions of the entire sample,
with a weight $w_{i}$ given by the fraction of its measured energy
$E_i$ to the 
total energy of the cluster $E_{SpaCal}$. The
deviation of the pull distributions to $1$ give the gain with which
the cell has to be corrected. Since the shape of the distribution is
not of gaussian shape, the deviation of
$\delta_{cell_i}$ to $1$ is obtained using a robust fit which removes 
the outliers in the distribution. In case the cells do not have enough
statistics to perform an individual fit, a global fit for all those
cells is performed.

\begin{figure}[t]
\begin{center}
\includegraphics[width=16.0cm]{./spacal/figures/calibeps/calnewbstinner9cm/gains_calnewbstinner9cm.eps}
\caption{Calibrated and uncalibrated energy distributions for (a)
  MC and (b) data of the shifted vertex period.}
\label{Figgainsdatamc}
\end{center}
\end{figure}

In order to ensure convergence of the calibration method, an iterative
gain determination of the cells is performed. The gains of the second 
iteration use the gains obtained by the first one, thus the weight of
the pull distribution change according to:

\begin{equation}
\delta_{cell_i}^{it+1} = \frac{E_{DA}}{\sum_{i} E_{i}(1+g_{i}^{it})}
\, w_{i}^{it} \hspace{2cm} w_{i}^{it} =
\frac{E_i(1+g_{i}^{it})}{\sum_{i} E_{i}(1+g_{i}^{it})} 
\label{Eqdeltai}
\end{equation}

where $g_i$ are the gains factors obtained in the iteration $i$. For $i=0$ all gains
are cero.

Usually 3 or 4 iterations are needed to obtain a stable gain factor.
Fig. \ref{Figpulliter1}
show the pull distribution for two cells of the SpaCal calorimeter 
obtained after one and eight iterations.

The gain factors correct the energy measurement between $2\%$ and
$3\%$. Fig \ref{Figgainsdatamc} shows the variation of 
$\delta$ as function of the transversal distance of the cluster to the
beam pipe $R_{SpaCal}$, for the default calibration and after the
gains are applied. A significant improvement is achieved taking the
gains into account. 
%In Fig. \ref{Figgainsdatamc}(b) it is also shown
%the energy distributions of the electron candidate for Data and MC 
%before and after the gains are applied. 

\subsection{Inbox Corrections}

\begin{figure}[t]
\begin{center}
\includegraphics[width=5.0cm]{./spacal/figures/spamodule.eps} 
\caption{Schematic view of one module of the SpaCal calorimeter. Cells in the
  middle, corner and border define the topology 1,2 and 3 respectively.}
\label{Figspamodulecol}
\end{center}
\end{figure}

As we have seen in section \ref{Secspacalcalorimeter}, the Spacal
calorimeter is constructed of super\-mo\-dules containing
16-cells. Therefore, energy losses due to the dead material present
between the supermodules is expected. Cells placed in the corner of
the module are more afected by energy losses than the cells
situated in the middle of the 16-cell module.

In order to compensate for this losses, the measurement of the energy
is corrected as function of the impact point of the electron candidate
inside the cell. The cell is divided in a grid with spacing of
$8\,$mm. In order to determine the position of the electron candidate
inside the cell, the coordinates of the hottest cell are used.   

Three inbox corrections depending of its position inside the module
are defined and ilustrated in Fig. \ref{Figspamodulecol}
The cells situated in the middle, corners and at the borders
define the topology 1,2 and 3 respectively.

\begin{figure}[t]
\begin{center}
\includegraphics[width=14.0cm,height=7.5cm]{./spacal/figures/inboxcorr.eps}
\caption{Calibration factors for the different cell topology inside
  the module.}
\label{Figinboxcor}
\end{center}
\end{figure}

The corrections are derived using the same DA selection as in the
the gain determination. Since the insert module have cells with
different geometry and are afected by leakage, an additional cut on
$R_{SpaCal} > 10\,$cm was applied in addition. The inbox
corrections are obtained with the same robust fit procedure as the gain
determination. No iteration for the inbox correction are considered.


\begin{figure}[t]
\begin{center}
\includegraphics[width=16.cm]{./spacal/figures/calibeps/calnewbstinner9cm/crack_calnewbstinner9cm.eps}
\caption{Uncalibrated and calibrated $E_{DA}/E_{SpaCal}$ distribution
  as function of $R_{spa}$.}
\label{Figgainresult}
\end{center}
\end{figure}

Fig. \ref{Figinboxcor} shows the correction factors for Data
and MC due to the cracks between the modules. For Data, cells in the
corner are corrected up to $2\%$, meanwhile $1\%$ of correction is
obtained for the border cells and up to $0.5\%$ for the cells located
in the middle of the module. 

Another source of energy losses in the calorimeter is due to the
inhomogeneity of the SpaCal cells inside the module. Since the variable 
$R_{box} = abs(x_{cell},y_{cell})$ covers the calorimeter surface in
squares, it was used to correct the energy losses between the
cells. The corrections are derived comparing the DA energy with the
calibrated spacal energy with gains and inbox corrections. Four sets of
calibration factors as function of $R_{box}$ are derived for 4 $\phi$
sectors, each covering one quarter of the SpaCal surface.

This procedure correct the energy measurement $0.3\%$ in addition.
Fig. \ref{Figgainresult} show the deviation of the energy measurement
from the reference energy $E_{DA}$ as a function of $R_{SpaCal}$ after
the inbox and crack calibration factors are applied. 

%\begin{figure}[t]
%\begin{center}
%\includegraphics[width=16.cm]{./spacal/figures/calibeps/calnewbstinner9cm/crack_calnewbstinner9cm.eps}
%\caption{Uncalibrated and calibrated $E_{DA}/E_{SpaCal}$ distribution
%  as function of $R_{spa}$.}
%\label{Figx}
%\end{center}
%\end{figure}

\begin{figure}[t]
\begin{center}
\includegraphics[width=16.cm]{./spacal/figures/calibeps/calnewbstinner9cm/finalradial_calnewbstinner9cm.eps}
\caption{Uncalibrated and calibrated $E_{DA}/E_{SpaCal}$ distribution
  as function of $R_{spa}$.}
\label{Figradialcheck}
\end{center}
\end{figure}

\subsection{Radial Corrections}

As we can see from Fig.\ref{Figgainsdatamc} and Fig.\ref{Figgainresult} after the gains
inbox and crack calibration factors are applied, a significant
improvement of the measured energy over the spacal plane is achieved. 
Nevertheless a radial dependence of the calibrated $\delta$ pull quantity 
up to $1.2\%$ still remains. Such deviation is probably due to the dead material 
located in front of the Spacal calorimeter and as can be seen from Fig
\ref{Figgainresult} the MC simulation do not describe. This dependence
is cured 
obtaining the last calibration factors as function of the measured
radius $R_{SpaCal}$. In analogy to the crack corrections, four sets of
calibration factors are derived for the same 4 $\phi$ sectors.

In Fig. \ref{Figradialcheck} is shown the radial dependence of $\delta$ after the 
total calibration procedure is applied. The differences
between data and MC does not exceed $0.2\%$ allmost for all the region
covered by SpaCal.  

\subsection{MC Smearing}

%In order to adjust the resolution of the MC with the one of data, 
%a final adjustment of the MC is needed. 
In Fig. \ref{Figsmear} is shown the energy distribution of Data and MC 
with (a) the original calibration and (b) after the whole DA
calibration is applied.  
It is remarkable that a smering of the MC has to be applied in order to fit it 
to the resolution of the data. 

The calibrated energy in MC was therefore smeared with different factors between
$0\%$ and $0.4\%$. The value of $\chi^{2}$ of the comparison of Data and MC
for the different smeared factors was used to determine the optimum value,
 the best value was found to be $0.2\%$. In Fig. \ref{Figsmear}(c), is shown 
the calibrated energy distribution of Data and MC with the additional
smearing of $0.2\%$ 

Nevertheless the smearing of the MC conduces to a constant systematic shift of the 
energy distribution of about $0.15\%$. This systematic shift can be removed
introducing in the MC calibration chain, the smearing value starting from the inbox 
corrections. In Fig. \ref{Figsmear}(d) is shown the calibrated energy distribution 
when the smearing is applied to the MC calibration. All distributions in Fig. 
\ref{Figsmear} are normalized with area.

\begin{figure}[t]
\setlength{\unitlength}{1cm}
\begin{center}
\begin{minipage}{0.40\textwidth}
\includegraphics[width=6.5cm]{./spacal/figures/calibeps/calnewbstinner9cm/uncalibenergy_calnewbstinner9cm.eps} 
\put(-1.5,5.5){\small{(a)}}
\end{minipage}
\begin{minipage}{0.40\textwidth}
\includegraphics[width=6.5cm]{./spacal/figures/calibeps/calnewbstinner9cm/calibenergy_calnewbstinner9cm.eps}
\put(-1.5,5.5){\small{(b)}}
\end{minipage}
\begin{minipage}{0.40\textwidth}
\includegraphics[width=6.5cm]{./spacal/figures/calibeps/calnewbstinner9cm/calibenergysmear_calnewbstinner9cm.eps}
\put(-1.5,5.5){\small{(c)}}
\end{minipage}
\begin{minipage}{0.40\textwidth}
\includegraphics[width=6.5cm]{./spacal/figures/calibeps/calnonoisesubinner9cmzvsmear/calibenergy_calnonoisesubinner9cmzvsmear.eps}
\put(-1.5,5.5){\small{(d)}}
\end{minipage}
\caption{Comparison of Data and MC of (a) uncalibrated (b) calibrated (c),(d) smeared energy distribution measured by SpaCal.}
\label{Figsmear}
\end{center}
\end{figure}

\section{Energy Scale}

\begin{figure}[h]
\setlength{\unitlength}{1cm}
\begin{center}
\includegraphics[width=16.cm.]{./spacal/figures/calibeps/eps/edanoiseandnonoise.eps}
\put(-9.5,6.5){\small{(a)}}
\put(-2.,6.5){\small{(b)}}
\caption{Resolution od the DA energy measurement when the noise is
  considered (a) and not considered (b) for the reconstruction of $\theta _{had}$.}
\label{Figedanoise}
\end{center}
\end{figure}

\begin{figure}[h]
\begin{center}
\includegraphics[width=10cm.]{./spacal/figures/calibeps/eps/spanoiseandnonoise.eps}
\caption{Resolution of the Spacal measurement after applying the DA
  calibration, in the case $\theta_{had}$ is reconstructed considering
  and non considering the LAr noise. In the last case the scale of the
  SpaCal measurement is shifted by $0.5\%$}
\label{Figspanoise}
\end{center}
\end{figure}

We have seen in the previos sections that after performing the DA
calibration, the agreement between the Data and the MC simulation is of the order 
of $0.2\%$. Nevertheless the resolution of the DA energy has not a completely
symmetric shape and it is displaced from cero by $0.4\%$, as is shown in 
Fig. \ref{Figedanoise}(a). 

%Since the DA method is sensitive to the level of noise in
%thecalorimeter and 
%the influence of the identified noise 
%of the hadronical final state can make a bias in the reconstruction of 
%$\theta_{had}$.
The DA energy of the scattered electron rely directly on the
measurement of the hadronical and electron scattered angles.
The hadronical final state is constructed as the superposition of
combined objects, where energy depositions in the central trackers
devices, LAr and Hadronic section of the SpaCal are considered. During
the reconstruction, isolated energy deposition in the LAr are 
investigated in order to identify noise. The recognition of the
LAr-noise is performed with different thresholds depending of the
position of the energy cluster in the LAr calorimeter 
(see next chapter for more details).

Up to now the identified noise is considered 
in the calculation of $\theta_{had}$. However, this isolated
energy, can influence the measurement of $\theta_{had}$ and therefore
the DA energy could be affected. 

In Fig. \ref{Figedanoise}(b) is shown
the resolution of the DA energy when this noise contribution is
not considered.
The resolution of the DA energy in case the noise is substracted stay of the same 
order as in Fig. \ref{Figedanoise}(a), but the deviation of the DA energy from the 
generated energy considerably decreases and tends to be cero. The whole calibration 
procedure is therefore repeated using the $\theta_{had}$ reconstruction where the 
identified noise is substracted. The gains calibration factors differ up to $0.5\%$, 
meanwhile the inbox, cracks, radial corrections stay in the same order.

In order to determine the scale of the energy measurement at the kinematic peak, the 
comparison between the Spacal calibrated energy and the generated energy is necessary.
This comparison is shown in Fig. \ref{Figspanoise} for the both calibration schemes. 
In case the noise is substracted, the scale of the spacal measurement is $0.5\%$
meanwhile in case the noise is not substracted, the calibrated SpaCal measurement 
coincides with the generated quantity as it is shown by the band in Fig. 
\ref{Figspanoise}.

Since the DA energy is taken in the calibration procedure as a reference of the 
generated energy and the aim is to have a Spacal energy measurement close to the
generated energy, the calibration scheme using the noise is choosed. In such way,
displacements of the SpaCal energy in the kinematic peak from the generated 
energy are avoided.

The long tail of the distribution in Fig. \ref{Figedanoise} (a) and (b) 
is due to showering \ref{} and to final state radiation events, in such events the 
scattered electron radiates a photon but both the electron and the
photon build one cluster on the SpaCal. 


\section{Hottest cell calibration}

The hottest cell calibration method uses as well the kinematic peak
region to derive individual cell calibration factors. In contrary to
the DA method, the Spacal measurement of the electron cluster is
directly compared with the MC simulation \ref{}.

In order to have a electron energy distribution with a gaussian
shape allmost free of tails, the calibration sample uses the
following selection:

\begin{itemize}
\item Events in which the electron cluster has a energy between $20$
  and $30\,$GeV and a cluster radius less than $4\,$cm.
\item Radiative events are reduced allowing a maximum value
  of $y$ of $0.05$.
\item The noise contribution is supressed applying $y>0.005$.
\end{itemize}

\begin{figure}[t]
\begin{center}
\includegraphics[height=15.cm]{./spacal/figures/calibeps/calnewbstinner9cm/calnewbstinner9cm_cellbycell.eps}
\caption{Calibrated Energy distributions of the inner cells of the SpaCal calorimeter for the Hottest calibration selection}
\label{Fighottestcell}
\end{center}
\end{figure}

The calibration gain factors are derived as:

\begin{equation}
g_{i} = \frac{<E_{cl,i}^{MC}>}{E_{cl,i}^{Data}}
\end{equation}

where $<E_{cl,i}>$ is the mean of the electron cluster energy, which 
is assigned to the hottest cell $i$.  Nevertheless, the statistic of
the sample decreases considerably and individual calibration factors
can be determined only for the inner cells.

Since in the last sections Data and MC were calibrated with the DA
method, the Hottest cell calibration selection is used only to probe the DA
calibration in a slightly different kinematic region where the effect of the
tails due to radiative events is reduced.

In Fig. \ref{Fighottestcell} the DA calibrated cell distributions for the 
hottest cell calibration selection are shown. It is remarkable that there is 
no a significant shift between Data and MC for allmost all cells. The cells 
of the insert has to be excluded of the analysis due to the bad shape distribution
as well as the cells 31 and 29.

\section{Energy measurement at low Energies}

As was shown in the previous sections, the DA calibration is performed
with electron clusters which energy lies in the kinematical peak
region. Comparison between the data and the MC simulation reveleas that 
the energy measurement has a scale uncertainty of $0.2\%$ in kinematic
peak. A natural question is, which scale do we have for clusters
with energies lower than $27.5\;$GeV.
%and how is the behaviour of the scale uncertainty over the SpaCal plane. 

One method used to study the scale of the 
energy measurement of the SpaCal calorimeter towards lower energies,
uses the reconstruction of the invariant mass of $\pi^{0}$ decays.
The invariant mass is calculated according to:

\begin{equation}
m_{\pi^{0}} = \sqrt{2E_{\gamma 1}E_{\gamma 2}(1-\cos \theta_{\gamma \gamma})}
\label{Eqp0}
\end{equation}

\noindent where $E_{\gamma 1}$ and $E_{\gamma 2}$ are the energies of
the photons and $\theta_{\gamma \gamma}$ is its opening angle.
In order to supress background from random coincidences in the
$\pi^{0}$ mass reconstruction sample, the following selection was
applied:

\begin{itemize}
\item Events having only two clusters in the spacal calorimeter and
  trigerred by S9 are used, therefore one of the clusters has to have
  a minimal energy $2\,$GeV. 
\item In order to measure a precise separation angle, just events
  having a good reconstructed vertex around $30\,$cm are used.
\item A minimal distance of $10\,$cm between the clusters is applied
  to avoid overlap between the selected clusters 
\end{itemize}

\begin{figure}[h]
\begin{center}
\begin{minipage}{0.45\textwidth}
\includegraphics[height=9.cm]{./spacal/figures/studyp0/uncalibp0mass.eps} 
\end{minipage}
\hspace{0.5cm}
\begin{minipage}{0.45\textwidth}
\includegraphics[height=9.cm]{./spacal/figures/studyp0/calibp0mass.eps}
\end{minipage}
\caption{Invariant mass of $\pi^{0}$ invariant mass for energy clusters measured by SpaCal
before (a) and (b) after applying the DA calibration.}
\label{Figp0peak}
\end{center}
\end{figure}

In Fig. \ref{Figp0peak} is shown the reconstructed mass of the
$\pi^{0}$ decays for Data and Django MC before and after the DA
calibration is applied. The introduction of the DA Spacal calibration, 
decreases the observed shift of the mass reconstructed distribution by $0.5\%$.

Nevertheless a shift between the Data and MC is still observed. 
The value of this displacement determines the scale of the energy measurement 
at $\pi^{0}$ mass. The shift is studied using the Kolmogorov-Smirnov (KS) 
test, where the invariant mass of the entire sample is divided into sub-samples
with approximately equal statistic based on the separation of the photon
cluster and the minimal, maximal energy of the two clusters. 

\begin{figure}[h]
\begin{center}
\subfigure{\epsfig{figure=./spacal/figures/studyp0/halfstudy_scale.eps,width=0.45\textwidth}}\quad
\subfigure{\epsfig{figure=./spacal/figures/studyp0/correctedcalibp0mass.eps,width=0.45\textwidth}}
%\includegraphics[height=9.cm]{./spacal/figures/studyp0/halfstudy_scale.eps} 
%\includegraphics[height=9.cm]{./spacal/figures/studyp0/correctedcalibp0mass.eps}
\caption{Invariant mass of $\pi^{0}$ invariant mass for energy clusters measured by SpaCal
before (a) and (b) after applying the DA calibration.}
\label{Figscale}
\end{center}
\end{figure}

The KS-Test moves the MC distribution until the probability of the both curves
is maxima. In Fig. \ref{} is shown the result of the KS-Test for the invariant-mass 
subsamples, a shift of $2.5\%$ is necessary to fit the MC with the Data.

%\begin{figure}[h]
%\begin{center}
%\includegraphics[height=9.cm]{./spacal/figures/studyp0/correctedcalibp0mass.eps}
%\caption{Invariant mass of $\pi^{0}$ corrected by the $2.5\%$ scale}
%\label{Figcorrectedpeak}
%\end{center}
%\end{figure}

Correcting the MC for the scale value of $2.5\%$, the agreement between
the two invariant mass distributions improves. In order to determine
the error of the scale, several checks to the $\pi$ invariant mass selection 
are performed. Since the $\pi ^{0}$ is a two body decay process, a reweight
on the minimal energy to the $\pi$ after fixing the scale is applied. The agreement
between data and MC improves conducing to a remaining uncertainty of $1\%$.   

\section{Energy measurement Uncertainty}

The spacal uncertainty measurement is given by 

\begin{itemize}
  \item $0\% \pm 0.2 \%$ for E$=27.5\,$GeV
  \item $2.5\% \pm 1\%$ for $\pi^{0}$ Energy (E$=2\,$GeV)
\end{itemize}

The energy measurement for the Data will be corrected linearly. The uncertainty of
the energy measurement will be used to derive the systematic
uncertainty of the $F_2$ measurement.


