\section{Physics performance}
\label{sec:physics}

Given the results shown in the previous sections, it is possible
to simulate the performance of a full scale binary ECAL. This
study was done with the same sampling geometry as discussed in
Section~\ref{sec:requirements}. These results supercede those 
presented previously~\cite{ref:physics:lcws07}.

\subsection{Simulation}
The underlying EM shower simulation used was based on the GEANT4
programme~\cite{ref:basic:geant4}. This simulation has
been used extensively and in particular has been checked to
high accuracy in an analogue silicon-tungsten sampling
ECAL by the CALICE collaboration~\cite{ref:physics:calice}.
However, this ECAL had a pad granularity of $1 \times 1$\,cm$^2$
and it is not known if the shower simulation is accurate at
the much smaller granularities relevant for the binary ECAL
simulation.

The energy deposited within each pixel was recorded on a 
grid of $5 \times 5$\,$\mu$m$^2$ subpixels. These corresponded
to squares formed with the 21
simulation points described in Section~\ref{sec:pixel:simulation}
at the corners.
Within each subpixel, the energy deposited by all the particles in
the event was summed. 
The simulation used units of the 
deposited energy throughout, so the plots below are in terms of
these units. 

Following the completion
of the shower simulation, then this energy was shared between the
hit pixel and the eight surrounding nearest neighbour pixels
according to fractions determined from the charge diffusion simulation.
The energy per pixel was then smeared by applying Gaussian noise
and a threshold was applied to each pixel. For pixels with no energy
(whether from the original shower or due to diffusion), then hits
were added to random pixels with a rate corresponding to the noise
and threshold values chosen.
The effect of dead area was included by removing any hits in the
inactive areas following the simulation process.
The spectra of energies in each pixel
at each stage of this process are shown in 
figure~\ref{fig:physics:spectra}.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/Eall_landauFit_10GeVelectrons.png}
\caption{\sl 
Spectra of energy in each pixel at various stages
of the sensor simulation.
The spectra correspond to the original deposited energy (dark blue),
the energy in the hit pixel after charge diffusion (green), 
noise in neighbouring pixels which were not hit (pink),
the energy in the neighbouring pixels due to charge diffusion (red),
and the total (black). The yellow
histogram corresponds to the total smeared by the noise.
}
\label{fig:physics:spectra}
\end{center}
\end{figure}

A nominal noise value of 120\,eV was used; this corresponds to the
low end of the noise distribution observed but is a realistic
target for a future sensor.
For a single MIP at normal incidence, the resulting efficiency for
generating at least one hit when passing through a layer is shown
in figure~\ref{fig:physics:effvsthresh} as a function of the threshold
applied. This should be compared with
figure~\ref{fig:sensor:beameff}, for which the calibration
of TU means the range of the threshold axis shown in that figure
corresponds to 9\,keV, twice the range of
figure~\ref{fig:physics:effvsthresh}. Both show a rise of
around a factor of five in the range 1\,keV to 4\,keV,
so giving some confidence that the simulation is reasonably
reproducing the sensor performance.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/efficiency.png}
\caption{\sl 
Simulated of the efficiency for obtaining at least one
hit from a MIP at normal incidence, as a function of the threshold.
The squares correspond to the full simulation and the
inverted triangle to a simulation with no charge diffusion.
The vertical line indicates a typical threshold which would
be used.
}
\label{fig:physics:effvsthresh}
\end{center}
\end{figure}


\subsection{MIP counting}

Due to the charge diffusion between neighbouring pixels, it is possible
for a single simulated MIP passing through a layer to result in anything from
zero to nine hit pixels, depending on position, noise level and threshold.
Hence, simply using the number of hit pixels as an estimate of the
number of MIPs incurs a large error from this fluctuation. By clustering
the neighbouring pixels and counting clusters rather than hits,
it is possible to remove most of the effect
of such fluctuations and so get a better estimate of the number of
MIPs. This clustering is called ``MIP counting'' here.

A simple MIP counting algorithm was used for the following results.
The pixels were grouped into isolated clusters, which were defined
to be contiguous clusters of hit pixels with
no further hits in any of the nearest neighbouring pixels. 
If the cluster contained no hit pixels for which all eight nearest 
neighbours also were hit, then the cluster was counted as one MIP.
If one or
more hit pixels had all eight nearest neighbours also hit, then 
the cluster was counted as having a number of MIPS equal to the number
of such completely surrounded pixels. 
%
%\begin{figure}[ht!]
%\begin{center}
%\includegraphics[width=6cm]{physics/mccluster.jpg}
%\caption{\sl Effect of MIP counting.}
%\label{fig:physics:mipcount}
%\end{center}
%\end{figure}
%
Clearly, this algorithm is not unique and is
unlikely to be the best possible for this purpose.
However, the optimisation depends on
details of the EM shower behaviour at very fine granularity.
These details have yet to be verified with real data and so 
finding the best MIP counting method cannot be done with
any degree of realism at this stage.

\subsection{Electromagnetic shower resolution}

Using the MIP counting algorithm decribed above, 
the resulting EM shower resolution predicted by the simulation
is shown in figure~\ref{fig:physics:resolution}.
It is seen that the resolution of the binary ECAL modelled
here is degraded significantly with respect to the ideal
digital case of perfect MIP counting. The stochastic term
is increased from 9.5\% to 13.0\%,
around 35\% higher. 
However, note the binary ECAL is still predicted
to have a better resolution than the ideal analogue ECAL
which uses the same sampling fraction.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/resEsq.png}
\caption{\sl 
Comparison of the resolution dependence on 
the incident photon energy. The red and green lines
are the ideal cases, as shown in figure~\ref{fig:introduction:ideal}.
The blue line shows the result for a
realistic binary ECAL after the full sensor simulation
described in the text, including MIP counting.
}
\label{fig:physics:resolution}
\end{center}
\end{figure}

The various effects included in the simulation can be
varied to observe their individual contributions to
this degradation. For the following studies, an incident
photon energy of 10\,GeV was used, for which the
value of $\sigma_E/E$ is 3.2\% for the ideal binary
ECAL and 4.5\% with the full simulation.

The effect of the deep P-well implant on the sensor is shown in
figure~\ref{fig:physics:nodpw}. It is seen that for a
sensor with no deep P-well, the
loss of charge to the unprotected N-well circuit diodes
causes a very significant degradation of the resolution
from 4.5\% to 8.1\%,
more than doubling the ideal value and making the performance
much worse than the ideal analogue ECAL.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/SigEoverE_DPW_10GeV.png}
\caption{\sl 
Resolution for 10\,GeV photons with (squares) 
and without (triangles) the deep P-well implant,
as a function of the applied threshold.
}
\label{fig:physics:nodpw}
\end{center}
\end{figure}

The effect of the noise is shown in figure~\ref{fig:physics:noise}.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/SigEoverE_noise_10GeV.png}
\caption{\sl 
Resolution for 10\,GeV photons with simulated noise
equivalent to 90\,eV (cirles), 120\,eV (squares) and 
180\,eV (triangles) energy deposited,
as a function of the applied threshold.
These correspond to the expected, best observed and average
values of the sensor, respectively. Also shown is the resolution
in the absence of noise (inverted triangles).
}
\label{fig:physics:noise}
\end{center}
\end{figure}
%
Noise affects the resolution through adding isolated hits which are
counted as MIPs. While a correction can be made for the average number,
these fake MIPs increase the resolution error 
due to the statistical fluctuation
on the number of noise hits. The number of hits depends very strongly
on threshold but, for high enough thresholds, the effect of the noise
can be made small. 
Since the threshold can be chosen at will given a
particular noise level, then by adjusting the threshold, the increase
in resolution due to the noise can be reduced. 
The figure shows that
higher noise gives an optimal resolution at a higher thresholds but that
the resulting resolution degrades only slightly compared to the case with
no noise.
Note, the wide minimum for the case with no noise; 90\,eV
noise gives the same resolution as no noise, so indicating
the level as which the noise becomes negligible.
The optimal thresholds
for the three noise values shown were found to be 
0.5\,keV for 90\,eV noise,
0.7\,keV for 120\,eV noise and
1.0\,keV for 180\,eV noise. The resulting resolutions were
4.4\%, 4.5\% and 4.8\%, respectively.
Hence, the noise contribution to the degradation from the ideal 
resolution of 3.2\% is small.
%, at around 10\% or less.

The effect of the dead area is shown in figure~\ref{fig:physics:deadarea}.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/SigEoverE_dead_10GeV.png}
\caption{\sl 
Resolution for 10\,GeV photons with dead area
equivalent to 11\% (squares) and 15\% (inverted triangles),
as a function of the applied threshold.
These correspond to the on-sensor memory area and an estimate
of the total dead area in a full-scale ECAL including edge
effects around the sensor. Also shown is the resolution for a
sensor with no inactive areas (triangles).
}
\label{fig:physics:deadarea}
\end{center}
\end{figure}
%
It is seen that the effect of the SRAM memory
dead area is to increase the resolution
from 4.3\% to 4.5\%, again a small effect.
By design, the dead area 
due to the on-sensor memory is
spread out across the sensor. The EM showers have a width determined
by the Moli\`ere radius of 9\,mm and the memory dead areas are
spaced out by 2.4\,mm. This means every shower loses approximately
the same fraction of hits and so the resolution degrades by only
the statistical fluctation on the number, not due to a variation
in the mean number as a function of the impact position of the incident
particle. Although somewhat uncertain, an estimate of the effect
of extra dead area around the periphery of the sensor, and in gaps
between sensors, for a realistic-sized sensor has been made. This
may contribute a further 4\% of dead area. The effect of this has also
been modelled and is shown in figure~\ref{fig:physics:deadarea} to
give a very small contribution.

The effect of the charge diffusion is shown in 
figure~\ref{fig:physics:diffusion}.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/SigEoverE_CS_10GeV.png}
\caption{\sl 
Resolution for 10\,GeV photons with (squares)
and without (dashed line) charge diffusion,
as a function of the applied threshold.
}
\label{fig:physics:diffusion}
\end{center}
\end{figure}
%
Although it is not physically possible to turn off the charge diffusion
in the sensor, it is interesting to see how the
charge diffusion affects the resolution. The figure shows the
the resolution with and without simulating charge diffusion. The
amount of charge per hit pixel is around three or four times higher on
average without charge diffusion and so the effect of the threshold
cut in the range considered
is much smaller. However, at the optimal threshold, the resolutions
with and without charge diffusion are very similar at 4.3\% and 4.5\%.
Hence, the crosstalk from charge diffusion has a small effect for a
binary ECAL application.

The effect of the MIP counting is shown in figure~\ref{fig:physics:count}.
%
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=6cm]{physics/SigEoverE_clust_10GeV.png}
\caption{\sl 
Resolution for 10\,GeV photons with no MIP counting (red)
and with the simple MIP counting algorithm (black) as described in the text,
as a function of the applied threshold.
The horizontal line (green) shows the resolution obtained with an
ideal MIP count.
}
\label{fig:physics:count}
\end{center}
\end{figure}
%
The figure shows that using a naive hit count to estimate the number
of MIPs gives a very large resolution, namely 5.9\% 
compared with the 4.5\% using a MIP counting algorithm, 
so using such an
algorithm is essential to get good performance. However, the algorithm
used does not bring the resolution down close to the ideal case value
of 3.2\%; there is
still a significant difference between the ideal and realistic cases
which is bigger than any of the effects previously considered. 

Hence, the
dominant contribution to the degradation of the resolution,
even in the absence of noise, dead area and charge diffusion, is 
due to the confusion of interpreting the observed hits in terms of 
numbers of MIPs. It is clear that a major study of MIP counting
algorithms will be needed to find the limit of this approach. However,
as stated above,
the details of such an optimising MIP counting algorithm are likely to
depend heavily on the details of EM showers. In particular, they will
be sensitive to the core hit density in each layer and potentially to 
correlations between layers. As stated above, the
GEANT4 shower simulation has not been verified at the very fine
granularities relevant for these studies. Hence, it is essential to
get real experimental data on showers at these granularities in order
to know the real limits of the binary ECAL approach.


%\subsection{Hadronic jet resolution}
%
%The current state-of-the-art in PFA performance is exemplified
%by the PandoraPFA programme~\cite{ref:introduction:pfa1}. This
%programme implements a very detailed algorithm which has been
%developed using simulations of analogue ECALs with pad sizes
%of 4-10\,mm. To reoptimise the whole algorithm to
%take best advantage of the small pixel size of a binary ECAL
%would be a major task and is beyond the scope of this paper.
%Hence, the ultimate performance of a binary ECAL for PFA is not yet
%established.
%
%However, to check the PFA performance would not be degraded
%by changing from an analogue to a binary ECAL, then a
%``no-harm'' study was done. In this, the PandoraPFA programme
%was run on an analogue ECAL with $5 \times 5$\,mm$^2$ pads
%within the ILD detector framework~\cite{ref:introduction:ild}.
%To compare directly with no changes to the PFA programme, the
%binary ECAL MIP counts were combined into pseudo-pads of the
%same size. Specifically, the total MIP count of all clusters
%centred in the same area as each equivalent analogue ECAL
%pad was found and this value used to give an ADC-equivalent
%value to that of the analogue ECAL. By adjusting a 
%single calibration factor multiplying the MIP count, then the
%binary ECAL data were put into an identical scale and format as the
%analogue ECAL and the PandoraPFA programme could be run on
%both with no changes.
%
%The results for reconstruction of pairs of jets from the
%process $Z \rightarrow q\overline{q}$, for $q = u$, $d$
%or $s$ quarks, are shown in
%figure~\ref{fig:physics:noharm}.
%%
%\begin{figure}[ht!]
%\begin{center}
%\includegraphics[width=12cm]{physics/noharm.jpg}
%\caption{\sl 
%$Z$ mass resolution using hadronic jet reconstruction 
%for (left) an analogue ECAL and (right) the equivalent
%binary ECAL with hits grouped according to the ``no-harm'' case.
%}
%\label{fig:physics:noharm}
%\end{center}
%\end{figure}
%%
%This shows the resolution on the $Z$ mass is effectively
%unchanged between the analogue and binary ECALs. This
%demonstrates the binary ECAL will be able to give at
%least equal performance to an analogue ECAL for PFA.
%Indeed, as much of the fine granularity information is
%discarded in the above study, then it may be 
%that a significantly improved performance would be possible if the
%PFA is tuned to use this information.



%PFA improvements.
%
%\begin{figure}[ht!]
%\begin{center}
%\includegraphics[width=6cm]{physics/pfa.jpg}
%\caption{\sl Hadronic jet resolution with PFA-improved algorithm.}
%\label{fig:physics:pfa}
%\end{center}
%\end{figure}
