\section{Bulk single pixel performance}
\label{sec:pixel}

\subsection{Pedestals and noise}
\label{sec:pixel:peds}

The performance in the bulk pixels is less straightforward
to measure as there is no analogue readout available. However,
the rate of hits in each pixel as a function of the applied
threshold effectively allows the integral of the analogue
spectrum to be measured and hence the spectrum itself can
be estimated. The results in this section are based on 
performing such ``threshold scans'' and measuring the response.

One further complication is that pickup was observed between pixels
when O(100) were enabled and firing at the same time (see
section~\ref{sec:sensor:pickup}). This is not a major problem when
operating the sensor for its design purpose as only O(10)
pixels per sensor
are expected to fire in each event. However, for the basic
performance measurements presented below, this pickup could
prevent the response of individual pixels from being measured.
Hence to remove this sensor-wide effect, only 168
pixels were unmasked in any run for the following results, and
hence 168 such runs were required for a complete threshold scan of 
the whole sensor. As shown in section~\ref{sec:sensor:pickup}, this
number is sufficiently small that pickup effects do not occur.

To select the 168 unmasked pixels, only one pixel of the 42 which 
shared SRAM memory was unmasked in each run. In addition, runs were 
performed with only 19 bunch crossings per bunch train. Both of
these together ensured that the memory could never overflow
and so distort the threshold scan, even when very close to
threshold.

The pixel comparator only fires when the input crosses through
the threshold from below (see section~\ref{sec:design:preshape}).
In contrast to a level comparator,
this means the comparator will not fire if the input is far 
from the threshold with either polarity. Hence,
a threshold scan performed with no external stimulus will
result in hits only when near the pixel pedestal.
The results of such a scan for a typical pixel
are shown in figure~\ref{fig:pixel:typicaltscan}. 
Here, the scan is specified in the (arbitrary) units of the DAC 
threshold setting, called ``DAC threshold units'' (DTU) in this paper.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/Run452489.png}
%\includegraphics[width=6cm]{pixel/Run476749X084Y006.png}
\includegraphics[width=6cm]{pixel/pedestalScans1.png}
%\includegraphics[width=6cm]{pixel/pedestalScans2.png}
\caption{\sl 
Typical pixel threshold scan for a pre-shape pixel.
%and (right) a pre-sample pixel.
}
\label{fig:pixel:typicaltscan}
\end{center}
\end{figure}

%It is seen that the pre-sample pixel gives a distribution
%which is not well-behaved and is rather asymmetric.
%In addition, it was found that other properties of the
%pre-sample pixels (such as the rate of noise hits 
%being strongly dependent on the time since the reset)
%made them significantly harder to use and interpret.
%In the rest of this paper, results are shown only for
%pre-shape pixels. Only pre-shape pixels were
%implemented in the next version of the sensor.

For the pre-shape threshold scan, the
resulting distribution is well described by a Gaussian and
so can be characterised by the mean and the RMS.
The mean gives the pedestal for the pixel and the RMS gives
the noise~\cite{ref:pixel:noise}.
The distribution of the pixel mean and RMS values for
the two pre-shape quadrants (see Section~\ref{sec:design:preshape})
of a typical sensor are
shown in figure~\ref{fig:pixel:pedsquad}.
It is seen that there is a significant spread of pedestals
within a quadrant. The pedestal spread RMS is around 20\,DTU
and is the same for quadrants~0 and 1.
This is
much bigger than the noise on the pixels, which has an average
value of around 5\,DTU for quadrant~0 and 6\,DTU for quadrant~1.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/Sensor11Means.jpg}
%\includegraphics[width=6cm]{pixel/Sensor11Sigmas.jpg}
\includegraphics[width=6cm]{pixel/pedestals.png}
\includegraphics[width=6cm]{pixel/noise.png}
\caption{\sl 
Distributions of pedestals (left) and noise (right)
for pixels in quadrants~0 (solid, red) and 1 (dashed, blue), in DAC threshold
units (DTU), for a typical sensor. Pixels in these two quadrants are all
of the pre-shape design. All trim values were set to zero.
}
\label{fig:pixel:pedsquad}
\end{center}
\end{figure}

The values of the pedestal and noise for each pre-shape pixel 
of a typical sensor
as a function of the position within the sensor are shown in 
figure~\ref{fig:pixel:twodpedestals}, where the difference
in noise for the two quadrants is visible.
The values of the pedestals and noise show no correlation 
with position within each quadrant and their spreads appear 
genuinely random pixel-to-pixel. There is no correlation
between the pedestal and noise values.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/Sensor11Means2D.jpg}
%\includegraphics[width=6cm]{pixel/Sensor11Sigmas2D.jpg}
\includegraphics[width=6cm]{pixel/pedestals2d.png}
\includegraphics[width=6cm]{pixel/noise2d.png}
\caption{\sl 
Two-dimensional map of pedestals (left) and noise (right) for 
the two pre-shape quadrants of a typical sensor.
The lower half of each plot corresponds to quadrant~0
and the upper half to quadrant~1. The colour-coded scale
is in DAC threshold units (DTU) in both cases.
}
\label{fig:pixel:twodpedestals}
\end{center}
\end{figure}

The spread of pedestals can be reduced using the per-pixel
trim setting. This allows a value in the range 0-15 to be
loaded to each pixel to adjust the pedestal position upwards.
The effect of this on the pedestal of a typical pixel is shown
in figure~\ref{fig:pixel:typicaltrimscan}. It is seen that
there is a non-linear effect in the response.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/trimscan.jpg}
\includegraphics[width=6cm]{pixel/trim.png}
\caption{\sl 
Change of pedestal for a typical pixel
as a function of the trim setting. The curve shows a
second-order polynomial fit to the data points,
illustrating the response is non-linear.
}
\label{fig:pixel:typicaltrimscan}
\end{center}
\end{figure}

The spreads of pedestals after trimming a
typical sensor are shown in figure~\ref{fig:pixel:trimadjust}.
It is seen that the RMS of the pedestals is reduced by
a factor of around five. The resulting spread is a little
smaller than the
size of the per-pixel noise and so gives a small but
non-negligible
contribution to the apparent noise rate when setting a common
threshold for all pixels. The ability to improve on
this effect is limited by the
number of trim bits available. With four bits, then a
granularity of the trim of 16 values is possible. However,
the total range of the uncorrected pedestals is around 100\,DTU, 
so that even with careful matching of the trim range, the trim
least significant bit 
would be around 6\,DTU. Two additional trim bits have been
implemented in the next version of the sensor.
The average noise is unaffected by trimming, although the
spread of the noise is slightly increased.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/Sensor11Means.jpg}
%\includegraphics[width=6cm]{pixel/Sensor11Trimmed.jpg}
\includegraphics[width=6cm]{pixel/pedestalsTrim.png}
\includegraphics[width=6cm]{pixel/noiseTrim.png}
\caption{\sl 
Distributions of pedestals (left) and noise (right)
for pixels in quadrants~0 (solid, red) and 1 (dashed, blue), in DAC threshold
units (DTU), for a typical sensor, following the determination of the
optimal trim values.
}
\label{fig:pixel:trimadjust}
\end{center}
\end{figure}

We investigated the pixel noise under a variety of external factors. 
The sensor substrate
can be grounded or operated with no explicit bias connection to 
the substrate.
This could in principle change any environmental noise pickup.
The distribution of noise for a subset of pixels both
with and without the substrate being grounded are shown in
figure~\ref{fig:pixel:substratenoise}. It is seen that leaving
the substrate unconnected has no significant effect on the
noise. In addition, the sensor may be sensitive to light
and it is normally operated with a cover to keep it in the
dark. However,
the six metal layers used effectively completely cover
the top surface of the sensor so little light
reaches the epitaxial layer.
Figure~\ref{fig:pixel:substratenoise}
also shows the noise distribution of the same pixels with
and without a strong lamp being shone on the top surface of
the sensor. Again, there is no significant difference.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/Sensor11J24OffSigmas.png}
%\includegraphics[width=6cm]{pixel/Sensor11LightSigmas.png}
\includegraphics[width=6cm]{pixel/noiseJ24.png}
\includegraphics[width=6cm]{pixel/noiseLight.png}
\caption{\sl 
%(Left) Noise distribution with (solid histogram) and without (dashed
%histogram) grounding the substrate.
%(Right) Noise distribution with (solid histogram) and without (dashed
%histogram) a strong light source shining on the sensor.
Left: noise distribution with (dashed, blue) and without (solid, red) grounding the substrate.
Right: noise distribution with (solid, red) and without (dashed, blue)
a strong light source shining on the sensor.
}
\label{fig:pixel:substratenoise}
\end{center}
\end{figure}

%Effect of resets at start of bunch train.


\subsection{Bulk pixel calibration}
\label{sec:pixel:calib}

The calibration of the threshold setting in DTU to a physical
scale was performed using an $^{55}$Fe source using
the same principle as described in section~\ref{sec:testp:calibration}.
The same high-rate source was used, 
giving a sufficient rate of hits to calibrate
individual pixels.
A threshold scan was performed and the rate plotted as
a function of the threshold setting. A numerical derivative
was then taken of this rate plot to get the basic spectrum
and so to find the calibration peak. 
The results for a typical pixel are shown in
figure~\ref{fig:pixel:iron}. The observed peak corresponds to
the plateau peak, as the full energy peak is above the operating
range of the comparator.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{pixel/fe55resultsInt.png}
\includegraphics[width=6cm]{pixel/fe55resultsDer.png}
\caption{\sl 
Left: rate of hits as a function of the threshold setting.
Right: numerical derivative of the rate plot. The $^{55}$Fe
calibration signal is visible at around 190\,DTU, as a shoulder
in the left plot but as a clear peak in the right plot.
The epitaxial layer thickness is 12\,$\mu$m in this case.
}
\label{fig:pixel:iron}
\end{center}
\end{figure}

The peak positions (corrected for pedestal) for the pre-shape pixels 
measured in both
quadrants~0 and 1 are shown in figure~\ref{fig:pixel:irongain}.
The average signal for quadrant~1, 165\,DTU, is significantly higher 
than for quadrant~0, 117\,DTU,
by around 35\%, while
the spreads of the signals for quadrants~0 and 1
are 11\% and 10\%, respectively.
As shown above in figure~\ref{fig:pixel:pedsquad},
quadrant~1 also has a higher average noise than quadrant~0, by around 20\%,
so quadrant~1 has a better signal/noise ratio (averaging 25 compared with 22),
also shown explicitly in
figure~\ref{fig:pixel:irongain}.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{pixel/fittedmeans.png}
\includegraphics[width=6cm]{pixel/fittedsn.png}
\caption{\sl 
Distribution of $^{55}$Fe signal peak position (left) 
and signal/noise (right) for pixels in
quadrants~0 (solid, red) and 1 (dashed, blue). 
}
\label{fig:pixel:irongain}
\end{center}
\end{figure}

The variations in the position and width of the peak measured are shown
as a function of the position in the sensor in
figure~\ref{fig:pixel:ironmean}. The differences of the two quadrants
are clearly visible. However, within the quadrants,
similarly to figure~\ref{fig:pixel:twodpedestals},
there is no correlation between the gain or noise and the position in
the sensor.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{pixel/tpac10_sensor13_fe55bulk_meanmap.png}
\includegraphics[width=6cm]{pixel/tpac10_sensor13_fe55bulk_sigmamap.png}
\caption{\sl 
Two-dimensional map of  $^{55}$Fe peak position (left) and peak
width (right) for the two pre-shape quadrants of a typical sensor.
The lower half of each plot corresponds to quadrant~0
and the upper half to quadrant~1. The colour-coded scale
is in DAC threshold units (DTU) in both cases. Pixels for which no
peak was measured are shown as white. The faint vertical line in the 
centre of the left
plot corresponds to the pixels bordering the dead area between the two 
readout regions, which has no deep P-well implant.
}
\label{fig:pixel:ironmean}
\end{center}
\end{figure}

For quadrant~0, the
average peak position relative to the pedestal was found to
be 117\,DTU. From section~\ref{sec:testp:calibration},
this corresponds to 34\% of the
1620\,$e^-$ of signal charge, i.e. $550\,e^-$,
so this calibrates 1\,DTU to be $4.7\,e^-$.
For quadrant~1, then 1\,DTU is equivalent to 3.3\,$e^-$.
This
can be used to interpret the noise measurements above.
The average noise values of 5\,DTU and 6\,DTU, for quadrants~0
and 1 respectively,
correspond to an equivalent in terms of
signal charge of $23\,e^-$ and $20\,e^-$.
Hence, the measured
bulk pixel noise is compatible with both the test pixel 
measurements and the predicted design value.

In terms of detection of MIP signals, then the typical signal
in the pixel hit by a charged particle is the plateau fraction
of around 30\% of the $1100\,e^-$ deposited, i.e. $350\,e^-$.
Hence, this corresponds to an expected typical signal/noise ratio 
for MIPs of around 15.

\subsection{Bulk laser signal response}
\label{sec:pixel:laser}
%A similar system to that described above was used to
The sensor was
illuminated using a laser of wavelength 1064\,nm.
The laser enclosure contained a computer-controlled
moveable XY stage, on which the sensor PCB could be
mounted. This allowed the sensor to be moved in
two dimensions below the laser, allowing a large
number of measurements which are described in
this section.
For these measurements,
the signal was injected into the bulk
pixel area and the response measured using a threshold
scan. A typical response is shown in 
figure~\ref{fig:pixel:laserscan}, where the laser
signal is clearly seen. The actual size of the laser
signal was found by fitting the falling edge of the
response curve to an integrated Gaussian (an error function).
In terms of the integrated Gaussian parameters,
this gives a pseudo-analogue signal response estimate
from the mean and an estimate of the signal spread
from the width. The absolute intensity of the laser
was uncalibrated so the signal size for the
following measurements is arbitrary, although it is
similar to that expected for a MIP.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=4cm]{pixel/Run470873.png}
%\includegraphics[width=4cm]{pixel/Run470853.png}
\includegraphics[width=6cm]{pixel/lasers1.png}
\includegraphics[width=6cm]{pixel/lasers2.png}
\caption{\sl 
Typical threshold scan without (left) and with (right) the
laser powered on.
The right plot also shows the fit to the error function (red line), from
which the laser signal was determined to 
be 160\,DTU in this example.
}
\label{fig:pixel:laserscan}
\end{center}
\end{figure}

The laser must be focussed onto the epitaxial layer.
This was done by focussing the microscope optically on
the substrate surface and then recording the observed
laser signal size at various focus depths relative to
this. Figure~\ref{fig:pixel:focus} shows the results
of such a scan, where there is seen to be a strong 
dependence on the focus depth. The maximum signal was
found to be 60\,$\mu$m into the substrate relative
to the optical focus. In addition,
there is a range of only around $\pm 20\,\mu$m where the
signal size is effectively unchanged. This sets a
limit on the degree of tilt acceptable when performing
such laser measurements. A focus on pixels near one edge of the
sensor will only be within this tolerance for pixels near the
other edge if the sensor is flat to around 2\,mrad.
For this reason, 
the focus was checked when large movements
were made and, when possible, only small movements were
then performed around this point.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/focus.jpg}
\includegraphics[width=6cm]{pixel/focus.png}
\caption{\sl 
Laser signal size as a function of the focus depth
relative to the optical focus position. A positive
value means the focus position was moved into
the sensor.
}
\label{fig:pixel:focus}
\end{center}
\end{figure}

%The laser system was used to find the working point of
%the sensor in terms of the external bias voltages and
%currents. These are set using DACs on the sensor PCB;
%see section~\ref{sec:design:daq}. Of the 31 DACs used,
%7 are used to set the threshold and monostables, 4 are
%common to pre-shape and pre-sample pixels, 8 are only
%used by pre-shape pixels and the remaining 12 are only
%used by pre-sample pixels. Hence, for pre-shape pixels,
%there are 12 DAC settings which determine the working
%point. For each DAC in turn, the value was scanned through
%a reasonable range and the noise and laser signal size
%determined for each value.
%Figure~\ref{fig:pixel:optimisation} shows the results
%of these DAC scans in terms of the laser signal divided by
%the noise value. In almost all cases, a broad maximum
%was found and the values were set to be within this
%maximum region. These standard values were used for
%all the measurements, including those 
%discussed previously in this section.
%%
%\begin{figure}[ht!]
%\begin{center}
%\includegraphics[width=4cm]{pixel/bias1.jpg}
%\includegraphics[width=4cm]{pixel/bias2.jpg}
%\includegraphics[width=4cm]{pixel/bias3.jpg}
%\caption{\sl 
%Laser signal/noise as a function of each of the 12 DAC settings
%relevant to the pre-shape working point.
%The DAC values used for standard operation are shown by
%the arrows in each case.
%%TO DO: CLEAN UP
%}
%\label{fig:pixel:optimisation}
%\end{center}
%\end{figure}

The laser system was used to determine the relative
gain of the pixels. By firing the laser into the centre
of each pixel in turn, then the signal size for each
was determined. Figure~\ref{fig:pixel:lasersignal}
shows the distribution of the observed laser signals and
signal/noise ratios for
a subset of pixels in the two pre-shape quadrants.
Comparison with figure~\ref{fig:pixel:irongain} shows
these results are consistent with those from the $^{55}$Fe
measurements. 
Again a clear difference in both signal size
(90\,DTU and 130\,DTU, respectively)
and signal/noise (18.4 and 20.6, respectively)
for quadrants~0 and 1 was observed, with quadrant~1 being
higher in both cases.
The signal size (i.e. gain) spread
for quadrants~0 and 1 was found to be 12\% and 14\% respectively,
which are slightly higher than, but consistent with, 
the $^{55}$Fe measurements.
Because of the better signal/noise performance,
only the quadrant~1 variant of the pre-shape pixels
was implemented in the next version of the sensor.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=6cm]{pixel/sensor17Signal.jpg}
%\includegraphics[width=6cm]{pixel/sensor17SoverN.jpg}
\includegraphics[width=6cm]{pixel/laserSig.png}
\includegraphics[width=6cm]{pixel/laserS2N.png}
\caption{\sl 
Laser signal (left) and signal/noise (right) for 
quadrants~0 (solid, red) and 1 (dashed, blue).
}
\label{fig:pixel:lasersignal}
\end{center}
\end{figure}


%Gain (from laser), 
%
%\begin{figure}[ht!]
%\begin{center}
%\caption{\sl Two-D map of laser gain for typical sensor.}
%\label{fig:pixel:twodgain}
%\end{center}
%\end{figure}

The laser system was also used to measure the charge diffusion
so as to compare with the simulation described in
section~\ref{sec:simulation:sentaurus}. The laser was focussed to
give a illuminated spot size of less than 2\,$\mu$m and the
stage could be moved with a 1\,$\mu$m precision, so that 
the charge could be generated accurately to match the positions
of the 21 points shown in figure~\ref{fig:simulation:points}.
Because the laser was uncalibrated, the absolute fraction of
the laser signal observed could not be determined, 
so only the relative shape as a function of position is
relevant.
%but a single
%scale factor was used to give reasonable agreement to the
%simulation expectation for the central pixel.
Figure~\ref{fig:pixel:bulklaser} shows the results of these
measurements using sensors with and without deep P-well
implants. Both sensors measured had a 12\,$\mu$m epitaxial
layer thickness.
Bearing in mind that the simulation (shown in
figure~\ref{fig:simulation:simcharge}) does not include the
effects of the laser spot size or electronics noise,
it is seen that the general trend of the data
is in quantitative agreement with the simulation
and that the deep P-well increases the signal size
significantly.
% with the deep P-well
%sensor signal varying between 20\% and 50\%.
%However, the sensor without deep P-well implants
%gives somewhat higher signals than the simulation predicts,
%being always above 1\%, although the general shape is
%similar.
Overall, it is clear that
the sensor without deep P-well implants gives a
much smaller signal.
%
\begin{figure}[ht!]
\begin{center}
%\includegraphics[width=7cm]{pixel/21point_data_ndpw.png}
%\includegraphics[width=7cm]{pixel/21point_data.png}
\includegraphics[width=7cm]{pixel/realNodpwMip.png}
\includegraphics[width=7cm]{pixel/realDpwMip.png}
\caption{\sl 
Charge seen as signal (in units of DTU) from laser
for no deep P-well (left)
and deep P-well (right), as a function of the laser impact position
relative to the centre of the pixel.
These data are from a sensor with a 12\,$\mu$m thick epitaxial layer.
}
\label{fig:pixel:bulklaser}
\end{center}
\end{figure}
