\section{Single track measurements}
\label{sec:tracks}

The telescope alignment and tuning of the simulation model were done using the
hadron beam data taken at 120\,GeV. Cross checks of the sensor modelling were
done with the hadron data and also the 100\,GeV positron data. Tungsten sheets
were not present for the data used for these studies. The hadron data were
taken interspersed between the positron data runs throughout the beam period.

Sum over two rolling shuttle frames.
Clusters formed from all pixels above threshold which at adjacent to
each other, both along a side or at a corner.

\subsection{Alignment}
The telescope sensors were aligned to each other using the beam data.
Their nominal positions were defined to have the centre of the sensor
active area at $x=y=0$ and have the pixel edges along the $x$ asnd $y$
axes. For alignment,
a horizontal ($\Delta x$) and vertical ($\Delta y$) 
offset from nominal, and an $x$-$y$
rotation angle ($\alpha$) were determined for each sensor.
The other possible geometric parameters (a $z$ offset
and non-perpendicularity of the sensors to the $z$ axis) were neglected as
they have a very small effect on the analysis.

Since there was no external
reference, the most upstream sensor (layer~0) was defined to have 
$\Delta x=0$, $\Delta y=0$ and $\alpha=0$, while the most downstream sensor
in the front arm
(layer~2) was defined to have fixed values of $\Delta x$, $\Delta y$ and 
$\alpha$ such that the average reconstructed
particle direction was parallel to the $z$ axis. 
The remaining
12 alignment parameters, namely
all three parameters for layers~1, 3, 4 and 5, were determined
from reconstructed tracks. 
These alignment parameters were determined for each run independently and
the method used depended on whether there were tungsten sheets installed
within the telescope or not. 

With no tungsten, then tracks were reconstructed using clusters from each
of the six layers. 
%Since it is very unlikely that two neighbouring pixels
%will both have a noise hit, then clusters made from more than one pixel
%have a high likelihood of being from a physical particle. Hence, only
%clusters made from two or more pixels were used for most layers. The
%exception was layer~3, for which the efficiency was found to be comparatively
%low (see section~\ref{sec:tracks}). For this layer, clusters made from one
%pixel were used.
%In addition, for all layers, the 
The clusers
were required to have at most four pixels so that the track hit position 
and error were well-defined. 
A chi-squared track fit was performed for
all possible combinations of six clusters satisfying this
requirement and consistent with the known beam angular divergence, 
with one cluster from each layer. 
The fit
assumed an averaged cluster resolution of 3\,$\mu$m. 
The track fit was to a
straight line with no allowance for multiple scattering, as this was found
to be negligible for the data with no tungsten (beam momentum of 60\,GeV 
or higher).
A initial approximate alignment determined by hand and a loose fit 
chi-squared selection allowed a set of clusters to be found which formed
tracks. 
The alignment parameters were then varied to minimise the total
fit chi-squared values, summed over all the tracks. This procedure was iterated
several times until it converged.

For runs with tungsten, then forming tracks in all six layers is not
reasonable. In these runs, then tracks are found using just the first three
layers, with the same cluster and angular cuts as above. 
%Following this, the reconstructed
%track was projected into each of layers~3, 4 and 5 in turn. Any clusters
%satisfying the selection which were within 100\,$\mu$m of the track projection
%were associated to the track. The alignment parameters for layer~1 were
%determined by minimising the total chi-squared of all the three-layer tracks.
%The parameters for the back three layers were found by minimising the
%sum of the squares of the distances of the clusters from the track projections.
Since tracks are often formed in the back three layers by particles from
the shower leaving the tungsten, then a similar procedure was used to find
tracks using hits in the back three layers. In these runs, only the
alignment of layers~1 and 4 could be determined by minimising the total
track chi-squared value.

The alignment parameters were found separately for each
beam run with at least 10 tracks.
The results of the parameter fits are shown in figure~\ref{fig:tracks:alignment}
as a function of the run number. 
It was found that the alignment parameters
were stable over the whole data-taking period 
to within 2 $\mu$m in $x$ and $y$
and 0.1\,mrad in $\alpha$ for all layers. 
Small changes to the alignment below these levels were
observed, corresponding to times when the tungsten stack was
handled to change the number of sheets. The alignment was adjusted
in a run-dependent fashion to allow for these shifts.
The final alignment parameters used for the studies reported in
this paper are also shown in figure~\ref{fig:tracks:alignment}.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=4cm]{tracks/align0.png}
%\hspace{5mm}
%\includegraphics[width=4cm]{tracks/align1.png}
%\hspace{5mm}
%\includegraphics[width=4cm]{tracks/align2.png}
\includegraphics[width=16cm]{tracks/alignment.png}
\caption{\sl 
Sensor alignment parameters as a function of run number.
%as determined from hadronic beam runs with 120\,GeV beam momentum. 
The plots show
the values of $\Delta x$ (left), $\Delta y$ (centre) and $\alpha$ (right),
for layers~1, 3, 4 and 5 (top to bottom) determined for each run, where
applicable.
The red lines show the values
used for the alignment parameters in the following studies.
SQUARE/CIRCLE FOR W/NO-W runs?
}
\label{fig:tracks:alignment}
\end{center}
\end{figure}

%The stability of the alignment during the tungsten shower data taking was
%checked by fitting for the alignment parameters in the first three layers
%only. In this case, layer~2 was defined to have the $x$ and $y$ offsets
%and $x$-$y$ angle as found from the study described above. The fit then
%determined the three alignment parameters for layer~1 only. These were found
%to be consistent with the values determined from the hadron data. In addition,
%for layers~3 to 5, the average cluser position from the EM showers were found 
%to align with the projections of the tracks formed in the first three layers.


\subsection{Simulation model}
The telescope material and particle interactions were modelled using
the GEANT4 simulation package~\cite{ref:tracks:geant4}. The sensor response
to the simulated energy deposits was modelled as described below. This
sensor response simulation was treated as a simplified effective parametrisation
rather than a detailed physical model as this was found to give a sufficiently
good description of the observed data.

The epitaxial thickness of 15\,$\mu$m results in a most probable signal
charge of around 1200$e^-$ being generated in the sensors. This charge
will diffuse within the sensor before being collected by the signal diode.
A simple two-dimensional 
model of this process was used where the charge was assumed to
diffuse according to a normalised Gaussian distribution centred on the 
initial charge deposit position,
such that the fraction of the total 
charge collected by each pixel was the integral of
the Gaussian over the area of the pixel. 
Any depth dependence within the epitaxial layer was ingored.
A region of $5 \times 5$ pixels centred on the initially hit pixel
was considered, as the diffusion spread was found to result in negligible
signals in pixels outside this area.
The width of the Gaussian was treated
as a free parameter to be determined from data.

The sensor noise was modelled by adding an extra amount of signal charge to
each pixel which had signal, according to a Gaussian distribution.
The width of this noise Gaussian was also
treated as a free parameter to be determined from the data.
The pixels which were too far from the charge
deposits to have signal were randomly chosen whether to have been 
above threshold 
according to
a rate determined from the data. 

The final parameter needed for the sensor simulation was the calibration
of the arbitrary threshold unit to signal charge units. This parameter
was again determined from the data.

\subsection{Tuning simulation parameters}

Used hadron data only. Most data were taken with threshold settings of 10 units
for each layer, except layer~3 for which 9 units was used. However, for some 
specific runs, thresholds of 6, 8, 9, 10 and 10.5 units were used in all layers.

For each sensor layer being studied in turn,
tracks were formed from clusters in the other five layers.
As for the alignment study described previously, these were
fitted with a
straight line, neglecting multiple scattering effects, using an averaged
cluster error of 5\,$\mu$m. Tracks with a chi-squared probability of
greater than 0.05 were projected into the layer being studied. 
PLOT OF DISTANCE TO NEAREST CLUSTER.
SAME PLOT BUT WITH HALF-SENSOR OFFSET IN X AND Y TO SHOW NOISE RATE.

Any cluster
within XXX\,$\mu$m of the track projection was considered to be due
to the hadron. The number of tracks with no associated cluster gives
an estimate of the sensor efficiency. This case is treated below
as ``zero-pixel'' clusters. Although the same data were used for the alignment
as for this analysis, there is no significant bias in this event-by-event
track-cluster association as the alignment is an average over the whole
dataset. 

The associated clusters were characterised by their shapes. The pixel
arrays were assumed to be symmetric in terms of rotations 
by multiples of $90^\circ$, so that
clusters which differed purely by their orientation were treated
identically.
Clearly, zero-pixel and one-pixel
clusters have a unique shape, but all clusters formed from higher numbers
of pixels have more than one possible shape. Figure~\ref{fig:tuning:shapes}
shows some of the most commonly occuring shapes, which account for
over XX\% of all clusters. 
The fractions of each of these ten (CHECK) most common cluster shapes (including
zero-pixel clusters) was measured
separately for each sensor layer and for each threshold value for which data
were taken. An example of the fractions is shown in 
figure~\ref{fig:tuning:fractions}.

Several simulated datasets were generated to model these events. 
The three sensor simulation parameters for each layer were each varied
and a chi-squared formed between the shape fractions observed in the data
compared with those predicted by the simulation. The set of three parameters
which gave the best chi-squared match were found for each layer independently.
The resulting optimal values are given in table~\ref{tab:tuning:parameters}.
It is seen that layer~3 has a significantly lower efficiency for a given
threshold than the other five layers. For this reason, when taking the
shower data described in section~\ref{sec:showers}, this sensor 
was operated with a threshold of 9 units, while all other layers were
operated with a threshold of 10 units.

\subsection{Comparison of cluster positions}

A cross-check of the parameter tuning can be made by estimating the
particle impact locations within the pixel at which the various 
cluster shapes are likely to occur. For example, it would be expected simply
from symmetry considerations that a two-pixel cluster would be most likely
when the particle hits the pixel near the midpoint of an edge, while a
four-pixel square cluster should be most
likely for particles entering the pixel near its corner. 

Figure~\ref{fig:tracks:simpositions} shows the positions of the simulated
particles which give rise to the ten (CHECK) most common clusters. It is
seen that the above expectations for two-pixel and four-pixel clusters are
indeed true. Figure~\ref{fig:tracks:simrecpositions} shows the positions of
the associated track projection within the pixel for each cluster shape
from the simulation.
The cluster positions are washed out due to the track projection resolution
but the general effect is still visible. 
Finally, figure~\ref{fig:tracks:datrecpositions} shows the positions of
the track projection within the pixel for data, which is seem to match
well to the simulation within the available statistics. 

\subsection{Comparison of cluster resolutions}

A second cross-check is possible by measuring the resolution of each cluster.
The centre of each cluster is defined as the geometrical average of the
pixels used to form the cluster, i.e. for a cluster with $N$ pixels at
positions $\vec{r}_i$, then the cluster position $\vec{r}_C$ is
\begin{displaymath}
\vec{r}_C = \frac{\sum_{i=1}^N \vec{r}_i}{N}
\end{displaymath}
The differences of the centre of the clusters from the track projections
for each cluster shape are shown in figure~\ref{fig:tracks:datwidth}.
Done for two directions; sometimes symmetric, when not, then rotated to be
same orientation in each case.
The width of these distributions arises from both the track projection
error and the cluster centre position error.
The track fit allows an estimate of the projection error to be made which
can be subtracted is quadrature to estimate the cluster position error.
These values are shown in figure~\ref{fig:tracks:datwidth}; again, good
agreement is shown between data and simulation for most cases.

\subsection{Positron track data}
Same plots but using positrons with no tungsten.
It is seem that the cluster shape distributions are very similar.

%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/pedestalScans0.png}
%\includegraphics[width=6cm]{pixel/pedestalScans1.png}
%\includegraphics[width=6cm]{pixel/pedestalScans2.png}
\caption{\sl 
Typical pixel threshold scans for a pre-shape pixel.
%and (right) a pre-sample pixel.
}
\label{fig:pixel:typicaltscan}
\end{center}
\end{figure}
