\documentclass[hyperref=pdftex, presentation]{beamer}
% Replacing 'presentation' with 'handout' in the above line
% will produce 4 slides per page.
% The hyperref option makes it possible to include hyperlinks.

\mode<presentation> {
\usetheme{Boadilla}
\setbeamercovered{transparent}
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}

\mode<handout>{
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[letterpaper,landscape,border shrink=5mm]
\setbeamercolor{background canvas}{bg=black!10} }

\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author
	in head/foot}%
	\usebeamerfont{author in head/ foot}\insertshortauthor%&\approx& (\insertshorti
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title
	in head/foot}%
	\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in
	head/foot}%
	\usebeamerfont{date in head/foot}\insertshortdate\hspace*{2em}
	\insertframenumber / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\title[GEANT4/EGS5]{GEANT4/EGS5}

\title[ECal performance]{ECal Calibration, Performance, and Simulation}

\author{Sho Uemura}
\institute{SLAC}
\date[September 10, 2012]

\begin{document}

\begin{frame}
	\titlepage
\end{frame}

\begin{frame}{Overview}
	\begin{itemize}
		\item Trigger checking: Did the trigger work as designed?
		\item Trigger performance: Did the trigger do what we wanted?
		\item ECal calibration: in progress
	\end{itemize}
\end{frame}

\begin{frame}{Trigger checking: decision and timing}
	\begin{columns}
		\column{0.6\textwidth}
		\begin{itemize}
			\item Take readout hits (integrated over fixed window) and estimate trigger hits (integrated over time-over-threshold); cluster using CTP algorithm, simulate trigger decision
			\item Actual performance of trigger matches simulation
			\item Actual trigger time matches trigger time predicted based on hit times
		\end{itemize}
		\column{0.4\textwidth}
		\includegraphics[width=\textwidth]{trigtimes}
	\end{columns}
\end{frame}

\begin{frame}{Trigger checking: tag and probe}
	\begin{columns}
		\column{0.6\textwidth}
		\begin{itemize}
			\item To check trigger performance in top half:
				\begin{itemize}
					\item Look at events where bottom trigger fires (no trigger bias) and only one probe cluster in top half
					\item Calculate trigger efficiency as function of probe cluster energy
				\end{itemize}
			\item Trigger turns on at around 1280 ADC counts on both halves, as expected
		\end{itemize}
		\column{0.4\textwidth}
		\includegraphics[width=\textwidth]{top_turnon_adc}

		\includegraphics[width=\textwidth]{bottom_turnon_adc}
	\end{columns}
\end{frame}

\begin{frame}{Trigger performance}
	\begin{columns}
		\column{0.6\textwidth}
		\begin{itemize}
			\item Do the same thing, but with calibrated cluster energy
			\item Turn-on curve is much less steep:
				\begin{itemize}
					\item Spread in crystal gains means trigger threshold varies by position
					\item Time-over-threshold integral is not linear in amplitude, so a cluster split across two crystals needs higher energy to trigger: plot below shows turn-on curve without spread in gains
				\end{itemize}
		\end{itemize}
		\includegraphics[width=0.7\textwidth]{top_turnon_uncal}
		\column{0.4\textwidth}
		\includegraphics[width=\textwidth]{top_turnon_e}

		\includegraphics[width=\textwidth]{bottom_turnon_e}
	\end{columns}
\end{frame}

\begin{frame}{Calibration: MC and data}
	\begin{columns}
		\column{0.7\textwidth}
		\begin{itemize}
			\item Generate MC sample with same target as data
				\begin{itemize}
					\item Needs further work on relative alignment of SVT and ECal so distribution of matched clusters is the same
					\item Bad crystals (dead/noisy) are removed from both MC and data
					\item Data should really be background-subtracted, but using 1.6\% $X_0$ run (1351) minimizes effect of background
				\end{itemize}
			\item Calculate average E/p for each crystal
				\begin{itemize}
					\item Match ECal cluster with energy $E_i$ to SVT track with momentum $P_i$
					\item Each crystal $j$ in cluster has weight $w_{j,i}=E_{j,i}/E_i$
					\item Compute crystal E/p: $\frac{\sum_j w_{j,i}}{\sum_j\frac{P_j}{E_j}w_{j,i}}$
				\end{itemize}
		\end{itemize}
		\column{0.3\textwidth}
		\includegraphics[width=\textwidth]{weights_sim_raw}
%		\includegraphics[width=0.4\textwidth]{weights_sim_cal}

		\includegraphics[width=\textwidth]{weights_data}

		\includegraphics[width=\textwidth]{ecalgainplots_corr_sim}
	\end{columns}
\end{frame}

\begin{frame}{Calibration: gains}
	\begin{itemize}
		\item Equalize crystal E/p between data and MC
			\begin{itemize}
				\item Scale crystal gain by the ratio of data and MC values of E/p
				\item For crystals with insufficient statistics, use the whole HV group
			\end{itemize}
		\item Apply new gains (i.e. trigger threshold) to MC; iterate
		\item These gains give the correct calibration from ADC counts to energy deposited in each crystal
			\begin{itemize}
				\item We still need to use E/p result to correct for sampling fraction---go from energy deposited and read out to incident particle energy
			\end{itemize}
	\end{itemize}
	\begin{center}
		\includegraphics[width=0.4\textwidth]{nohv_gains}
		\includegraphics[width=0.4\textwidth]{gains}
	\end{center}
\end{frame}


\begin{frame}{E/p distributions}
	\begin{columns}
		\column{0.7\textwidth}
		\begin{itemize}
			\item E/p distributions approach simulated distribution as expected (on right: data before cal, data after cal, simulation)
				\begin{itemize}
					\item Clearly still not great (wider peak, clusters with E/p > 1)---mismatch between data and MC hit distributions means some crystals are not really calibrated
				\end{itemize}
			\item E vs. X plot shows expected shape (on bottom: before and after cal.)
			\item Center of ECal doesn't see charged particles and can't be calibrated with tracks
			\item Some HV groups with very low gain don't trigger enough for the calibration to work
		\end{itemize}
		\begin{center}
			\includegraphics[width=0.45\textwidth]{e_vs_x_nocal}
			\includegraphics[width=0.45\textwidth]{e_vs_x}
		\end{center}
		\column{0.3\textwidth}
		\includegraphics[width=\textwidth]{ep_data_nocal}

		\includegraphics[width=\textwidth]{ep_data_cal}

		\includegraphics[width=\textwidth]{ep_sim_cal}
	\end{columns}
\end{frame}

\begin{frame}{Hits in calibrated ECal}
	\begin{columns}
		\column{0.5\textwidth}
		\begin{itemize}
			\item Selecting only hits above the trigger threshold, ECal hit occupancy and hit energy distributions look smooth---remaining crystals are probably good
			\item So we have: 39 dead crystals, 5 noisy crystals, 13 crystals not wired to the trigger, 385 good crystals
		\end{itemize}
		\begin{center}
			\includegraphics[width=0.8\textwidth]{hitrates}
		\end{center}
		\column{0.5\textwidth}
		\includegraphics[width=\textwidth]{hit_e_dist}
	\end{columns}
\end{frame}

\begin{frame}{Next}
	\begin{itemize}
		\item Further work on calibration
			\begin{itemize}
				\item Find correct detector geometry, check data vs. MC
				\item Look at and subtract empty-target run
				\item Calibrate remaining sections of ECal using rates, energy distributions
			\end{itemize}
		\item Sampling fraction correction to energy
		\item Cluster position?
			\begin{itemize}
				\item Already uses shower depth correction; crystal interpolation might be useful
			\end{itemize}
	\end{itemize}
\end{frame}

\end{document}

