\documentclass[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}
\usepackage{wrapfig}
\usepackage{amsmath}
\urldef\myurl\url{https://confluence.slac.stanford.edu/display/hpsg/Things-to-do%3A++Vertexing+@+1.05+GeV%2C+0.5mm}

\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%
}

\newcommand{\backupbegin}{
\newcounter{framenumberappendix}
\setcounter{framenumberappendix}{\value{framenumber}}
}
\newcommand{\backupend}{
\addtocounter{framenumberappendix}{-\value{framenumber}}
\addtocounter{framenumber}{\value{framenumberappendix}} 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\title{Vertexing to-do list}

\author{Sho Uemura}
%\institute{bumming around}
\date[November 17, 2016]

%\titlegraphic{
%\includegraphics[height=0.1\textheight]{SLAC_Logo}\hspace*{4.75cm}~
%\includegraphics[height=0.1\textheight]{partner_logo_v2}
%}

\begin{document}

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

\begin{frame}{Wrapping up and getting out the door}
    \begin{itemize}
        \item thesis is defended: \url{http://www.slac.stanford.edu/~meeg/presentation/2016-09-15_defense/defense.pdf}
        \item thesis is done: \url{https://github.com/meeg/thesis}
        \item code is out, with README docs: 
            \begin{itemize}
                \item tuple maker: \url{https://github.com/JeffersonLab/HPS-CODE/tree/master/ANALYSIS/tuple}
                \item vertexing analysis: \url{https://github.com/JeffersonLab/HPS-CODE/tree/master/ANALYSIS/vertexing}
            \end{itemize}
        \item to-do list: \myurl
    \end{itemize}
\end{frame}

\begin{frame}{This talk}
    \begin{itemize}
        \item Focus: general to-do items, taken from \myurl
            \begin{itemize}
                \item All items are (I think) required for any high-quality analysis (2015 0.5 mm, 2015 0.5+1.5 mm, 2016, etc.); no ``nice to have'' except as noted
                \item Who's going to do all of this? Not me, can't all be Holly
            \end{itemize}
        \item Other stuff:
            \begin{itemize}
                \item Some proposal reach plots
                \item Processing the full 1.5 mm data set
            \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}{Add non-L1}
    \begin{itemize}
        \item You have four kinds of events based on whether the electron and positron tracks have L1 hits; I require L1 hits on both tracks.
        \item I think the zcuts for events with and without L1 hits are always going to be significantly different. If so, it's hard to avoid splitting the data into multiple data sets: you might be able to rescale the Z-axis for the different event types, so the zcuts all line up, but that seems weird.
        \item I think the way to go is to split the data into four sets; tune cuts separately for each set, and find zcuts separately for each set. Then combine limits using the established procedure (and code) for optimum interval with multiple detectors.
        \item N.B. we need to know our L1 efficiencies very well - if L1 efficiencies are worse in data than MC, we're adding lots of events to the non-L1 data sets that do not appear in MC. May be possible to reject such events by checking whether the track should have hit L1.
    \end{itemize}
\end{frame}

\begin{frame}{Fix vertex fit}
    \begin{columns}
        \column{0.6\textwidth}
        \begin{itemize}
            \item The resolution of the reconstructed mass should be independent of Z but is worse for displaced vertices.
            \item This ad-hoc correction works pretty well: corrM = uncM - 0.15e-3*(elePX/eleP-posPX/posP)*uncVZ/uncM
            \item Hunch: the vertex mass is being calculated using the track directions at $z=0$, or something like that.
        \end{itemize}
        \begin{center}
            \includegraphics[width=\textwidth]{mass_shift_40}
        \end{center}
        \column{0.4\textwidth}
        \includegraphics[width=\textwidth,page=4]{acceptance_40}

        \includegraphics[width=\textwidth,page=5]{acceptance_40}
    \end{columns}
\end{frame}

\begin{frame}{Figure out excess background}
    \begin{columns}
        \column{0.6\textwidth}
        \begin{itemize}
            \item Need to find out where the excess background events come from. Then, need to devise a cut to kill them. (If we can't, the vertexing analysis is sunk.)
            \item MC is the right way to go: there's one excess background event in postTriSummitFixes tritrig.
                Maybe there's something obviously special about it.
                If that doesn't work, make more MC: may require taking shortcuts in MC.
        \end{itemize}
        \column{0.4\textwidth}
        \includegraphics[width=\textwidth,page=4]{golden_mres_output}

        \includegraphics[width=\textwidth,page=4]{mc_mres_output}
    \end{columns}
\end{frame}

\begin{frame}{Tune cuts}
    \begin{itemize}
        \item The vertex cuts aren't really optimized: I just eyeballed the ROC curves. It should be possible to tune cuts to maximize sensitivity:
            \begin{itemize}
                \item Pick a target mass and $\epsilon^2$. Generate a corresponding A' sample.
                \item Make a data sample by taking a mass slice of the unblinded data.
                \item To test a set of cuts, run the cuts on the data sample and the A' sample; fit the vertex distribution in the data sample to see what zcut you can get, then see how many A' you get past zcut. Tune cuts to maximize that number.
            \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}{Prepare to unblind}
    \begin{itemize}
        \item Run the analysis on negative Z, see if the background matches the model. Need to retune cuts, since some (isolation) are specifically tuned to reject things in +Z.
        \item Idea from Natalia: if you smear the mass enough, you can safely look at 100\% of the positive Z events before unblinding.
            Since the Z distribution changes with mass, you may need to scale Z at the same time (meaning, if you send $m\to m+\delta m$, send $z\to z(1-a \delta m)$, or something like that, so the z vs. mass distribution looks approximately the same).
    \end{itemize}
\end{frame}

\begin{frame}{Do look-elsewhere correction correctly}
    \begin{columns}
        \column{0.6\textwidth}
    \begin{itemize}
        \item The MC model I use for the look-elsewhere correction is really bad - I take the distribution of events that appear in at least one mass slice, and make a toy 1-D mass distribution based on that.
            This assumes that any such event shows up in every mass slice that it overlaps.
            This is not a good assumption.
        \item The right way to do the look-elsewhere correction would be to make a toy 2-D distribution (z vs. mass), then take mass slices from that.
            Since we have a fit to the mass distribution and have fits to the vertex tails vs. mass, we have everything we need to make the toy 2-D distribution.
    \end{itemize}
        \column{0.4\textwidth}
        \includegraphics[width=\textwidth,page=6]{golden_mres_output}
    \end{columns}
\end{frame}

\begin{frame}{Profile likelihood?}
    \begin{itemize}
        \item The way I do significance in the presence of excess background (count what's in my slice, then look at the counts in neighboring slices to estimate background in my slice) is very ad-hoc and probably not good.
            I think the right way to do it may be to do a 2-D profile likelihood ratio, fitting to signal + (known background) + (excess background), where the excess background is something that's a simple function (linear?) in mass and something intelligent (acceptance?) in Z.
    \end{itemize}
\end{frame}

\begin{frame}{Event flags for 1.5 mm}
    \begin{itemize}
        \item Holly's 1.5 mm data set starts at run 5403; older runs (the majority of the 1.5 mm data) do not have SVT bias in MYA or EPICS events
        \item org.hps.monitoring.drivers.svt.SampleZeroHVBiasChecker uses SVT noise to identify bias-off periods (used to cross-check the MYA information)
            \begin{itemize}
                \item This was done by Pelle and me
                \item Should be extended to add bias-off periods to the conditions DB
                \item I suggest this be done by the SVT group with support from me
            \end{itemize}
    \end{itemize}
\end{frame}

%\begin{frame}{left tail of the mass acceptance}
    %\begin{itemize}
        %\item Most events at the low-mass edge of the acceptance have true mass greater than reconstructed mass. This means that in this region, the distribution of reconstructed masses overestimates the true rate of radiative tridents at a given mass, and therefore (I think) the expected rate of A'. Think harder about this, and correct for this effect if necessary.
        %\item In 2015, the relevant mass range is totally outside our reach because of efficiency vs. Z effects. This may not be true in 2016, because the low-mass range in 2016 is the range that overlaps with 2015 reach.
        %\item This problem is more important for bump-hunt; I'm pretty sure it matters there.
    %\end{itemize}
%\end{frame}

\begin{frame}{Small stuff}
    \begin{columns}
        \column{0.6\textwidth}
        \begin{itemize}
            \item Add WABs to background tails fit
                \begin{itemize}
                    \item Can't be done with wab-beam-tri, which is O(1000) times less efficient than tritrig-beam-tri
                \end{itemize}
            \item Improve acceptance fits
            \item Cut out tridents produced in L1
        \end{itemize}
        \column{0.4\textwidth}
        \includegraphics[width=\textwidth,page=2]{acceptance_test_50}

        \includegraphics[width=\textwidth,page=8]{goldenhalo}
    \end{columns}
\end{frame}

\begin{frame}{More small stuff}
    \begin{columns}
        \column{0.6\textwidth}
        \begin{itemize}
            \item Why doesn't optimum interval background subtraction work? (not crucial)
            \item Figure out mass resolution discrepancy: what's the mass dependence?
                \begin{itemize}
                    \item Is it from MS simulation effect on angle resolution? alignment effect on momentum resolution? something else?
                    \item Use Moller data and MC, measure contributions of momentum resolution and angle resolutions
                \end{itemize}
            \item Systematics and stuff
        \end{itemize}
        \column{0.4\textwidth}
        \includegraphics[width=\textwidth,page=5]{toy_nothing}

        \includegraphics[width=\textwidth,page=12]{acceptance_data}
    \end{columns}
\end{frame}

\begin{frame}{Proposal reach}
    \begin{itemize}
        \item Proposal estimates vs. state of the art, same assumptions (1 week of MC, uniform efficiency vs. Z)
    \end{itemize}
    \begin{center}
        \includegraphics[width=0.4\textwidth]{significance_1e-9}
        \includegraphics[width=0.4\textwidth]{significance_3e-9}

        \includegraphics[width=0.4\textwidth]{detectable_1e-9}
        \includegraphics[width=0.4\textwidth]{detectable_3e-9}
    \end{center}
\end{frame}

\end{document}
