\chapter{Event Selection}
	\label{chapter_event_selection}
\section{Description of Data Sample}
	\label{section_description_of_sample}
	The data in this thesis were collected during the years 2004 to 2007.  During this time, HERA provided collisions between protons and longitudinally polarized electrons (2005-2006), and between protons and longitudinally polarized positrons (2004, 2006-2007).  The luminosity collected versus lepton polarization is depicted in figure~\ref{figure_datasample_polarization}.  Because several depolarizing effects existed, and these could not be precisely controlled, the lepton beam polarization varied substantially from run to run, and was always below the theoretical maximum of 92.4\%~\cite{beckmann-2002-479}.  The absolute value of the observed value was almost always below 50\%, with a luminosity-weighted average of -27\% and +30\% (-37\% and +32\%) for left- and right-handed $e^-p$ ($e^+p$) data, respectivley.  The luminosity collected for left- and right-handed $e^-p$ ($e^+p$) collisions was $106~\pb^-1$ and $74~\pb^-1$ ($77~\pb^-1$ and $102~\pb^-1$), respectivley.

\begin{figure}
	\begin{center}
		\includegraphics[draft=false, width=1.\textwidth]{/home/hwolfe/thesis/thesis_plots/polarization_plot}
	\end{center}
	\label{figure_datasample_polarization}
		\caption[Luminosity vs. Lepton Polarization]{
			\fixspacing{Luminosity vs. lepton polarization for data used in this analysis.  The upper figure depicts data using electron-proton collisions only, while the lower depicts that for positron-proton collisions.  Total integrated luminosity for each type of collision is stated in the legend, and the luminosity-averaged polarization is shown with vertical lines.}
		}
\end{figure}

\section{Online Event Selection}

	As described in section~\ref{section_zeus_trigger}, event selection during data taking was performed via a three level trigger system.  As events were produced in the ZEUS detector, The trigger system was responsible for the decision to offload, reconstruct, and store  event data from the detector.  The two concerns of trigger selection choice is that the selection be {\it efficient}, and {\it pure}.  Efficiency refers to the probability that a desired event was triggered, while purity refers to the probability that a triggered event was desired.  Thus, a balance was chosen between overly loose selection criteria which selected signal with additional background, and overly stringent criteria which rejected background at the cost of diminishing signal.

	Two independent trigger selections were used in this analysis, and are referred to throughout as the {\it principle} and {\it alternative}.  The principle trigger selection was used to extract the cross sections, while the secondary was used to understand the systematic uncertainty introduced from trigger choice and operation.  The principle selection has been previously tested and used in an inclusive HERA II CC DIS ZEUS publication~\cite{pl:b637:210}.  The alternative trigger selection is derived from a HERA I CC DIS Jets publication~\cite{epj:c31:149}.  The primary difference between then two is that the alternative selection required the presence of jets, while the principle selection made no such constraint.  The principle selection also heavily relied on tracking quantities, while the secondary relied more heavily on the calorimeter.

\subsection{First Level Trigger Selection}
	The core conditions of both the principle and alternative FLT selections is the presence of large $E_T$ in different subsections of the CAL, and the presence of CTD tracks which are consistent with $ep$ interactions.  The primary purpose of these requirements was to select $ep$ events without reading data from the detector for every bunch crossing. Both selections also rejected events if deposits and timing information was consistent with beam-gas interactions.
	
	For both selections, events were accepted by the FLT if the event had an $E_T$ greater than $30~\GeV$, and no beam-gas signature was seen as described in section~\ref{section_baby_analysis}.  Lower values of $E_T$ were required if a well reconstructed track was present, or if the energy deposit was not close to the beampipe. Events were also triggered if the $\ptmiss$ observed was $5$, $8$, $11.5~\GeV$, depending on various other calorimeter and tracking conditions. A detailed list of trigger bits and their physical meanings is given in appendix~\ref{section_flt_specifics}.  
\subsection{Second Level Trigger Selection}
	One challenge of designing a trigger selection for CC DIS is that the signature of large $\ptmiss$ and $E_T$ are also produced by beam-gas interactions.  beam-gas typically deposits its energy near the beam pipe, so it is useful to select events based on the $\ptmiss$ and $E_T$ not including these CAL cells.  Thoughout this chapter, $E_T(-2IR)$ ($E_T(-1IR)$,  $\ptmiss(-1IR)$) will refer to the transverse energy as measured by the CAL excluding the inner two rings (one ring) of cells closest to the beam pipe. The variable $\ngoodtracks$ refers to the number of ``good'' tracks in the sense that they are reliably reconstructed, and originate from an area near the nominal vertex. This definition is specific to the ZEUS CTD, and is based on the number and distribution of hits used in the track fit.  The requirement that the tracks come from near the nominal vertex helps differentiate between $ep$ interactions and beam-gas, because beam-gas events often have tracks originating far from $z=0$. In the principle SLT selection, events were required to satisfy the each of the following three conditions.
\begin{enumerate}
	\item Proper timing and number of hits in the CTD
	\item No deposits from off-momentum protons were detected
	\item At least one of the following:
		\begin{enumerate}
			\item $\ptmiss > 6~\GeV$ and $E_T(-2IR)>6~\GeV$ and $\ngoodtracks>1$
			\item $\ptmiss > 9~\GeV$ and $\ptmiss(-1IR)>8~\GeV$ and $E_{FCAL}>20~\GeV$
			\item $\ptmiss > 9~\GeV$ and $(\ptmiss)^2>2.31\times E_T$ and $E_{FCAL}>80~\GeV$
			\item $E-p_z > 6~\GeV$ and $(\ptmiss)^2>2.25\times E_T$ and $\ngoodtracks>1$
		\end{enumerate}
\end{enumerate}
Conditions 1 and 2 above attempt to reject non-$ep$ events.  Conditions 3a and 3b selected events with large $\ptmiss$ without being sensitive to beam-gas.  Condition 3c selected events with $\ptmiss$ large relative to the $E_T$ of the event.  This helped select CC DIS over PHP, as discussed in section~\ref{section_baby_analysis}.

The alternate selection required that all the following conditions were met:
\begin{enumerate}
	\item $\ngoodtracks > 1$ 
	\item $\ptmiss > 8~\GeV$
	\item $E_{T}(-1IR) > 8~\GeV$
	\item $\ptmiss/E_{T}> 0.3$
\end{enumerate}

In the above criteria, criteria 1 selected $ep$ events, while selection 2 and 3 selected CC DIS over NC DIS.  Selection 4 selected CC DIS over PHP.

A more detailed explanation of these criteria is given in table ~\ref{table_slt_conditionals}.
\subsection{Third Level Trigger Selection}
\label{section_third_level_trigger}

\begin{figure}
	\begin{center}
		\includegraphics[draft=false, width=.7\textwidth]{/home/hwolfe/thesis/figures/experimental/CAL_timing}
	\end{center}
		\caption[Schematic of CAL Timing Information]{
			\fixspacing{Schematic diagram of CAL timing information.  Major scenarios include: A) Events originating near the nominal vertex. B) Events originating outside the detector near the beam-pipe. C) Events originating outside the detector far from the beam pipe.}
		}
	\label{figure_cal_timing}
\end{figure}

	In this section, the term {\it up-down CAL time difference} is used to indicate the difference of the time in which CAL hits were recorded in the upper and lower halves of the CAL. Quantities comparing CAL timing information are useful quantity because events originating in the center of the detector have $t_{\mbox{\footnotesize up}} \approx t_{\mbox{\footnotesize down}}$ and $t_{\mbox{\tiny RCAL}} \approx t_{\mbox{\tiny FCAL}}$, as depicted in figure ~\ref{figure_cal_timing} A.  cosmic and halo muons enter the detector from outside, creating a different signature in these values, as depicted in figure~\ref{figure_cal_timing} B and C.

	The principle selection was satisfied if all of the following conditions were met:


\begin{enumerate}
		\item $\ptmiss>6~\GeV$
		\item $|z_{vtx}|<60~\cm$
		\item Up-down CAL time difference which was indicative of an interaction originating within the detector.  The events were rejected if the time difference exceeded 8~ns.
\end{enumerate}
	 The third condition compares the timing information from the upper and lower half of the calorimeter.  This condition rejected cosmic rays, which often come from above the ZEUS detector.  The event was also accepted if all of the following conditions were met
\begin{enumerate}
	\item $\ptmiss>6~\GeV$
	\item  $\left(E_{FCAL} > 10~\GeV~\|~ \ngoodtracks>0\right)$
	\item No particles lost from accellerated bunches were measured in the detector.
	\item If the reconstructed vertex was less than -80 cm from the nominal interaction point, or fewer than five tracks originating from a vertex exceeding -80cm from the nominal interaction region were observed
	\item If less than 25 tracks were observed, and at least 8 of these led to a vertex -80cm
	\item $\left(N^{\tiny \mbox{CTD}}_{\tiny \mbox{hits}}~<~2500~\| ~\ptmiss~>~10~\GeV\right)$
	\item Up-Down CAL time difference which was indicative of an interaction originating within the detector, in which the upper and lower parts of the CAL recorded a time difference less than 8~ns
\end{enumerate}

	The alternative trigger accepted the event if $\ptmiss > 8~\GeV$, and either 
	$E_{T}(-IR) > 8~\GeV$, one jet found with the cone algorithm~\cite{eucell} such that $\etjet > 8~\GeV$, or one $k_T$~\cite{np:b406:187} jet was found such that $\etjet > 8~\GeV$. This is the only condition in this thesis where cone jets were considered.  At all other points, a jet refers explicitly to jets found using the $k_T$ cluster algorithm. These jetfinding algorithms are described in detail in section~\ref{section_jet_reconstruction}.

% 	Events in this study were stored to data tape for later retrieval.  Retrieval is facilitated by labeling each event with a quickly retrieved list of {\it Data Summary Tape} (DST) bits.  These bits encode important trigger states for each event, so that only events which satisfy these trigger bits are retrieved.  
	%code is somewhere  here ${ZSOFT_ROOT}/zeus/ZeusUtil/dst/  

	When an event satisfied the trigger selection criteria, it was written to data tape for storage and later analysis.  
	

\section{Offline Event Selection}
	The selection criteria applied to events after triggering can be separated into three categores:  Preselection, in which loose cuts are applied to speed analysis, cleaning selections, in which background and poorly reconstructed events are rejected, and phase space selection, in which events are selected with desired kinematic and jet properties.  
\subsection{Preselection}
	\label{section_preselection}
	The performance of the ZEUS detector, luminosity monitoring systems and polarization monitoring systems varied during data taking.  The ZEUS reconstruction library contains a dedicated functions which indicated wether the ZEUS detector subcomponents were in proper functioning order at the time the event was recorded, and events taken with all central components properly functioning were only used in this analysis.  {\MC} events were not subject to these selections.

	The two devices used for measuring the lepton beam longitudinal polarization, LPOL and TPOL, which were introduced in section~\ref{subsection_luminosity_mon_and_pol}, produced comparable but different measurements of the average polarization during each data taking run.  The device chosen for each data taking run was based on which one was functioning properly for a longer period of that run.  If LPOL (TPOL) was functioning longer for that run, then each data event was only selected for analysis if the LPOL (TPOL) was indicated as functioning properly t the time that event was recorded.  The average polarization value and integrated luminosity for each data taking run was exclusively taken from the LPOL (TPOL).
	
	Events were required to have $\ptmiss>9~\GeV$, $\ptmiss/E_T>0.3$, and at least one calorimeter jet within $-1 < \rapjet < 2.5$ and $\etjet > 3~\GeV$, where $\etjet$ was computed purely from CAL cell energies as stored on tape.  These cuts are less restrictive forms of those applied later, and the jet cuts are described in section~\ref{section_jet_selection} in detail.  Events meeting all these criteria were then retrieved for analysis.

\subsection{Signal Selection and Background Rejection}
	\label{section_signal_selection}
	This section describes selection cuts which were applied both to select signal and reject background, which are in many cases inseparable actions.  The principle signal of CC DIS is missing transverse momenta, due to the neutrino which escapes detection.  Many other types of $ep$ and non-$ep$ events create this signature in the detector, such as CAL PMT sparks, cosmic or  halo muons, and particles which escape down the beam pipe at a low angle.  Thus, many other selection cuts are required to remove events from these sources.  
	
	 All detector level events were required to have a $\ptcal > 11~\GeV$ as measured by the CAL without any corrections applied.  This both selected CC DIS events, and ensured trigger efficiency, because almost all trigger conditions were set to a $\ptmiss$ much lower.
	
	A properly reconstructed vertex was required, partially because this rejects non-$ep$ background, and also because the vertex was used to compute quantities like $E_T$ and $\gammah$.  Before this could be applied, good tracking conditions were required, on which the vertex reconstruction relied.  Because the phase space of jets found in the analysis aimed at reaching to $\rapjet \equiv 2.5$, while the CTD acceptance begins to deteriorate at $\eta \equiv 2$, special tracking requirements were formed to differentiate these two cases.  

	As described in section~\ref{section_preselection}, all events were required to have a jet before being retrieved from tape.  Events where the jet with highest highest $\etjet$ satisfied $\rapjet > 2$ are referred to as {\it forward-jet events}.  forward-jet events events have many tracks outside the CTD acceptance, and are treated specially.  

	Non-forward-jet events were expected to have many tracks within the CTD, and geometric information in the CTD and CAL were expected to agree.  Selection requirements for non-forward-jet events were 
	\begin {enumerate}
		\item $\ngoodtracks \geq 1$, where $\ngoodtracks$ is the number of {\it good tracks}\footnote{Good tracks in the offline selection were defined as tracks which possessed a transverse momentum such that $0.15 \leq \pttrack \leq 150 ~\GeV$, a polarangle such that $15\leq \thetatrak\leq164^\circ$, and were fit with at least 10 degrees of freedom. } in the CTD. These tracks were reconstructed with high purity, which enabled the reliable reconstruction of the event vertex. 
		\item $\left|\phictd - \phical\right| < 1~\rad$, where $\phictd$ is the azimuthal angle of the net momentum from  tracks in the CTD and $\phical$ is the azimuthal angle of the net momentum from cells  in the CAL.  This selection cut removed events where a cosmic or halo muon deposited energy in the CAL during an $ep$ event.
		\item $\ptctd > 0.1\times\ptcal$ or $\ptcal > 25~\GeV$.  This selection cut removed events where a cosmic or halo muon deposited energy in the CAL during an $ep$ event.
	\end{enumerate}
	Forward-jet events were exempt from these requirements, but the transverse momentum requirement for these events was tightened for these events to $\ptcal > 20~\GeV$.

	Events were required to have a reconstructed vertex with $ -35 < \zvtx < 33~\cm $.  This removed many events which were triggered from beam gas and halo muons.

	As described in section~\ref{section_baby_analysis}, PHP events may have a large reconstructed $\ptmiss$, and no isolated electron in the CAL.  These events were largely removed by requiring  $\ptmiss/E_T > 0.5$.  

	Some NC DIS events occurred in overlap with a CAL PMT spark.  This cell would then carry a significant fraction of the $E_T$ of the event.  Requiring $E_T^{\mbox{\footnotesize max}}/E_T < 0.7$ removed these events, where $E_T^{\mbox{\footnotesize max}}$ is the $E_T$ of the CAL cell with the largest $E_T$.  

	Some NC DIS events occurred in overlap with a halo or cosmic muon.  These events left a large amount of energy in the BHAC, $\ebhac$, relative to other parts of the CAL.  Energies in the inner and outer hadronic parts of the BHAC are labled as $\ebhacone$ and $\ebhactwo$, respectively.  These events were removed by rejecting events if either of the following were satisfied:
	\begin{itemize}
	 \item 	$\ebcal > 8~\GeV$ and $\ebhacone/\ebcal > 0.85$
	 \item 	$\ebcal > 2~\GeV$ and $\ebhactwo/\ebcal > 0.5$
	\end{itemize}

	Some cosmic muons traversed the ZEUS detector with a very small distance of closest approach to the nominal interaction point.  These types of events appear as two hadronic jets with two nearly anti-parallel tracks.  These events were removed by rejecting all events with only two ``good'' tracks, such that the cosine of their angle was less than -0.996.

	Some NC DIS events were reconstructed with large $\ptmiss$.  The were removed from the sample by identifying an isolated electron in the CAL.  As described in section~\ref{section_electron_finding}, candidate electrons were identified by the \SINISTRA program.  Only the highest probability candidate was considered.  Variables characterizing candidate included 
	\begin {itemize}
		\item $E'_e$, the sum energy of CAL cells associated with the candidate.
		\item $\theta_e$, the polar angle of the candidate cluster
		\item $\mathcal{I}_e$, the {\it isolation} of the electron from other CAL deposits; computed as $\mathcal{I}_e = \overline{E'}_{e,7}/E'_e$, where $\overline{E'}_{e,7}$ is the energy sum of the cells belonging to the candidate which are outside a cone of radius .7 from the center of the candidate deposit in the $\eta-\phi$ plane.
		\item $\mathcal{N}_e$, the {\it narrowness} of the electron from other CAL deposits; computed as $\mathcal{I}_e = E'_{e,3}/E'_e$, where $E'_{e,3}$ is the energy sum of the cells belonging to the candidate within a cone of radius .3 in the $\eta-\phi$ plane.
	\end{itemize}
  	Events were rejected if the following conditions were all satisfied.
	\begin {enumerate}
		\item $E'_e \geq 10~\GeV$
		\item $20 \leq \theta_e \leq 140$
		\item $\mathcal{I}_e \leq .1$
		\item $\mathcal{N}_e \geq .9$
	\end{enumerate}

	Events were also rejected if the electron candidate satisfied $(y_{\mbox{\footnotesize e}} < 0.7)$, where $y_{\mbox{\footnotesize e}}$ is the inelasticity of the event computed from the electron candidate information as $y_{ \mbox{\footnotesize e}} = 1-\frac{E_e'}{2E_e}\left(1-\cos(\theta_e)\right)$, where $E_e$ is the nominal HERA II electron beam energy of $27.5~\GeV$.

	Electrons form NC DIS occasionally deposited their energy in a wide shower, which could be falsely reconstructed as a jet.  Events were rejected if any jet in the event overlapped with the electron candidate.  Specifically events were rejected if all the following were satisfied:
	\begin{itemize}
	 \item $E'_e > 10~\GeV$
	 \item The distance in the $\eta-\phi$ plane between the jet and electron candidate was less than 0.1
	\item $|1-E'_e/E_{\mbox{\footnotesize jet}}| < 0.2$
	\end{itemize}
	Here, $E_{\mbox{\footnotesize jet}}$ refers to the uncorrected CAL cell energy of the jet in question.

	Even after these cleaning cuts, approximately 1\% of the event was comprised by halo and cosmic muon events.  These have a topology which is simple to identify by sight, but difficult to reliably quantify.  The sample was independently visually scanned by two analyzers, and the remaining events were removed from the sample.  No {\MC} events were removed in this manner.

\subsection{Kinematic and Jet Selection}
	\label{section_jet_selection}
	All Detector level events were required to have a dead-material-corrected $Q^2$ value greater than $200~\GeV$, and a corrected $y$ less than $0.9$.   

	All cluster objects were required to have uncorrected $\etjet~>~3~\GeV$, to ensure reliable reconstruction.  All jet variables will henceforth refer solely to those corrected for detector effects unless otherwise stated.  Clustered objects were only considered jets if they satisfied $-1 < \rapjet < 2.5$.  Thus, the terms {\it jet with highest $\etjet$}, {\it most forward jet} etc. implicitly refer to jets selected exclusively from the set of all jets within this $\rapjet$ range.  All data events events in the sample were required to have the jet with highest $\etjet$ satisfy $\etjet>~14~\GeV$.  Inclusive jets were defined as any jet with $\etjet>~14~\GeV$.  Dijet systems were defined as the two jets in an event with highest $\etjet$, such that they possessed $\etjeta>~14~\GeV$ and $\etjetb>~5~\GeV$, where $\etjeta \geq \etjetb$.  3-jet systems were defined as the three jets in an event with highest $\etjet$, such that $\etjeta>~14~\GeV$, $\etjetb>~5~\GeV$ and $\etjetc>~5~\GeV$,  where $\etjeta \geq \etjetb \geq \etjetc$.  

	The minimum value of $\etjeta$ and inclusive-jet $\etjet$ was chosen because this value is correlated with $\ptmiss$, and the selection cut of $\ptmiss>11~\GeV$ limits selection efficiency below $\etjeta$ of approximately $14~\GeV.$  It was possible to choose the value of minimum $\etjet$ for $\etjetb$ and $\etjetc$ because these jets were not strongly correlated with the selection of the event.  The fundamental limitation for these jets was the reliable reconstruction of calorimeter quantities.  The restriction on $\rapjet$ requires that jet be reconstructed well within the accpetance of the CAL.


\section{Reconstruction and Selection of Simulated Events}
	To produce detector level and corrected detector level distributions for {\MC} events, all selection criteria were performed identically as for the data, with exceptions noted in section~\ref{section_signal_selection} and~\ref{section_jet_selection}. 

	Parton- and hadron-level simulated events were only selected if $\qsqgen > 200~\GeV$ and $\ygen < 0.9$, where $\qsqgen$, $\ygen$ are understood to be the generated values, not the values from the QED born level.

	Parton- and hadron-level jets were found in the lab frame by applying the $k_T$ cluster algorithm to partons and hadrons, as described in chapter ~\ref{section_jet_reconstruction}.   Hadronic (partonic) jets were selected with the same phase space requirements as the corrected detector level jets, as described in section ~\ref{section_jet_selection}.

