\section{Data Analysis}
\label{sec:analysis_overview}
The Hall A physics data analysis model is straightforward. Raw data
from the data acquisition (DAQ) are decoded and analyzed by an
event-processing program.
The event processor creates data summary files that contain
raw and computed data, typically in ntuple and histogram format.
Diagnostic information as well as final physics results are then
extracted from the summary files
with the help of interactive analysis tools such as PAW~\cite{paw} and
ROOT~\cite{root}.
This general scheme applies to both on-line and off-line analysis.
For on-line analysis, experimenters have the option of analyzing
either raw data stored in files on local disks of the DAQ computers or
a random sample of the raw data stream that is distributed via network in
real time. Network distribution is provided by the ET component of the CODA~\cite{coda} DAQ system.
Raw data files are typically processed shortly after acquisition
(quasi-offline analysis). This method is particularly suitable if the
on-line data rate is relatively low (typically below 1k events/s) or while
no data are being taken. At higher rates, simultaneous read and write
access to the raw data storage may increase the DAQ computer deadtime.
Such deadtime problems can be avoided by using the ET system;
the main disadvantage of this system is that only a sample of the data,
instead of the entire data set, can be analyzed.
For off-line analysis, the raw data files are first retrieved from the
JLab Mass Storage System (``tape silo'') to staging disks, from where
they can be processed either interactively or as part of a batch job.
For batch processing, the JLab Computer Center maintains a large PC
farm, which at the time of this writing consists of 370 CPUs delivering
approximately 11,500 SPECint95~\cite{jlabfarm}.
The farm is shared among the various user groups from all three experimental
halls performing data analysis.
Interactive analysis is usually carried out on individual desktop computers
or small PC clusters owned by individual groups. To date, virtually
all farm and desktop systems run Linux.
\subsection{General Features}
\label{sec:espace}
For the past several years, Hall A has been using the FORTRAN-based
program ESPACE (\underline{E}vent \underline{S}canning
\underline{P}rogram for Hall \underline{A} \underline{C}ollaboration
\underline{E}xperiments)~\cite{espace}
as the standard physics event-processing
software. ESPACE was originally developed at Mainz and
improved at MIT before being introduced in Hall A in 1995.
It is written in FORTRAN 77 with the addition of many
VMS-style (DEC Fortran) extensions such as structures and pointers.
Common operations such as histogramming, graphics, and macro processing are
implemented using various CERNLIB~\cite{cernlib} packages.
ESPACE's capabilities include:
\begin{itemize} \setlength{\parskip}{0ex}
\item reading, decoding, and scaling (calibrating) raw event data,
\item reconstruction of wire chamber tracks, computation of spectrometer
focal-plane coordinates and target quantities,
\item computation of basic physics quantities (e.g., angles,
four-vectors, kinematics),
\item dynamic definition of conditional tests (cuts) and
selection of event data based on these tests,
\item dynamic definition of histograms and ntuples and output of
these in HBOOK~\cite{hbook} format,
\item fitting of analysis parameters (e.g., timing and position offsets,
spectrometer reconstruction matrix elements) to experimental data
(``optimization''),
\item display of single events in terms of detector hits in a graphics window,
\item program control and analysis steering via the Kit for a User Interface Package (KUIP)~\cite{kuip}.
\end{itemize}
A dynamic definition of tests and histograms is implemented by the
COOLHANDS package~\cite{coolhands}, which is accessible directly from KUIP.
ESPACE has been used to date by almost all Hall A experiments for
production data analysis. Its main advantages are the fact that it is
relatively well debugged and has been adapted to the specific Hall A
requirements. Its track reconstruction algorithm is sophisticated
and provides high efficiency and resolution.
The typical analysis speed is 100-200 events/s on a 500 MHz Linux PC.
In the following, a detailed description of the tracking and reconstruction
algorithm used in ESPACE is given.
\subsection{Tracking \& Reconstruction Algorithm Overview}
Tracking information is obtained from the two vertical drift chambers
(VDCs) in each spectrometer. The lay-out of the VDCs is illustrated
in Figure~\ref{fig:vdc_frame}.
An important advantage of the two-chamber design is that it provides a
long lever arm for the measurement of track angles, resulting in high
angular tracking resolution.
Global track angles are determined from the
two track cross-over positions measured in the two VDCs.
The cross-over positions can be reconstructed with very high
precision and are insensitive to the details of the reconstruction
algorithm. Knowledge of the {\it local\/} track angles in each
wire plane is not necessary.
The tracking analysis can be divided roughly into the following steps:
\begin{enumerate}
\item hit selection,
\item cluster identification,
\item TDC corrections,
\item local cluster fitting,
\item If multiple clusters are found in any plane:
\begin{enumerate}
\item path analysis,
\item global cluster fitting,
\item path selection,
\item ``Golden Track'' selection.
\end{enumerate}
\item Focal-plane coordinate transformations.
\item Reconstruction of target coordinates.
\end{enumerate}
We examine each step more closely in the following.
\subsection{Hit detection and selection, and cluster identification}
Figure~\ref{fig:vdccluster} illustrates the passage of a charged particle
through a VDC plane. Along its way, the particle ionizes the gas in the
chamber. Ions and electrons generated in this process drift with nearly
constant velocity along the lines of the electric field
between the wires, which are grounded,
and the cathode planes, which are held at a negative potential of
about $-4$~kV.
As the field intensifies in the region close to the wires,
drifting electrons accelerate and cause further ionizations, resulting
in an avalanche which induces an electrical signal (hit) on the wire.
The signals are preamplified and sent to TDCs.
The TDCs are capable of recording multiple hits per event and
are operated in the common-stop mode.
If multiple hits occur on a wire,
the first hit corresponds to the largest TDC value.
ESPACE uses only these first hits for further analysis, and all subsequent
hits on a given channel are ignored. This approach is reasonable
because multiple hits per wire are often associated with
electronic ringing or track-induced noise, where only the leading edge of the
signal is physically meaningful. A typical spectrum of the TDC values
of the first hits is shown in the lower left panel of Fig.~\ref{vdc_online}.
To eliminate noise further, hits that do not satisfy the condition
$-0.5 D \leq t \times \eta \leq 1.5 D$ are cut from the
input data. Here,
$D$ is the distance between the wire and the cathode planes (13.0~mm),
$t$ the measured drift time,
and $\eta$ the average electron drift velocity in the chamber (50~$\mu$m/ns).
Once hits have been selected, clusters are identified.
Clusters consist of hits with consecutive wire numbers.
To allow for inefficiencies, clusters are allowed to
have gaps of one wire without a hit.
By design, good tracks cross the VDCs at an angle of approximately
45$^\circ$, corresponding to an angle of 55$^\circ$
with respect to the wire planes (cf., Eq.~(\ref{eq:thteq})).
Thus, there are typically four to six hits in a cluster.
\subsection{TDC corrections}
In principle, tracks can be reconstructed using only the
cluster center coordinates, which can be obtained from the known wire
locations; however, the spatial resolution per plane
available in this way is of order of the wire separation (4.2~mm),
which is not sufficient to meet the precision requirements of the Hall A
spectrometers.
Better resolution can be obtained by analyzing the TDC timing information.
The TDC data allow extraction of the projected drift distances
$d_i$ within each wire cell $C_i$ (see Fig.~\ref{fig:vdccluster}).
Once the distances $d_i$ are known,
the cross-over point of the track in the wire plane
can be determined with very high precision by a linear fit
of drift distances vs.\ wire positions.
The typical per-cluster position resolution
obtained with the Hall A VDCs using this method is 225~$\mu$m FWHM~\cite{vdcNIM}.
The TDCs directly measure the time between ionization and the arrival
of the signal at the wire (the ``drift time''). The
extraction of precise drift distances $d_i$ from the measured
drift times requires a more detailed analysis.
The raw TDC data must be corrected for a number of effects:
\begin{enumerate}
\item the time of flight between the cluster centroid and the first
scintillator plane (S1);
\item the dependence of the trigger scintillator timing on the
amplitude of the scintillator signal (``timewalk''); and
\item \label{item:tdd}
the non-linear relationship between drift time and drift distance.
\end{enumerate}
While the first two corrections are relatively minor,
the third one is important.
The relationship between drift time and absolute drift distance
is non-linear because of the non-uniform electric field within the cells;
in particular, the mean drift velocity increases near the wires.
The dependence of distance on time
can be parameterized either analytically based on
calculations or empirically based on data~\cite{vdcNIM,wechsler}.
Three different parameterizations are implemented in ESPACE to
linearize the drift times:
\begin{enumerate}
\item a fourth-order polynomial with fitted coefficients~\cite{wechsler};
\item a third-order polynomial with coefficients
obtained from a GARFIELD~\cite{wechsler,garfield} simulation; and
\item a two-dimensional lookup table generated from calibration data~\cite{vdcNIM}.
\end{enumerate}
In practice, the most stable results are usually obtained with the
first method.
Internally, ESPACE does not compute drift distances
directly, but rather equivalent linearized drift times. Multiplication
of these times with the average drift velocity $\eta$ yields
drift distances. This approach allows a
constant timing offset to be fitted along with the track parameters.
This is important in the multi-cluster
analysis (see section \ref{sec:multicluster}).
The precision of the TDC corrections
is not critically important for the precision of the final tracking results.
Because of the symmetry of the cluster fit geometry, imprecise
TDC data increase predominantly the error in the local track {\it angles\/}.
The fitted cross-over positions are relatively insensitive to details of
the corrections, with a highly symmetric cluster being the least sensitive.
Eventually, only the local cross-over points, not the angles, are
used to compute the track parameters (see Eqs.~(\ref{eq:alueq}) and
(\ref{eq:alveq})).
\subsection{Local cluster fitting}
\label{sec:clusterfit}
After determination of the TDC corrections, track positions and angles
are extracted from the cluster data.
If only one cluster is found per wire plane,
a standard linear fit is performed on each cluster in each wire
plane, and the analysis continues with the fitted local positions and
slopes. Specifically, the fit is performed on the variables
\begin{eqnarray}
x_i &=& S_i \cdot \eta ( t_{\it off,i} - t_i + t_{corr,i} ) \\
y_i &=& w_i - w_0
\end{eqnarray}
where $\eta$ is the average electron drift velocity,
$t_{\it off,i}$ the TDC value for zero drift time (the ``TDC offset'')
for the $i$-th wire, $t_i$ the measured TDC value for that wire,
and $t_{corr,i}$ the sum of the TDC corrections explained above.
The constants $w_i$ represent the position of the $i$-th wire.
The relevant geometry is shown in Fig.~\ref{fig:vdccluster}.
The quantity $S_i = \pm 1$ is the sign of the $i$-th drift distance.
The sign $S_i$ is ambiguous
because the TDC data contain no information as to whether
a track passed below or above a wire and is determined in
a separate step as explained below. The result of the
fit are the intercept $u$ ($v$ for V planes), slope $\tau_u$ ($\tau_v$),
their respective uncertainties, and $\chi^2$. Note that, with these
definitions, the slope $\tau$ vanishes when the track is perpendicular
to the wires.
To resolve the
ambiguity in the sign of the calculated drift distances, one
observes that good tracks traverse the chamber at an angle of approximately
55$^\circ$ with respect to the $u$ ($v$) axis. Assuming a given track satisfies
this criterion, all hits
with smaller $u$ ($v$) coordinates than the cross-over point of the track
in the wire plane can be assigned negative drift distances.
The cross-over point can be
taken to coincide with the wire that has the smallest drift distance
(``pivot wire'').
An ambiguity remains about the sign of the drift distance to be assigned
to the pivot wire. It can be resolved by trial-and-error: two fits are
performed, one with a positive and one with a negative
value of the drift time of the pivot wire, and the fit with the
smaller $\chi^2$ is assumed to be correct.
The above method for resolving the sign ambiguity and determining
the track parameters through a fit only works for clusters with
three or more hits.
For clusters with only two hits, it is usually possible to guess the signs of
the two distances by requiring that the track slope be close to 55$^\circ$.
Thus slope and intercept can be estimated, albeit with reduced precision
and confidence. This procedure slightly improves the tracking efficiency
at the expense of a lower resolution for some tracks.
``Clusters'' consisting of only one hit do not yield sufficient information
and are discarded.
At this point in the analysis, ESPACE distinguishes two cases:
\begin{itemize}
\item Exactly one cluster per plane. This is a ``single-cluster event''.
The analysis continues as described in section \ref{sec:vdc_coords}.
\item More than one cluster in at least one plane. This is considered
a ``multi-cluster event'', even if only a single plane has multiple
clusters. In this case, the analysis
continues as described in the next section.
\end{itemize}
\subsection{Multi-Cluster Analysis}
\label{sec:multicluster}
Multiple clusters in a wire plane may occur for several reasons:
\begin{itemize}
\item Noise, which may originate, for example,
from the electronics, cosmics, or
radiation background. True noise clusters usually do not
give reasonable fit results and thus are easy to remove.
Cosmics coincident with an actual track are normally
very rare due to the low cosmics rate. Cosmics and certain
background noise may lead to valid tracks through the
chamber, but can usually be eliminated
easily because of unreasonable angles, reversed scintillator timing,
and, eventually, failure to reconstruct to the target.
\item Actual multiple tracks from the target. These
may occur for essentially two reasons: (a) several tracks emitted
from the same interaction in the target fall within the
acceptance of the spectrometer; and (b) accidental coincidences
of tracks from two separate interactions occur within the VDC timing
window. The former case is rare because
the Hall A spectrometers do not have a sufficiently large
acceptance to be able to cover much of the phase space for
multiparticle events.
The latter case may occur rather frequently at sufficiently
high singles rates, and thus it is the most likely cause of
multi-track events.
Usually, all tracks in true multi-track events can be reconstructed.
\item Spurious tracks caused by delta rays, which are produced
before or in the wire chamber by actual tracks. Such tracks
often have unreasonable angles and/or do not make clusters
in all wire planes
(e.g., if they are generated inside the chamber);
however, as they may occur close to actual tracks, they may cause
overlapping clusters and thus corrupt valid tracking information.
This may be a difficult situation to analyze, and actual tracks
may not always be recoverable. An upper limit on the probability that
spurious tracks occur in the chamber that disturb the regular tracking
data is given by the abundance of clusters with high hit multiplicity. Typically,
about $3 - 4\%$ of events in each spectrometer are found to have one
or more clusters with eight or more hits. Such clusters cannot occur due to
normal tracks alone and contain either spurious hits or are entirely due to tracks not
originating from the target.
\end{itemize}
If multiple clusters occur in any plane,
the association between clusters and tracks may become ambiguous.
To determine the most probable track(s) through the chamber,
an approach well known in wire chamber
analysis is taken within ESPACE. All possible combinations
of clusters from the four VDC planes are identified
(each combination containing exactly one cluster from each plane),
and each such combination is considered a possible path of the track
through the chambers.
A fit is then performed for each path, and the paths are ordered by the
the fit's total $\chi^2$. The path(s) with the smallest $\chi^2$
represent(s) the best reconstructed track(s).
In the following sections these steps are described in detail.
As this algorithm is relatively involved and not guaranteed to yield
improved tracking results, it is sometimes considered safer to disregard
any events with multiple clusters per wire plane altogether at the expense
of tracking efficiency and to consider only unambiguous single-cluster events.
\subsubsection{Path analysis}
\label{sec:pathanalysis}
To identify paths through the chamber,
ESPACE considers the wire planes in the order U1, U2, V1, and V2
(see Fig.~\ref{fig:vdc_frame}).
This sequence is preferable over the actual physical sequence
because hits from like wire planes (U or V) can be fitted together.
For every cluster in plane U1, all combinations (``links'') with
clusters in plane U2 are considered. The cluster in U1 is considered the
``start point'', and the cluster in U2, the ``end point'' of the link.
There are $n_{u1} n_{u2}$ such
links, where $n_{u1}$ and $n_{u2}$ are the numbers of clusters in U1 and
U2, respectively. For each link, a fit is performed on the combined
hits (typically $2\times 5 = 10$) of the clusters from both planes,
U1 and U2. The fitting procedure used is described
in the next section in more detail.
The resulting $\chi^2$, cross-over
position, timing offset $t_0$, and track slope are stored with the link.
This procedure is repeated identically for the
combination of planes V1 and V2.
For the combination U1 and V1, it is not possible to perform a fit since
the wire directions of the planes are orthogonal. Thus,
only the possible links between these planes are stored.
Next, a table is built of all connecting combinations of links.
Two links connect if the end point of a link in one plane
is the start point of a link in another plane.
Thus, each combination contains
exactly three links, one between each pair of wire planes in the sequence
U1-U2, U2-V1, and V1-V2.
There are $n_{u1} n_{u2} n_{v1} n_{v2}$ such combinations.
Each is a possible path for the track.
\subsubsection{Global cluster fitting}
\label{sec:globalfit}
In a multi-track situation or in the presence of noise,
tracks other than the one that generated the event trigger will, in general,
occur at times other than the trigger; a fit to the drift times
must, therefore, allow for a timing offset, called $t_0$.
Clusters belonging to the ``Golden Track'' (the track
that generated the trigger) will have $t_0 \approx 0$, while clusters belonging
to other tracks will, in general, have a non-zero fitted time offset.
To accommodate $t_0$,
ESPACE uses a three-parameter fit in the multi-track analysis.
The fit routine used is derived from the {\tt curfit} algorithm
of Bevington~\cite{bevington}. This is an iterative algorithm which is
computationally relatively expensive.
As in the single-track case, the ambiguity of the pivot-wire
drift time must be resolved. This is again done by trial-and-error;
however, since two clusters from two different
wire planes are involved in the multi-cluster fit,
{\it four\/} fits are performed on the same data, corresponding to the
four possible sign combinations of the two pivot wires.
The result with the smallest $\chi^2$ is chosen.
(The number of fits is the same as in the case of single clusters,
of course, although the single-cluster fit algorithm is simpler
and fewer data are processed with each fit.)
The computational requirements of this algorithm are relatively high.
For instance, if two real tracks are present, generally there will be two
clusters in each plane, and so $2^4 = 16$ paths to consider.
Because a single path contains two pairs of wire planes (U1-U2 and
V1-V2) that are fitted together, eight fits
are performed for each path to resolve all ambiguities.
As a result, $16\times 8 = 128$ iterative fits must be carried out
to identify two tracks.
\subsubsection{Path ordering and track identification}
\label{sec:trackselect}
Next in the analysis, paths are ordered according to a goodness-of-fit
criterion, and the best-fit result(s) are selected.
To order paths by their probability of describing a valid track,
ESPACE uses the quantity
\begin{equation}
\chi^2_{tot} = \chi^2_{u1u2} + \chi^2_{v1v2} +
\left(\frac{t_{0,v1v2} - t_{0,u1u2}}{\min(\sigma(t_{0,v1v2}),
\sigma(t_{0,u1u2}))}\right)^2.
\label{eq:chisqtot}
\end{equation}
Here, $\chi^2_{u1u2}$ and $\chi^2_{v1v2}$ are the $\chi^2$-values found
in the U1-U2 and V1-V2 global cluster fits, respectively,
$t_{0,u1u2}$ and $t_{0,v1v2}$ are the timing offsets obtained from
these respective fits, and the $\sigma(t_0)$ are the uncertainties
in those offsets. The minimum uncertainty of the two $t_0$ fits is used,
rather than the combined uncertainty, in order to give smaller $\chi^2$
in situations where the two $t_0$ fits have comparable rather than dissimilar
uncertainty.
Using the difference of timing offsets as a goodness-of-fit criterion
between the planes U2 and V1 is the best that can be done under the
circumstances. Because the U and V coordinates are orthogonal, there is
no good criterion for matching U and V clusters other
than their timing. This is a design limitation of the Hall A VDCs.
Different chamber designs include additional wire planes oriented in a third
direction that allow easier correlation between clusters in different planes.
Possible physical tracks are now selected from the ordered paths.
This step relies on the assumption that
each cluster belongs to at most one physical track, which is
correct so long as clusters from different tracks do not overlap.
ESPACE selects the maximum number of tracks from the available paths that
do not have any clusters in common, starting from the path with
smallest $\chi^2_{tot}$. Note that this means, for example, that in order to
find two valid tracks, {\it every\/} VDC plane must have at least two clusters.
Even if many possible paths were
found in the preceding analysis, only a small number of tracks
survive at this point. A typical histogram of the track multiplicity
in a high-rate experiment is shown in Fig.~\ref{fig:trackmult}.
In general, tracking results are only considered useful for physics analysis if a single track is found. Events with
multiple tracks are typically discarded (see section~\ref{Limitations}). Using the single track criterion, the
overall tracking efficiency varies between better than $95\%$ at low rate and $70 - 80\%$ at high rate.
\subsubsection{Golden Track Selection}
\label{sec:goldentrack}
The final step in the multi-cluster analysis is to select the Golden Track
from the set of tracks determined in the previous analysis.
The timing offset $t_0$ obtained from the global cluster fits
(section \ref{sec:globalfit}) can be used as a direct measure of
the probability of a track to have generated the trigger.
ESPACE uses the weighted average of the two timing offsets
obtained, viz.
\begin{equation}
t_{0,av} = \frac{\frac{t_{0,u1u2}}{\sigma(t_{0,u1u2})^2} +
\frac{t_{0,v1v2}}{\sigma(t_{0,v1v2})^2}}
{\frac{1}{\sigma(t_{0,u1u2})^2} +
\frac{1}{\sigma(t_{0,u1u2})^2}}
\label{eq:t0av}
\end{equation}
to select the Golden Track. The quantities $t_0$ and $\sigma(t_0)$
in Eq.\ (\ref{eq:t0av}) are the same
as in Eq.\ (\ref{eq:chisqtot}). The track with the smallest
$t_{0,av}$ is chosen. Further analysis continues with this track only,
and all other tracks found are subsequently ignored.
\subsection{Coordinate Transformations and Target Reconstruction}
\label{sec:vdc_coords}
In the preceding analysis, the track through the VDC has been determined in
terms of wire plane coordinates, $u$ and $v$.
For further analysis, it is advantageous to convert the track
coordinates to detector coordinates: $x_{det}$ and $y_{det}$,
and their corresponding angular coordinates, $\theta_{det}$ and
$\phi_{det}$. (By convention, $\theta_{det}$ and $\phi_{det}$
denote the tangents of the respective angles.)
The relationship between the coordinate systems is shown in
Fig.~\ref{fig:vdc_detcoord}.
The coordinate transformation can be written as
\begin{eqnarray}
x_{det} &=& \frac{u\sin\gamma - v\sin\beta}{\sin(\gamma-\beta)}
\label{eq:xeq} \\
y_{det} &=& \frac{u\cos\gamma - v\cos\beta}{\sin(\gamma-\beta)}
\label{eq:yeq}\\
\theta_{det} &=& \frac{\sin\gamma\tan\alpha_u - \sin\beta\tan\alpha_v}
{\sin(\gamma-\beta)} \label{eq:thteq} \\
\phi_{det} &=& \frac{\cos\gamma\tan\alpha_u - \cos\beta\tan\alpha_v}
{\sin(\gamma-\beta)}. \label{eq:phieq}
\end{eqnarray}
Here, $\alpha_u$ and $\alpha_v$ are the global track angles in the $u$-$v$
coordinate system, i.e., the angles between the the $z$-axis
and the projection of the track onto the $u$-$z$ and $v$-$z$ planes,
respectively.
In the single-cluster analysis, $\alpha_u$ and $\alpha_v$ are calculated using
the fitted cross-over points $u_1$, $u_2$, $v_1$, and $v_2$
in the U1, U2, V1, and V2 planes, respectively, as follows:
\begin{eqnarray}
\tan\alpha_u &=& \frac{u_2 - u_1}{d_u}
\label{eq:alueq}\\
\tan\alpha_v &=& \frac{v_2 - v_1}{d_v},
\label{eq:alveq}
\end{eqnarray}
where $d_u$ and $d_v$ are the separations of like planes, as
illustrated in Fig.~\ref{fig:vdc_frame}.
In general, $\tan \alpha_u$ and $\tan \alpha_v$ will be
close to the local cluster slopes $\tau_u$ and $\tau_v$
(cf., Sect.~\ref{sec:clusterfit} and Fig.~\ref{fig:vdccluster}).
In the multi-cluster analysis,
$\alpha_u$ and $\alpha_v$ are determined directly in the
global fit procedure (section \ref{sec:globalfit}) and are
not calculated according to eqs.\ (\ref{eq:alueq}) and (\ref{eq:alveq}).
The coordinates $u$ and $v$ in eqs.\ (\ref{eq:xeq}) and (\ref{eq:yeq}) are
given by
\begin{eqnarray}
u &=& u_1 \\
v &=& v_1 - d_{uv1}\tan\alpha_v,
\end{eqnarray}
where $d_{uv1}$ is the separation between the U1 and V1 planes.
If any VDC plane has no cluster at all, attempts are made to estimate the
track parameters from available local data in another plane.
For instance, if the U2
cluster is missing, then the global track angle $\alpha_u$
can be approximated by the available local angle in U1:
\begin{equation}
\tan \alpha_u = \tau_{u1}
\end{equation}
Similar replacements are made if other clusters are missing.
In this way, up to one missing $u$ and one missing $v$ cluster
can be tolerated at the expense of reconstruction precision.
This missing cluster substitution occurs only if no plane has more than
one hit --- it is not compatible with the multi-cluster analysis described
above.
Finally, ESPACE converts the VDC coordinates to
focal-plane coordinates, which are suitable as input for the target
reconstruction matrix multiplication. Focal-plane coordinates
as well as the target reconstruction formalism are discussed
in section~\ref{sec:approach}.
\subsection{Limitations}
\label{Limitations}
The chief shortcomings of the ESPACE software are its lack of flexibility,
maintainability, and to a lesser extent its lack of
speed and it heavy reliance
on legacy components such as CERNLIB, KUIP, and HBOOK. The first two issues
are of particular concern in view of planned detector upgrades
and reconfigurations in Hall A. The addition of new detectors and the
handling of multiple experimental configurations is not well supported
by ESPACE and would require a significant effort to implement.
The most significant limitation of the tracking algorithm is
its inability to handle overlapping clusters of hits, even though
sufficient information to analyze such clusters is in principle available
due to the use of multi-hit TDCs. In the present implementation,
ESPACE has no provision for handling this situation.
Without special processing, overlapping clusters often
corrupt the tracking information.
Such events are not analyzable, resulting in a tracking inefficiency.
The magnitude of this inefficiency
is difficult to estimate, however, because ESPACE does not provide unambiguous
information as to which events were not analyzable due to overlapping
clusters or due to other reasons, nor are overlapping clusters even identified.
This has prompted experiments that have taken high-rate data to
discard multi-cluster events altogether in the analysis.
The ratio of multi-cluster
events to single-cluster events is well defined, and so the
inefficiency due to omitting multi-cluster events can be readily
calculated.
\subsection{New Developments}
To address many of the shortcomings of ESPACE, an effort is
currently underway in Hall A to develop new analysis software
using a flexible and highly maintainable
object-oriented design implemented in C++~\cite{hallaroot}.
The new analyzer is based on the ROOT system~\cite{root}, an
object-oriented framework that has been under development at CERN
since 1995 and has been adopted widely in the nuclear and particle
physics community and elsewhere. The new analysis software
is currently under active development and will
be described in a future publication.