%
%  Modifications for the JES fits.  16 March 2005   Pekka
%
\section{Top Quark Mass Fitting}
\label{sec:fitting}

%Pekka: The two-dimensional distribution of reconstructed top quark mass and
%dijet invariant mass for a particular Monte Carlo sample is referred to as
%a template.
The distribution of reconstructed mass (either \mreco or \mjj)
for a particular top quark mass (or background process)
and jet energy scale is referred to as a template.
We compare the reconstructed top quark mass distribution and
the dijet mass distribution from data to the Monte Carlo templates
to measure simultaneously the top quark mass and the jet energy scale.
First, probability density functions (p.d.f.'s) for the reconstructed
top quark and dijet masses are determined for signal events and
background events in each subsample by fitting a functional form
to the corresponding templates; the signal p.d.f.'s depend on
the true top quark mass and jet energy scale.
The shift in jet energy scale is given by \jes, which is the relative
shift in the jet energy scale in units of the nominal uncertainty in
the jet energy scale derived from the extrinsic calibration procedures
(Section~\ref{ssec:jetSyst}).
Although the jet energy scale uncertainty varies with jet momentum
and pseudorapidity, a one unit
shift in the \jes parameter is approximately equivalent to a 3\%
shift in the jet energy scale for jets in \ttbar events.
We perform an unbinned likelihood fit to determine the values
of the top quark mass and jet energy scale that best describe the data.
At the end of this section, we describe a number of checks of the method using
simulated events.

\subsection{Parameterization of Signal and Background Shapes}
\label{ssec:parameterization}

Since templates are available only at discrete values of
true top quark mass and jet energy scale, the signal reconstructed mass
distributions in each subsample are parameterized by a flexible functional form as a
function of true top quark mass and jet energy scale in order to smooth
the distributions and interpolate between the templates.

For background
events, the parameterization has no dependence on top quark mass or jet
energy scale; a single p.d.f.\ is used to describe each background
reconstructed mass shape in each subsample.
In principle, a shift in the jet energy scale will change the shape of the
background templates.  However, we have determined from studies of the
background that the shape of the background templates are insensitive to the
jet energy scale.  Rather, the overall rate of background events does
show some sensitivity to the jet energy response, and this uncertainty
is incorporated into the uncertainty in the rate of background events
in the sample.
\note{Clarify that we don't include the correlation btw \jes and $n_b$?}

The same parameterizations are used for both \mreco and \mjj signal p.d.f.'s,
although of course the fitted parameters are different. In the case of the
background, different functional forms are required to fit well the \mreco
and \mjj templates.

\subsubsection{Signal shape parameterization}
\label{sssec:signalparam}

Signal templates are produced using sets of Monte Carlo samples with
the input top quark mass at 2.5--5 $\gevccnoarg$ intervals from
\gevcc{130} to \gevcc{230} and the jet energy scale varying from
$-3.0$ to $+3.0$ in steps of 0.5.
Examples of the template shapes from each event
category are given in \fig{f:sampletemp} (\mreco)
and \fig{f:samplemjjtemp} (\mjj).
\Tab{t:sampletemps} shows the evolution of the mean, most
probable value, and RMS of the reconstructed top quark mass templates
as a function of true top quark mass using selected
generated mass samples and the nominal jet energy scale.

\begin{table}
\caption[Signal template evolution.]
{The evolution of the \mreco template parameters is demonstrated using selected
signal Monte Carlo samples with generated top quark mass of $\gevcc{145}$,
$\gevcc{165}$, $\gevcc{185}$, and $\gevcc{205}$, with the nominal jet
energy scale. The mean, most probable value (MPV),
and RMS of the template are given for each subsample in
each generated mass.
\note{Do we want something similar for \mjj vs \mtop or vs \jes?}
}
\label{t:sampletemps}
\begin{ruledtabular}
\begin{tabular}{lcdddd}
  & $\mtop$ &
  \multicolumn{1}{c}{\twotag} &
  \multicolumn{1}{c}{\onetagt} &
  \multicolumn{1}{c}{\onetagl} &
  \multicolumn{1}{c}{\zerotag} \\
\hline
                & 145 & 151.5 & 155.1 & 147.1 & 163.9 \\
Mean            & 165 & 164.5 & 166.5 & 158.8 & 174.3 \\
$(\gevccnoarg)$ & 185 & 178.2 & 179.1 & 171.1 & 185.3 \\
                & 205 & 193.5 & 190.5 & 182.7 & 194.2 \\
\hline
                & 145 & 144.5 & 144.0 & 140.7 & 145.0 \\
MPV             & 165 & 163.8 & 159.5 & 156.5 & 159.3 \\
$(\gevccnoarg)$ & 185 & 179.9 & 178.1 & 171.7 & 179.5 \\
                & 205 & 198.5 & 194.7 & 185.4 & 193.9 \\
\hline
                & 145 & 25.1 & 31.7 & 28.5 & 39.2 \\
RMS             & 165 & 24.8 & 31.8 & 28.6 & 39.1 \\
$(\gevccnoarg)$ & 185 & 27.1 & 32.3 & 32.1 & 37.7 \\
                & 205 & 28.6 & 33.6 & 34.1 & 37.7 \\
\end{tabular}
\end{ruledtabular}
\end{table}

%From these templates are derived p.d.f.'s that are a smoothly
We derive from these distributions parametrized templates that are a smoothly
varying function of true top quark mass and jet energy
scale.
For any given true top quark mass and jet energy
scale, the probability to observe a particular reconstructed mass is specified
by a function consisting of two Gaussians---intended to account for the
well reconstructed quantities---plus the integrand of the Gamma
function---intended to account for cases where the incorrect jets are used
to reconstruct the top quark or $W$ masses.
%The second Gaussian is not well motivated a priori, but
%was added to the parameterization in order to
%fit better the large statistics Monte Carlo samples.
The 9 parameters necessary to specify this combination of functions
are themselves assumed to depend linearly on the true top quark mass and
jet energy scale, so that the full set of p.d.f.'s is specified by 27
%jet energy scale, so that the full set of templates is specified by 27
parameters. This assumed functional form works well in the limited
range of top quark masses and jet
energy scales considered; as an example, letting the nine
parameters have quadratic dependence on \mtop or \jes does not improve
the fit. Thus the parameterization is as follows:
\begin{eqnarray}
\label{e:sigparam}
\lefteqn{P_{s}(m;\mtop,\jes)=} \nonumber \\
&&\alpha_{7} \cdot \frac{\alpha_{2}^{1 + \alpha_{1}}}
	{\Gamma(1 + \alpha_{1})}
	\cdot (m - \alpha_{0})^{\alpha_{1}} e^{-\alpha_{2} (m - \alpha_{0})}
	\nonumber \\
&+& \alpha_{8} \cdot
	\frac{1} {\alpha_{4}\sqrt{2\pi}} \cdot
	e^{\frac{-(m-\alpha_{3})^{2}} {2\alpha_{4}^{2}}} \nonumber \\
&+& (1 - \alpha_{7} - \alpha_{8}) \cdot
	\frac{1} {\alpha_{6}\sqrt{2\pi}} \cdot
	e^{\frac{-(m-\alpha_{5})^{2}} {2\alpha_{6}^{2}}};
\end{eqnarray}
where
\begin{equation*}
\alpha_{i} = p_{i} + p_{i+9} \cdot (\mtop-175) + p_{i+18} \cdot (\jes).
\end{equation*}
The variable $m$ in $\gevccnoarg$ refers to the reconstructed top quark
or dijet mass, \mtop in $\gevccnoarg$ refers to the true top quark mass,
and \jes refers to the true shift in the jet energy scale from that
determined from our calibrations.
%The p.d.f.'s
These template parametrizations are normalized so that, for a given true
top quark mass \mtop and jet energy scale \jes, the
integral over all reconstructed masses $m$ is unity.

A binned likelihood fit is used to determine the 27 parameter values
both for the \mreco templates and for the \mjj templates.
The \chisq is calculated between the MC samples and the
prediction from the fit, after rebinning to ensure that each bin
has at least five predicted events.  The resulting \chisq
values are given in \tab{t:parfits}, along with the
number of degrees of freedom. Although the corresponding
probabilities are small, due to the large statistics of
the templates, the fit matches the template shapes quite well.
In \fig{f:fitvis}, four signal templates
at varying generated masses are shown overlaid with the fitted
parameterization evaluated at each true mass. This figure
exhibits the changing shape of the reconstructed mass
templates as a function of true mass. \Fig{f:fitmjjvis} shows the
\mjj templates with varying jet energy scale, overlaid with the
fitted parameterization. One sees that the location of the
$W$ boson peak is sensitive to the jet energy scale.

\begin{cfigure}
\includegraphics{plots/toptemplates_prd3}
\caption[Four \mreco templates at different masses, with fits overlaid.]
{Four \mreco signal templates for the \onetagt
sample are shown, with top quark masses ranging from
\gevcc{145} to \gevcc{205} and with \jes set to 0. Overlaid are the fitted
parameterizations at each generated mass, taken from the full
parameterization given in Eq.~\ref{e:sigparam}.}
\label{f:fitvis}
\end{cfigure}

\begin{cfigure}
\includegraphics{plots/wtemplates_prd4}
\caption[Four \mjj templates at different jet energy scales, with fits overlaid.]
{Four \mjj signal templates for the \twotag sample are shown,
with \jes values ranging from \sigunit{-3} to \sigunit{3} and
with the true top quark mass set to \gevcc{180}.
Overlaid are the fitted parameterizations at each value of
jet energy scale, taken from the full parameterization
given in Eq.~\ref{e:sigparam}.}
\label{f:fitmjjvis}
\end{cfigure}

\subsubsection{Background shape parameterization}
\label{sssec:bkgdparam}

Monte Carlo simulations of the various processes listed in
section~\ref{ssec:backgrounds} are used to model the reconstructed
top quark mass shape and dijet mass shape for background
processes. When possible, due to limited computing resources, a single
large-statistics sample is used to represent several background processes.

For the tagged backgrounds, the $W$ + heavy flavor
processes ($W\bbbar$, $W\ccbar$, $Wc$) all have similar reconstructed
mass shapes, as shown in \fig{f:bkgdcomp} for \mreco in the \onetagt
sample, and thus are all modeled
with a high-statistics $W\bbbar$ simulated sample.
$WW$ and $WZ$ events, a negligible contribution to
the total expected background, are also included in this category.
The shapes for the three subsamples with tagged events are found by
reconstructing the simulated events exactly as is done for the data
and signal Monte Carlo. Similarly, the simulated s- and t-channel
single top quark events are used to obtain corresponding mass templates.

\begin{cfigure}
\includegraphics{plots/mtop_wbb-cc-c_prd}
\caption[Plot comparing Wbb, Wcc, Wc templates.]
{The templates for $W\ccbar$ and $Wc$ background processes
are compared to the high-statistics $W\bbbar$ template for
all tagged events. The agreement is good in both cases,
so the $W\bbbar$ template is used to represent all $W$ + h.f.\
processes.
\note{This plot needs some more prettification?
Reconstructed Mtop to \mreco;
fraction to $\text{Fraction}/\gevcc{5}$;
remove CDFR2P;
smaller $x$ range;
move legend to top right corner;
etc.}
}
\label{f:bkgdcomp}
\end{cfigure}

The mass templates for the \wjets backgrounds in the tagged
subsamples, i.e.\ ``mistags,'' are not obtained using
the Monte Carlo $b$ tagging, which is not expected to model well the rate
or kinematic dependences of fake tags. Instead, a mistag matrix, derived
from the data, is used to give the probability for
a jet to be falsely tagged as a function of its $\et$, $\phi$, $\eta$,
number of tracks, and the $\Sigma\et$ for all jets in the event.
Then for each simulated event ($W$ + 4 partons, generated by ALPGEN
and showered by HERWIG), every possible tag configuration on
the leading four jets is considered. For every tag configuration,
the fit with lowest \chisq among the jet-quark assignments
consistent with the assumed tags is selected, and the appropriate mass
template is filled with a weight corresponding to the probability of
observing that set of tags. The result is a weighted template for the
mistag backgrounds.

%The most elusive background comes
The backgrounds that are least amenable to Monte Carlo modeling arise
from QCD background events, i.e.\ events with no real $W$ to produce the
isolated lepton and
$\met$. These events are difficult to simulate, but can be studied by
selecting events in the data with non-isolated leptons, which are enriched
in this type of background, but kinematically similar to events chosen
in the default selection.

The mass reconstruction described in Section~\ref{sec:massRecon} is
expected to produce similar results for QCD background events and
\wjets background events. This is because the leptonic $W$ system, in
which these types of events differ, does not have a strong effect on the
mass reconstruction, since \met is poorly measured and since the $W$ mass
is constrained in the \chisq expression. In the kinematic properties of
the jets, to which the mass reconstruction is very sensitive, these two
types of events are similar since in both cases the jets arise
from hard QCD radiation.

Indeed, within the limited statistics available,
%\fig{f_qcdbkgd} and \fig{f_qcdmjjbkgd} show that
the reconstructed mass distributions of the
QCD-enriched data events are consistent with those of simulated \wjets events.
%On the left in \fig{f_qcdbkgd},
%the \onetagt events are compared, and on the right, the \onetagl
%events are compared with the combined mistag template. The shapes
%appear similar.
%A KS test gives a probability of 2.6\%
%for the \zerotag events.
%\note{... and 0\% for the tagged events?}
\note{Add the multijet trigger study?}
Given these similarities, the $W$ + jets reconstructed mass
templates are used also for the expected contributions from QCD for both
the reconstructed top quark mass and the dijet invariant mass.
An additional check, treating the subset of QCD events where the primary
lepton is a jet misidentified as an electron, is performed using a large
QCD-dominated dataset with at least five jets. One jet with a large
fraction of its energy in the electromagnetic calorimeter is assigned to
``fake'' an electron, and the mass reconstruction proceeds under that
hypothesis. Again reasonable agreement is found between the reconstructed
mass distributions of these events and those of simulated \wjets events.
A systematic uncertainty on the background modeling
(see Section~\ref{ssec:otherSyst}) is assigned using the differences
between the templates obtained from these three samples:
\wjets events, events with non-isolated leptons, and events with one
jet assigned to ``fake'' an electron.

%\begin{cfigure}
%\includegraphics[width=.48\columnwidth]{plots/mtop_non-iso0_2-w4p_v8-mass1tag4}
%\includegraphics[width=.48\columnwidth]{plots/mtop_non-iso0_2-w4p_v8-mass1tag35}
%\caption[Comparison between tagged \mreco $W$ + jets templates and QCD templates
%modeled by data events with non-isolated leptons.]
%{$W$ + jets background templates (histograms) and data events
%with non-isolated leptons (points) are compared. The latter
%are enriched in non-$W$ (QCD) background. At left,
%the \onetagt events are compared, and at right,
%the \onetagl events.
%\note{Fix these plots and descriptions.}
%}
%\label{f_qcdbkgd}
%\end{cfigure}
%
The background for the \zerotag subsample is treated separately from
the others. The dominant process is $W$ + jets, with a smaller
($\sim20\%$) contribution from non-$W$ (QCD) events.
%As shown in \fig{f_qcdbkgdnotag},
%The reconstructed mass shapes for events in the data with
%non-isolated leptons matches well the simulated $W$ + jets template.
Since we model the reconstructed mass of QCD events using \wjets events,
the entire \zerotag background shape comes from $W$ + 4 parton
Monte Carlo events, simulated by ALPGEN and showered by HERWIG.

%\begin{cfigure}
%\includegraphics[width=.48\columnwidth]{plots/mtop_non-iso0_2-w4p_v8-mass0tag}
%\raisebox{.15\columnwidth}{\framebox[.48\columnwidth][c]{\note{Insert \zerotag \mjj comparison plot here.}}}
%\includegraphics[width=.48\columnwidth]{plots/mjj_non-iso0_2-w4p_v8-mass0tag}
%\caption[Comparison between \zerotag \mjj $W$ + jets templates and QCD templates
%modeled by data events with non-isolated leptons.]
%{$W$ + jets background templates (histograms) and data events
%with non-isolated leptons (points) are compared. The latter
%are enriched in non-$W$ (QCD) background. At left,
%the \zerotag \mreco distributions are compared, and at right,
%the \zerotag \mjj distributions.
%\note{Fix these plots and descriptions.}
%}
%\label{f_qcdbkgdnotag}
%\end{cfigure}
%
We do not allow the normalization of each background contribution
to vary independently in the final likelihood fit. Instead, for
each subsample, the templates from all background processes are
combined in their expected ratios according to
\tab{t:backgroundnumber}. A single function is fitted to the
combined background for each subsample and is used to describe
the background shape in the final likelihood fit
(section~\ref{ssec:likelihood}). The overall background
normalization for each subsample is then permitted to vary,
within its constraint where applicable.
%, but not the relative contributions from each process.

We determine the p.d.f.'s for the background reconstructed top quark
mass templates using a parameterization similar in spirit to that of
the signal, but simpler in form. First, there is no dependence on top
quark mass or jet energy scale.
\note{Clarify about small dependence on \mtop through single top?}
Second, no narrow Gaussian peak is expected, so the full shape
is modeled by the integrand of the Gamma function. Specifically,
\begin{equation}
\label{e_bgparam}
P_{b}(\mreco) = \frac{p_{2}^{1 + p_{1}}} {\Gamma(1 + p_{1})}
	\cdot (\mreco - p_{0})^{p_{1}} e^{-p_{2} (\mreco - p_{0})}.
\end{equation}
In the case of the \zerotag background events, a slightly
more sophisticated function is used to achieve a good fit:
\begin{eqnarray}
\label{e_bgparamzerotag}
\lefteqn{P_{b}(\mreco)=} \nonumber \\
&&  p_{6} \frac{p_{2}^{1 + p_{1}}} {\Gamma(1 + p_{1})}
	\cdot (\mreco - p_{0})^{p_{1}} e^{-p_{2} (\mreco - p_{0})} \\ \nonumber
&+& (1-p_{6}) \frac{p_{5}^{1 + p_{4}}} {\Gamma(1 + p_{4})}
	\cdot (\mreco - p_{3})^{p_{4}} e^{-p_{5} (\mreco - p_{3})}.
\end{eqnarray}

In the background events, the following parameterizations are used
to fit the reconstructed dijet mass templates. For the background
samples with $b$ tags,
\begin{eqnarray}
\label{e_bgparamtag_wjj}
P_{b}(\mjj) &=& \alpha_{5} \cdot \frac{\alpha_{2}^{1 + \alpha_{1}}}
        {\Gamma(1 + \alpha_{1})}
        \cdot (\mjj - \alpha_{0})^{\alpha_{1}} e^{-\alpha_{2} (\mjj - \alpha_{0})}
        \nonumber \\
&& + (1 - \alpha_{5}) \cdot
        \frac{1} {\alpha_{4}\sqrt{2\pi}} \cdot
        e^{\frac{-(\mjj-\alpha_{3})^{2}} {2\alpha_{4}^{2}}},
\end{eqnarray}
and for the \zerotag sample,
\begin{eqnarray}
\label{e_bgparamnotag_wjj}
P_{b}(\mjj) &=& \alpha_{7} \cdot \frac{\alpha_{2}^{1 + \alpha_{1}}}
        {\Gamma(1 + \alpha_{1})}
        \cdot (\mjj - \alpha_{0})^{\alpha_{1}} e^{-\alpha_{2} (\mjj - \alpha_{0})}
        \nonumber \\
&& + \alpha_{8} \cdot
        \frac{1} {\alpha_{4}\sqrt{2\pi}} \cdot
        e^{\frac{-(\mjj-\alpha_{3})^{2}} {2\alpha_{4}^{2}}} \nonumber \\
&& + (1 - \alpha_{7} - \alpha_{8}) \cdot
        \frac{1} {\alpha_{6}\sqrt{2\pi}} \cdot
        e^{\frac{-(\mjj-\alpha_{5})^{2}} {2\alpha_{6}^{2}}}.
\end{eqnarray}
\note{Do we really want to have all these here? Eliminate some or all?
Or add more discussion?}

The final background templates for the reconstructed top quark mass and
dijet mass for the four subsamples are shown in \fig{f:bkgdtemps} and
\fig{f:bkgdmjjtemps}, respectively, overlaid with the fitted
parameterization.
\note{Clarify that sanity checks show fits OK.}

\begin{table}
\caption[Parameterization fit information.]
{The \chisq and number of degrees of freedom are given for the signal
parameterization fits in each of the four subsamples.
\note{Do we want to add for background template fits as well?}
\note{Or just remove this table and make the point for both that the
sanity checks check the parameterization as well.}
}
\label{t:parfits}
\begin{ruledtabular}
\begin{tabular}{cccc}
\twotag & \onetagt & \onetagl & \zerotag \\
\hline
\multicolumn{4}{c}{\chisq/n.d.o.f.\ for reconstructed top quark mass
(Eq.~\ref{e:sigparam})} \\
$13977/13081$ & $18736/17052$ & $14209/13444$ & $18791/16752$ \\
\hline
\multicolumn{4}{c}{\chisq/n.d.o.f.\ for dijet mass
(Eq.~\ref{e:sigparam})} \\
$19541/17000$ & $29410/25732$ & $23506/19827$ & $38315/30510$ \\
\end{tabular}
\end{ruledtabular}
\end{table}

\begin{cfigure}
\includegraphics{plots/topbkgdtemp_prd}
\caption[Reconstructed top quark mass distributions for background.]
{Reconstructed top quark mass distributions of the combined backgrounds
in each subsample.
The contributions from different background templates are shown
stacked; overlaid are the fitted curves (see Eq.~\ref{e_bgparam}
and Eq.~\ref{e_bgparamzerotag}).}
\label{f:bkgdtemps}
\end{cfigure}

\begin{cfigure}
\includegraphics{plots/wbkgdtemp_prd}
\caption[Reconstructed dijet mass distributions for background.]
{Reconstructed dijet mass distributions of the combined backgrounds
in each subsample.
The contributions from different background templates are shown
stacked; overlaid are the fitted curves (see Eq.~\ref{e_bgparamtag_wjj}
and Eq.~\ref{e_bgparamnotag_wjj}).}
\label{f:bkgdmjjtemps}
\end{cfigure}

\subsection{Likelihood Fit for Top Quark Mass}
\label{ssec:likelihood}

The reconstructed mass distributions from data are
simultaneously compared to the templates
from signal and background sources using an unbinned
extended likelihood fit.
The likelihood involves parameters for the expectation values of
the number of signal and background events in each subsample,
and for the true top quark pole mass and jet energy scale.
For each subsample, the likelihood is given by:
\begin{equation}
{\mathcal L_{\text{sample}}} =
 			\lshapemreco \times \lshapemjj \times \lnev \times \lbg,
\end{equation}
where
\begin{eqnarray}
\lshapemreco &=& \prod_{k=1}^{r^W} \frac{\epsilon_s
n^W_{s}P_{s}(m^{t}_{k};\mtop,JES) +
                         \epsilon_b n^W_{b}P_{b}(m^{t}_{k})}{\epsilon_s
n^W_{s}+\epsilon_b n^W_{b}}; \nonumber \\
\lshapemjj &=& \prod_{k=1}^{r^W\cdot n^{c}_i}
\frac{n^W_{s}P_{s}(m^{jj}_{k};\mtop,JES) +
                         n^W_{b}P_{b}(m^{jj}_{k})}{n^W_{s}+n^W_{b}}; \nonumber \\
\lnev &=& \sum_{r^W_s+r^W_b=r^W} P_{\text{Pois}}(r_s^W; n_s^W)
P_{\text{Pois}}(r_b^W; n_b^W) \times \nonumber \\
 & & \left [\sum_{r^t_s+r^t_b=r^t}^{r_{s,b}^t \le r_{s,b}^W}
\!\!\!\!P_{\text{Bin}}(r_s^t; r_s^W, \epsilon_s) P_{\text{Bin}}(r_b^t; r_b^W, \epsilon_b)
\right ]; \nonumber \\
\lbg &=& \exp{ \left( -\frac{(n^W_{b}-n^W_{b}(\text{const}))^2}
                               {2\sigma_{n^{W}_{b}}^{2}} \right)}.
\end{eqnarray}

\note{Needs a lot better explanation here.}
\note{EMB: Go through and understand this likelihood!}
The most information on the true top quark mass is provided by the
products in \lshapemreco, the $i$th term of which gives the
probability of observing the $i$th data event with reconstructed mass
$m_i$, given the background template,
$P_{b}(m_i)$, and the signal template with a true top quark mass of
\mtop and energy scale shift \jes, $P_{s}(m_i;\mtop, \jes)$.
\note{Need to explain second term!}
The third term represents the information arising from the number of
signal and background events in the top quark mass and dijet mass samples,
which are correlated.  We denote the number of expected signal and
background events in the
$W\rightarrow jj$\ sample, $n_s^W$\ and $n_b^W$, respectively. The
expected numbers of signal and background events in the \mreco sample
are given by $\epsilon_s n_s^W$\ and $\epsilon_b n_b^W$, respectively,
where the two parameters $\epsilon_s$\ and $\epsilon_b$\ represent the
efficiency of the \chisq cut for signal and background events
(given in \tab{t:massRecoMC}).  The third term
in the likelihood, \lnev, expresses the likelihood
associated with observing $r_W$\ and $r_t$\ events in the two samples
given the expected number of events and the expected efficiencies.  The
first sum expresses the Poisson probability to observe $r_s^W$\ signal
and $r_b^W$\ background events given Poisson means of $n_s^W$\ and
$n_b^W$, respectively.  The sum in the third term is over the sum of
those signal and background events that equal the observed number of
events in the \mjj sample:  $r_s^W + r_b^W = r^W$.  For each pair in
this sum, we then include the binomial probability to observe $r_s^t$\
signal events and $r_b^t$\ background events in the $m_t$\ sample given
the numbers of observed events in the \mjj sample and the \chisq cut
efficiencies.  The second sum in the \lnev is over the pairs of signal
and background events in the $m_t$ sample that equal the observed
number of events: $r_s^t + r_b^t = r^t$.  

The background normalizations are constrained in the likelihood fit by
Gaussian terms with the form of \lbg. The background normalizations
are constrained for the \twotag, \onetagt, and \onetagl samples.
For the \zerotag subsample, no prior background normalization
estimate is available, so no background constraint is used.
Both $n_s$ and $n_b$ are required to be greater than zero.

As described in Sections~\ref{ssec:jetSyst} and~\ref{ssec:jes},
independent detector calibrations and studies of other processes allow us
to independently determine the jet energy scale $\jes$, and this
information is used in the reconstruction of the data events and in the
determination of the signal templates.  We include in the likelihood fit
the knowledge of this independent jet energy calibration through a 
likelihood defined by a Gaussian constraint
\begin{eqnarray}
\ljes &=& e^{-\frac{(\jes-\jes^{exp})^2}
			 {2\sigma_{\jes}^{2}}} \\
  &=& e^{-\frac{\jes^2}{2}},
\end{eqnarray}
where the simplification arises because by definition the measured shift in
energy scale, $\jes^{exp}=0$\ and the uncertainty $\sigma_{\jes}=1.0$.

The total likelihood is given by the product of the likelihoods for
the four subsamples and the jet energy scale constraint:
\[\mathcal{L} = \mathcal{L}_{\text{\twotag}}  \times
								\mathcal{L}_{\text{\onetagt}} \times
								\mathcal{L}_{\text{\onetagl}} \times
								\mathcal{L}_{\text{\zerotag}} \times
								\ljes. \]
The top quark pole mass \mtop and jet energy scale \jes are shared
between the four likelihoods and are free parameters in the fit. 
The likelihood is maximized with respect to all ten parameters
($n_s$ and $n_b$ for four subsamples, \jes, and \mtop) using
the MINUIT package. A likelihood curve as a function of \mtop is
found by maximizing the likelihood with respect to all other parameters
for a series of fixed \mtop. The statistical uncertainty from the fit
procedure is taken from the points $\mtop^+$ and $\mtop^-$ where
the negative log-likelihood changes by $+1/2$ unit from its minimum. The
positive and negative uncertainties are then scaled to achieve 68.3\%
coverage of the true mass value as described below in
section~\ref{ssec:methodCheck}.

%We can also obtain a refinement in our measurement of the jet energy
%scale by assuming a fixed $\mtop$\ and calculating confidence intervals
%for $\jes$.  This provides a direct test of the consistency of our
%independent jet energy scale determination with the $\mjj$\ distributions
%observed in the mass candidate sample.
%
%We note that since we fit for both $\mtop$ and $n_{s}$, the
%expectation value of the number of signal events, we could extract the
%top mass and the $\ttbar$ cross-section simultaneously (given the
%efficiency of our $\chisq$ cut on signal events, plus various other
%quantities already available).  It would be interesting to do this
%exercise and see the cross-section value we observe, as well as its
%correlation with the top mass.

\subsection{Method Check}
\label{ssec:methodCheck}

The method described above is checked for any possible systematic
biases by running large numbers of ``pseudoexperiments,'' where we
create, using Monte Carlo simulation, samples of
signal and background events with an assumed value of the true top
quark mass and jet energy scale and with the same statistical properties
as our observed sample.  We then perform likelihood fits to each
pseudoexperiment and characterize the accuracy of the technique in
determining the true values.

For each pseudoexperiment, first the number of signal and background events
is determined, then a reconstructed top quark mass and dijet mass are
generated for each event. The number of background events in each
subsample is Poisson fluctuated around the central value given in
\tab{t:backgroundnumber}. 
The number of signal events is Poisson fluctuated around the number
observed in the data, minus the central value for the background
expectation, for each subsample.
For each event, reconstructed masses \mreco and \mjj are selected
at random from the templates corresponding to signal or background
processes. Some of the events are eliminated from the \mreco sample,
according to the \chisq cut efficiencies given in \tab{t:massRecoMC}.
The resulting list of reconstructed masses is fit using exactly the
same machinery used on the data, described in section~\ref{ssec:likelihood}.
Although this default procedure does not model correlations among the
\mreco and \mjj values in each event, a separate check showed a complete
modeling of the correlations to have a negligible effect on the checks
described here.

For each pseudoexperiment, the likelihood fit provides a measured
top quark mass \mtop and jet energy scale \jes, as well as positive and
negative errors (\errp and \errm) for each from the $\Delta\ln L=+1/2$
procedure. The pulls of the
measurement are checked using the symmetrized errors, where the
uncertainty on the top quark mass is taken to be $0.5(\mterrp+\mterrm)$.
A pull distribution is generated for each of 12 input values for
the top quark mass, keeping \jes fixed to zero, where 2500
pseudoexperiments are generated for each input mass value, and each pull
distribution is fitted using a Gaussian function.
We determine a similar set of pull distributions for various values of
the \jes parameter, keeping the true top quark mass fixed to \gevcc{175},
although the results in this case are correlated since they all
use the same Monte Carlo event sample.
The mean and sigma of the fitted functions are shown in \fig{f:pulls}.

\begin{cfigure}
\includegraphics[width=.48\columnwidth]{plots/pullmean_vs_mass_mtop_jes0_101_prd}
\includegraphics[width=.48\columnwidth]{plots/pullmean_vs_jes_mtop_mass175_101_prd}
\includegraphics[width=.48\columnwidth]{plots/pullwidth_vs_mass_mtop_jes0_101_prd}
\includegraphics[width=.48\columnwidth]{plots/pullwidth_vs_jes_mtop_mass175_101_prd}
\caption[Pull distribution means and widths for measured \mtop vs \mtop and \jes.]
{The mean (top) and width (bottom) of pull distributions from sets of 2500
pseudoexperiments are shown. On the left, the jet energy scale is fixed at its
nominal value, and the generated top quark mass is varied from \gevcc{150} to
\gevcc{210}. On the right, the top quark mass is fixed at \gevcc{175}, and the
input jet energy scale is varied from \sigunit{-3} to \sigunit{3}.
The error bars come mostly from the limited statistics of the Monte Carlo
samples from which the pseudodata is taken.
\note{Want \mtop pull dist.\ mean, not \mtop mean pull dist., sim.\ for width?}}
\label{f:pulls}
\end{cfigure}

In the pull distributions as a function of top quark mass, the pull
means show a small offset for this particular slice of the \mtop-\jes
plane. That offset is taken as a systematic uncertainty on the measurement.
In addition the pull widths are slightly larger than one.
The inflation of the pull widths is due to the modest statistics of the
event sample. For a small number of events, and for templates
such as the ones described in section~\ref{ssec:parameterization}, the resulting
likelihood curve is typically non-Gaussian, and in fact, typically
shallower than Gaussian. This likelihood shape, using any definition of
the measurement error, in turn provokes non-Gaussian
tails in a pull distribution, which lead to a fitted pull width greater
than one. The pull distributions become more Gaussian (with
width one) as pseudoexperiments with more events are performed. With ten
times the statistics, the pull widths are consistent with unity.

For the current data sample, the quoted measurement with
uncertainties is designed to have pull width equal to one
by scaling the errors taken from $\Delta\ln L=+1/2$. The scale factor
is the pull width from the lower left plot of \fig{f:pulls}, averaged
over the values of true top quark mass, giving 1.027.

%The statistical errors from the ensembles of pseudoexperiments at various
%top quark masses are depicted in \fig{f:expstaterr}. The mean, median,
%68th percentile, and 90th percentile of the symmetrized error are
%plotted as a function of the input top quark mass. The expected
%statistical error increases with the top quark mass, but the fractional
%uncertainty decreases.
%\note{True or false? No scaling of the errors is performed in this plot.}
%
%\begin{cfigure}
%\includegraphics{plots/errors_vs_mass}
%\framebox{\parbox[c][.7\width][c]{.7\columnwidth}{
%\note{Insert expected stat error plots here.}
%}}
%\caption[Expected statistical errors vs input top quark mass.]
%{The mean, median, 68th percentile, and 90th percentile of the
%symmetrized statistical errors from 10,000 pseudoexperiments are
%shown as a function of the input top quark mass.
%\note{Need current plot from JF!!! Mean and median only.}
%\note{Does it even make sense to show this plot??}
%}
%\label{f:expstaterr}
%\end{cfigure}
