\documentclass[10pt, aspectratio=169]{beamer}
\usepackage{siunitx}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage[backend=biber]{biblatex}
\usepackage{mathtools,amssymb}
\usepackage{physics}
\usepackage{slashed}
\usepackage{tikz}
\usepackage{tikz-feynman}
\usepackage{pdfpcnotes}
\usepackage[list=true, font=small,
labelformat=brace, position=top]{subcaption}
%\setbeameroption{show notes on second screen} %
\usepackage{animate}
\usepackage{ifdraft}

\graphicspath{ {figs/} }
\addbibresource{thesis.bib}
\sisetup{separate-uncertainty = true}

\usetheme{default}
\usecolortheme{dolphin}
\usefonttheme{professionalfonts}
%\usepackage{newmathpx}
\institute[TUD] % (optional)
{
 IKTP, TU Dresden
}

\setbeamertemplate{itemize items}[default]
\setbeamertemplate{enumerate items}[default]

\AtBeginSection[]
{
   \begin{frame}
       \tableofcontents[currentsection]
   \end{frame}
}


\AtBeginSubsection[]
{
   \begin{frame}
       \tableofcontents[currentsubsection]
   \end{frame}
 }

\setbeamertemplate{footline}[frame number]
\setbeamertemplate{bibliography item}{\insertbiblabel}


\newtheorem{results}{Results}
\newenvironment<>{results}[1][Results]{%
  \setbeamercolor{block example}{fg=white,bg=red!75!black}%
  \begin{exampleblock}#2{#1}}{\end{exampleblock}}

% Macros

%% qqgg
\newcommand{\qqgg}[0]{q\bar{q}\rightarrow\gamma\gamma}

%% ppgg
\newcommand{\ppgg}[0]{pp\rightarrow\gamma\gamma}

%% Momenta and Polarization Vectors convenience
\DeclareMathOperator{\ps}{\slashed{p}}

\DeclareMathOperator{\pe}{\varepsilon}
\DeclareMathOperator{\pes}{\slashed{\pe}}

\DeclareMathOperator{\pse}{\varepsilon^{*}}
\DeclareMathOperator{\pses}{\slashed{\pe}^{*}}

%% Spinor convenience
\DeclareMathOperator{\us}{u}
\DeclareMathOperator{\usb}{\bar{u}}

\DeclareMathOperator{\vs}{v}
\DeclareMathOperator*{\vsb}{\overline{v}}

%% Center of Mass energy
\DeclareMathOperator{\ecm}{E_{\text{CM}}}

%% area hyperbolicus
\DeclareMathOperator{\artanh}{artanh}
\DeclareMathOperator{\arcosh}{arcosh}

%% Fast Slash
\let\sl\slashed

%% Notes on Equations
\newcommand{\shorteqnote}[1]{ &  & \text{\small\llap{#1}}}

%% Typewriter Macros
\newcommand{\sherpa}{\texttt{Sherpa}}
\newcommand{\rivet}{\texttt{Rivet}}
\newcommand{\vegas}{\texttt{VEGAS}}
\newcommand{\lhapdf}{\texttt{LHAPDF6}}
\newcommand{\scipy}{\texttt{scipy}}

%% Sherpa Versions
\newcommand{\oldsherpa}{\texttt{2.2.10}}
\newcommand{\newsherpa}{\texttt{3.0.0} (unreleased)}

%% Special Names
\newcommand{\lhc}{\emph{LHC}}

%% Expected Value and Variance
\newcommand{\EX}[1]{\operatorname{E}\qty[#1]}
\newcommand{\VAR}[1]{\operatorname{VAR}\qty[#1]}

%% Uppercase Rho
\newcommand{\Rho}{P}

%% Transverse Momentum
\newcommand{\pt}[0]{p_\mathrm{T}}

%% Sign Function
\DeclareMathOperator{\sign}{sgn}

%% Stages
\newcommand{\stone}{\texttt{LO}}
\newcommand{\sttwo}{\texttt{LO+PS}}
\newcommand{\stthree}{\texttt{LO+PS+pT}}
\newcommand{\stfour}{\texttt{LO+PS+pT+Hadr.}}
\newcommand{\stfive}{\texttt{LO+PS+pT+Hadr.+MI}}

%% GeV
\newcommand{\gev}[1]{\SI{#1}{\giga\electronvolt}}

%% Including plots
\newcommand{\plot}[2][,]{%
  \includegraphics[draft=false,#1]{./figs/#2.pdf}}
\newcommand{\rivethist}[2][,]{%
  \includegraphics[draft=false,width=\textwidth,#1]{./figs/rivet/#2.pdf}}

%% Including Results
\newcommand{\result}[1]{\input{./results/#1}\!}

\title{A Study of Monte Carlo Methods and their Application to
  Diphoton Production at the Large Hadron Collider}
\subtitle{Bachelor Thesis Presentation}
\author{Valentin Boettcher}
\beamertemplatenavigationsymbolsempty

\begin{document}
\hypersetup{pageanchor=false}
\maketitle

\hypersetup{pageanchor=true} \pagenumbering{arabic}

\begin{frame}
  \tableofcontents
\end{frame}

\section{Introduction}
\begin{frame}{Motivation}
  \begin{block}{Monte Carlo Methods}
    \begin{itemize}
    \item (most) important numerical tools (not just) in particle
      physics
    \item crucial interface of theory and experiment
    \item enable precision predictions within and beyond SM
    \end{itemize}
  \end{block}
  \pause
  \begin{block}{Diphoton Process \(\qqgg\)}
    \begin{itemize}
    \item simple QED process, calculable by hand
    \item higgs decay channel: \(H\rightarrow \gamma\gamma\)
      \begin{itemize}
      \item instrumental in its
        discovery~\cite{Aad:2012tfa,Chatrchyan:2012ufa}
      \end{itemize}
    \item dihiggs decay \(HH\rightarrow b\bar{b}\gamma\gamma\)
      \begin{itemize}
      \item process of recent interest~\cite{aaboud2018:sf}
      \end{itemize}
    \end{itemize}
  \end{block}
  \pnote{Why usefult for ev. gen -> later}
\end{frame}

\section{Calculation of the \(\qqgg\) Cross Section}
\subsection{Approach}
\begin{frame}
  \begin{columns}[T]
    \begin{column}{.5\textwidth}
      \begin{figure}[ht]
        \centering
        \begin{subfigure}[c]{.28\textwidth}
          \centering
          \begin{tikzpicture}[scale=.6]
            \begin{feynman}
              \diagram [small,horizontal=i2 to a] { i2
                [particle=\(q\)] -- [fermion, momentum=\(p_2\)] a --
                [fermion, reversed momentum=\(q\)] b, i1
                [particle=\(\bar{q}\)] -- [anti fermion,
                momentum'=\(p_1\)] b, i2 -- [opacity=0] i1, a --
                [photon, momentum=\(p_3\)] f1 [particle=\(\gamma\)], b
                -- [photon, momentum'=\(p_4\)] f2
                [particle=\(\gamma\)], f1 -- [opacity=0] f2, };
            \end{feynman}
          \end{tikzpicture}
          \subcaption{u channel}
        \end{subfigure}
        \begin{subfigure}[c]{.28\textwidth}
          \centering
          \begin{tikzpicture}[scale=.6]
            \begin{feynman}
              \diagram [small,horizontal=i2 to a] { i2
                [particle=\(q\)] -- [fermion, momentum=\(p_2\)] a --
                [fermion, reversed momentum'=\(q\)] b, i1
                [particle=\(\bar{q}\)] -- [anti fermion,
                momentum'=\(p_1\)] b, i2 -- [opacity=0] i1, a --
                [draw=none] f2 [particle=\(\gamma\)], b -- [draw=none]
                f1 [particle=\(\gamma\)], f1 -- [opacity=0] f2, };
              \diagram* { (a) -- [photon] (f1), (b) -- [photon] (f2),
              };
            \end{feynman}
          \end{tikzpicture}
          \subcaption{\label{fig:qqggfeyn2}t channel}
        \end{subfigure}
%
        \caption{Leading order diagrams for \(\qqgg\).}%
        \label{fig:qqggfeyn}
      \end{figure}
    \end{column}
    \pause
    \begin{column}{.5\textwidth}
      \begin{block}{Task: calculate \(\abs{\mathcal{M}}^2\)}
        \begin{enumerate}[<+->]
        \item translate diagrams to matrix elements
        \item use Casimir's trick to average over spins
        \item use completeness relation to sum over photon
          polarizations
        \item use trace identities to compute the absolute square
        \item simplify with trigonometric identities
        \end{enumerate}
      \end{block}
      \pause Here: Quark masses neglected.
    \end{column}
  \end{columns}
\end{frame}

\subsection{Result}

\begin{frame}{Result}
  \begin{equation}
    \label{eq:averagedm_final}
    \langle\abs{\mathcal{M}}^2\rangle = \frac{4}{3}(gZ)^4
    \cdot\frac{1+\cos^2(\theta)}{\sin^2(\theta)} =
    \frac{4}{3}(gZ)^4\cdot(\tanh(\eta)^2 + 1)
  \end{equation}
  %
  \pause
  \[\overset{\text{Golden Rule}}{\implies}\]
  \pause
  \begin{equation}
    \label{eq:crossec}
    \dv{\sigma}{\Omega} =
    \frac{1}{2}\frac{1}{(8\pi)^2}\cdot\frac{\abs{\mathcal{M}}^2}{\ecm^2}\cdot\frac{\abs{p_f}}{\abs{p_i}}
    = \underbrace{\frac{\alpha^2Z^4}{6\ecm^2}}_{\mathfrak{C}}\frac{1+\cos^2(\theta)}{\sin^2(\theta)}
  \end{equation}

  \pause
  \begin{figure}[ht]
    \centering
    \begin{minipage}[c]{0.3\textwidth}
      \plot[scale=.6]{xs/diff_xs}
    \end{minipage}
    \begin{minipage}[c]{0.3\textwidth}
      \caption{The differential cross section as a function of the
        polar angle \(\theta\).}
    \end{minipage}
  \end{figure}
\end{frame}

\begin{frame}{Comparison with \sherpa~\cite{Bothmann:2019yzt}}
  \begin{itemize}

  \item<1-> choose \result{xs/python/eta} and \result{xs/python/ecm}
    and integrate XS
    \begin{equation}
      \label{eq:total-crossec}
      \sigma = {\frac{\pi\alpha^2Z^4}{3\ecm^2}}\cdot\qty[\tanh(\eta_2) - \tanh(\eta_1) + 2(\eta_1
      - \eta_2)]
    \end{equation}
  \item<2-> analytical result: \result{xs/python/xs}
  \item<3-> compatible with \sherpa: \result{xs/python/xs_sherpa}
  \end{itemize}
  \begin{figure}[ht]
    \centering
    \begin{minipage}[c]{0.3\textwidth}
      \plot[scale=.5]{xs/total_xs}
    \end{minipage}
    \begin{minipage}[c]{0.3\textwidth}
      \caption{\label{fig:totxs} The cross section of the process for
        a pseudo-rapidity integrated over \([-\eta, \eta]\).}
    \end{minipage}
  \end{figure}
\end{frame}

\section{Monte Carlo Methods}

\begin{frame}
\pnote{
  - Gradually bring in knowledge through distribution.  }
  \begin{block}{Basic Ideas}
    \begin{itemize}
    \item<+-> Given some unknown function
      \(f\colon \vb{x}\in\Omega\subset\mathbb{R}^n\mapsto\mathbb{R}\)
      \ldots
    \item<+-> \ldots\ how do we answer questions about \(f\)?
    \end{itemize}
    \;\;\onslide<+->{\(\implies\) Sample it at random points.}
  \end{block}
  \pause
  \begin{block}{Main Applications}
    \begin{enumerate}
    \item<+-> integrate \(f\) over some volume \(\Omega\)
    \item<+-> treat \(f\) as distribution and take random samples
    \end{enumerate}
  \end{block}
\end{frame}

\subsection{Integration}

\begin{frame}
\pnote{
- omitting details (law of big numbers, central limit theorem)\\
- at least three angles of attack\\
- some sort of importance sampling, volume: stratified sampling\\
- ADVANTAGES OF MC
- METHOD NAMES}
\begin{itemize}
  \item<+-> we have:
    \(f\colon \vb{x}\in\Omega\subset\mathbb{R}^n\mapsto\mathbb{R}\)
    and \(\rho\colon \vb{x}\in\Omega\mapsto\mathbb{R}_{> 0}\) with
    \(\int_{\Omega}\rho(\vb{x})\dd{\vb{x}} = 1\).
  \item<+-> we seek:
    \begin{equation}
      \label{eq:baseintegral}
      I = \int_\Omega f(\vb{x}) \dd{\vb{x}}
      \onslide<+->{= \int_\Omega
        \qty[\frac{f(\vb{x})}{\rho(\vb{x})}] \rho(\vb{x}) \dd{\vb{x}} = \EX{\frac{F}{\Rho}}}
    \end{equation}
  \item<+-> numeric approximation:
    \begin{equation}
      \label{eq:approxexp}
      \EX{\frac{F}{\Rho}} \approx
      \frac{1}{N}\sum_{i=1}^N\frac{f(\vb{x_i})}{\rho(\vb{x_i})}
      \xrightarrow{N\rightarrow\infty} I
    \end{equation}
  \item<+-> error approximation:
    \begin{align}
      \sigma_I^2 &= \frac{\textcolor<+->{blue}{\sigma^2}}{\textcolor<.->{red}{N}} \\
      \sigma^2 &= \VAR{\frac{F}{\Rho}} = \int_{\textcolor<+(3)->{blue}{\Omega}} \qty[I -
                 \frac{f(\vb{x})}{\textcolor<+->{blue}{\rho(\vb{x})}}]^2
                 \textcolor<.->{blue}{\rho(\vb{x})} \textcolor<+->{blue}{\dd{\vb{x}}} \approx \frac{1}{N - 1}\sum_i \qty[I -
                 \frac{f(\vb{x_i})}{\rho(\vb{x_i})}]^2  \label{eq:varI-approx}
    \end{align}
  \end{itemize}
\end{frame}

\begin{frame}{Naive Integration Change of Variables}
  Choose \(\rho(\vb{x}) = \frac{1}{\abs{\Omega}}\)
  \onslide<1->{\(\implies I=\frac{\abs{\Omega}}{N}\sum_{i=1}^N
    f(\vb{x_i})=\abs{\Omega}\cdot\bar{f}\) and
    \(\VAR{\frac{F}{P}}\approx\frac{\abs{\Omega}^2}{N-1}\sum_{i}\qty[f(\vb{x}_i)
    - \bar{f}]^2\)}
  \pause
  \begin{results}
    \begin{itemize}
    \item<3-> integrating \(\dv{\sigma}{\theta}\) with target error of
      \(\sigma = \SI{1e-3}{\pico\barn}\) takes
      \result{xs/python/xs_mc_N} samples
    \item<4-> integrating \(\dv{\sigma}{\eta}\) takes just
      \result{xs/python/xs_mc_eta_N} samples
    \end{itemize}
  \end{results}
  \begin{figure}[hb]
    \centering \onslide<3->{
      \begin{subfigure}[c]{.41\textwidth}
        \centering \plot[width=\columnwidth]{xs/xs_integrand}
      \end{subfigure}
    } \onslide<4->{
      \begin{subfigure}[c]{.41\textwidth}
        \centering \plot[width=\columnwidth]{xs/xs_integrand_eta}
      \end{subfigure}
    }
  \end{figure}
\end{frame}

\begin{frame}{\vegas\ Algorithm \cite{Lepage:19781an}}
\pnote{
- proposed by G. Peter Lepage (slac) 1976 \\
- own implementation!!!
}
  \begin{columns}
    \begin{column}{.5\textwidth}
      \begin{block}{Idea}
        \begin{enumerate}
        \item subdivide integration volume into grid, take equal
          number of samples in each hypercube \(\iff\) define \(\rho\)
          as step function
        \item iteratively approximate optimal \(\rho = f(\vb{x})/I\)
          with step function
        \item this is quite efficient when \(n\geq 4\)
        \end{enumerate}
      \end{block}
      \pause
      \begin{results}
        \begin{itemize}
        \item Total function evaluations:
        \result{xs/python/xs_mc_θ_vegas_N}\\
        (for same accuracy as before)
        \end{itemize}
      \end{results}
    \end{column}
    \begin{column}{.5\textwidth}
      \begin{figure}[ht]
        \centering \plot[scale=.6]{xs/xs_integrand_vegas}
        \caption{\(2\pi\dv{\sigma}{\theta}\) scaled to increments
          found by \vegas}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}

\subsection{Sampling}

\begin{frame}{Why Samples?}
  \begin{itemize}[<+->]
  \item same format as experimental data: direct comparison
  \item easy to generate distributions for other observables
  \item events can be ``dressed'' with additional effects
  \end{itemize}
\end{frame}

\begin{frame}
\pnote{
- prop. to density
- generalization to n dim is easy
- idea -> cumulative propability the same
}
\begin{itemize}[<+->]
  \item we have: \(f\colon x\in\Omega\mapsto\mathbb{R}_{>0}\)
    (choose \(\Omega = [0, 1]\)) and uniformly random samples \(\{x_i\}\)
  \item we seek: a sample \(\{y_i\}\) distributed according to \(f\)
  \end{itemize}
  \begin{block}<+->{Basic Idea}
    \begin{itemize}[<+->]
    \item<.-> let \(x\) be sample of uniform distribution, solve
      \[\int_{0}^{y}f(x')\dd{x'} = x\cdot\int_0^1f(x')\dd{x'} =
        x\cdot A\] for y to obtain sample of \(f/A\)
    \item let \(F\) be the antiderivative of \(f\), then
      \(y=F^{-1}(x\cdot A + F(0))\)
      \begin{itemize}
      \item sometimes analytical form available
      \item otherwise tackle that numerically
      \end{itemize}
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Hit or Miss}
  \centering
  \animategraphics[loop,scale=.4,autoplay,palindrome]{5}{pi/pi-}{0}{9}
\end{frame}

\begin{frame}{Hit or Miss}
  \begin{block}{Basic Idea}
    \begin{itemize}[<+->]
    \item take samples \({x_i}\) distributed according to \(g/B\),
      where \(B=\int_0^1g(x)\dd{x}\) and
      \(\forall x\in\Omega\colon g(x)\geq f(x)\)
    \item accept each sample with the probability~\(f(x_i)/g(x_i)\)
      (importance sampling)
    \item total probability of accepting a sample: \(\mathfrak{e} =
      A/B \leq 1\) (efficiency)
    \item simplest choice \(g=\max_{x\in\Omega}f(x)=f_{\text{max}}\)
    \item again: efficiency gain through reduction of variance
    \end{itemize}
  \end{block}

  \begin{results}<+->[Results with \(g=f_{\text{max}}\)]
    \begin{itemize}[<+->]
    \item<.-> sampling \(\dv{\sigma}{\cos\theta}\):
      \result{xs/python/naive_th_samp}
    \item sampling \(\dv{\sigma}{\eta}\):
      \result{xs/python/eta_eff}
    \end{itemize}
  \end{results}
\end{frame}

\begin{frame}{Hit or Miss}
  \begin{columns}
    \begin{column}{.4\textwidth}
      \begin{results}<+->[Results with \(g=a\cdot x^2 + b\)]
        \begin{itemize}
        \item<+-> Modest efficiency gain:
          \result{xs/python/tuned_th_samp}

        \item<+-> Of course, we can use \vegas\ to provide a better
          \(g\implies\) \result{xs/python/strat_th_samp} \pnote{Has
            problems, not discussing now.}
          \begin{itemize}
          \item<+-> this approach leads to problems when \(f\) is not
            smooth or \emph{very} small some regions
          \end{itemize}
        \end{itemize}
      \end{results}
    \end{column}
    \begin{column}{.6\textwidth}
      \begin{figure}[ht]
        \centering \plot[scale=.8]{xs_sampling/upper_bound}
        \caption{The distribution \(\dv{\sigma}{\cos\theta}\) and an
          upper bound of the form \(a + b\cdot x^2\).}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}{Stratified Sampling}
  \begin{columns}
    \begin{column}{.6\textwidth}
      \begin{block}{Basic Idea}
        \begin{itemize}
        \item subdivide sampling volume \(\Omega\) into \(K\)
          subvolumes \(\Omega_i\)
        \item let \(A_i = \int_{\Omega_i}f(x)\dd{x}\)
        \item take \(N_i=\frac{A_i}{\sum_jA_j} \cdot N\) samples in
          each subvolume
        \item efficiency is given by:
          \(\mathfrak{e} = \frac{\sum_i A_i}{\sum_i
            A_i/\mathfrak{e}_i}\)
        \end{itemize}
        \(\implies\) can optimize in each subvolume independently
      \end{block}
    \end{column}
    \pause
    \begin{column}{.4\textwidth}
      \begin{center}
        {\LARGE
          How do we choose the \(\Omega_i\)? \pause\\
          \vspace{1em}
          \(\implies\) \vegas!  :-) }
      \end{center}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}{Observables}
\pnote{
- no need to know the jacobian ;)
}
\begin{itemize}
  \item we want: distributions of other observables \pause
  \item turns out: simpliy piping samples \(\{x_i\}\) through a map
    \(\gamma\colon\Omega\mapsto\mathbb{R}\) is enough
  \end{itemize}
  \pause
  \begin{figure}[p]
    \centering
  \begin{subfigure}[b]{.49\textwidth}
    \centering \plot[scale=.7]{xs_sampling/histo_sherpa_eta}
  \end{subfigure}
  \begin{subfigure}[b]{.49\textwidth}
    \centering \plot[scale=.7]{xs_sampling/histo_sherpa_pt}
  \end{subfigure}
\end{figure}
\end{frame}

\section{A Simple Proton Scattering Event Generator}

\subsection{Parton Density Functions}
\begin{frame}
  \begin{itemize}[<+->]
  \item free quarks are not observed \(\implies\) we have to look at
    hadron collisions
  \item parton density functions (PDFs) are a necessary tool
  \end{itemize}
  \pause
  \begin{block}{Basic Idea (Leading Order)}
    \begin{itemize}
    \item probability density to encounter a parton \(i\) at momentum
      fraction \(x\) and factorization scale \(Q^2\): given by
      \(f_i(x;Q^2)\)
    \item total cross section for a partonic process in the hadron
      collision:
      \begin{equation}
        \label{eq:pdf-xs}
        \sigma_{ij} = \int f_i\qty(x_1;Q^2) f_j\qty(x_2;Q^2) \hat{\sigma}_{ij}\qty(x_1,
        x_2, Q^2)\dd{x_1}\dd{x_2}
      \end{equation}
    \item have to be obtained experimentally (or through lattice QCD\cite{Bhat:2020ktg})
    \end{itemize}
  \end{block}
\end{frame}

\subsection{Implementation}

\begin{frame}
  \pnote{ - took longest time :P }
  \begin{columns}
    \begin{column}{.4\textwidth}
      \begin{block}{What do we need?}
        \begin{itemize}[<+->]
        \item partonic cross section and kinematics in lab frame
        \item \(Q^2\pause = 2x_1x_2E_p^2\) \pause
        \item PDF\pause :
          \texttt{NNPDF31\_lo\_as\_0118}~\cite{NNPDF:2017pd} \pause
        \item beam energies and cuts:\pause
          \begin{itemize}
          \item \result{xs/python/pdf/e_proton}
          \item \result{xs/python/pdf/eta} and
            \result{xs/python/pdf/min_pT}
          \end{itemize}
        \item integration and sampling method: \pause \vegas\ +
          stratified sampling
        \end{itemize}
      \end{block}
    \end{column}
    \begin{column}{.6\textwidth}
      \only<+>{
        \begin{figure}
          \centering \plot[width=\columnwidth]{pdf/dist3d_x2_const}
          \caption{\label{fig:dist-pdf}Differential cross section
            convolved with PDFs for fixed \protect
            \result{xs/python/pdf/second_x} in picobarn.}
        \end{figure}
      } \only<+>{
        \begin{figure}
          \centering \plot[width=\columnwidth]{pdf/dist3d_eta_const}
          \caption{\label{fig:dist-pdf-fixed-eta}Differential cross
            section convolved with PDFs for fixed \protect
            \result{xs/python/pdf/plot_eta} in picobarn.}
        \end{figure}
      }
    \end{column}
  \end{columns}
\end{frame}

\subsection{Results}
\begin{frame}{Cross Section}
  \begin{center}
    {\huge\result{xs/python/pdf/my_sigma}}
  \end{center}
  \begin{itemize}
  \item compatible with \sherpa\
  \item achieved \result{xs/python/pdf/samp_eff}
  \item using \result{xs/python/pdf/num_increments} hypercubes
  \end{itemize}
\end{frame}

\begin{frame}[allowframebreaks]{Observables}
  \begin{figure}[hp]
    \centering
    \begin{subfigure}{.49\textwidth}
      \centering \plot[width=1\columnwidth]{pdf/eta_hist}
    \end{subfigure}
    \begin{subfigure}{.49\textwidth}
      \centering \plot[width=1\columnwidth]{pdf/cos_theta_hist}
    \end{subfigure}
    \begin{subfigure}{.49\textwidth}
      \centering \plot[width=1\columnwidth]{pdf/pt_hist}
    \end{subfigure}
    \begin{subfigure}{.49\textwidth}
      \centering \plot[width=1\columnwidth]{pdf/inv_m_hist}
    \end{subfigure}
  \end{figure}
\end{frame}


\section{Penomenological Studies}

\begin{frame}{What is missing?}
  \pause
  \begin{itemize}[<+->]
  \item treatement of the beam remnants
  \item intrinsic \(\pt\)
  \item parton showers \pnote{NLO effects}
  \item hadronization
  \item (NLO matrix elements)
  \item multiple interactions
  \end{itemize}
  \pause \(\implies\) \sherpa\ can model those effects
\end{frame}


\subsection{Set-Up}
\begin{frame}
  \pnote{ - cuts and energies same as before\\
    - pun intended\\
    - now discuss impact}
  \begin{itemize}
  \item same phase-space cuts and energies as before
  \item isolation cone cuts
  \end{itemize}

  \begin{block}{The five Stages}
    \begin{description}
    \item[LO] as before
    \item[LO+PS] parton showers with
      \emph{CSShower}~\cite{schumann2008:ap}
    \item[LO+PS+pT] beam remnants and primordial \(\pt\)
    \item[LO+PS+pT+Hadronization] hadronization with
      \emph{Ahadic}~\cite{Winter2003:tt}.
    \item[LO+PS+pT+Hadronization+MI] Multiple Interactions (MI) with
      \emph{Amisic}~\cite{Bothmann:2019yzt}
    \end{description}
  \end{block}
\end{frame}

\subsection{Results}

\begin{frame}{Transverse Momentum of the \(\gamma\gamma\) System}
  \begin{columns}
    \begin{column}{.5\textwidth}
      \begin{figure}[ht]
          \rivethist[width=\columnwidth]{pheno/total_pT}
      \end{figure}
    \end{column}
    \begin{column}{.5\textwidth}
      \begin{itemize}
      \item photon system acquires recoil momentum
      \item primordial \(\pt\) enhances xs in low momentum regions
      \end{itemize}
    \end{column}
  \end{columns}
\pnote{
  - parton shower: col-linear limit\\
  - others the same
}
\end{frame}

\begin{frame}{Transverse Momentum of the leading Photon}
  \begin{columns}
    \begin{column}{.5\textwidth}
      \begin{figure}[ht]
          \rivethist[width=\columnwidth]{pheno/pT}
      \end{figure}
    \end{column}
    \begin{column}{.5\textwidth}
      \begin{itemize}
      \item boost to higher \(\pt\)
      \item all but \stone\ stage largely compatible
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}{Invariant Mass of the \(\gamma\gamma\) System}
  \begin{columns}
    \begin{column}{.5\textwidth}
      \begin{figure}[ht]
          \rivethist[width=\columnwidth]{pheno/inv_m}
      \end{figure}
    \end{column}
    \begin{column}{.5\textwidth}
      \begin{itemize}
      \item events can be recoiled past the cuts (very rare)
      \item otherwise shape similar to the \stone\ stage
        \begin{itemize}
        \item largely governed by the PDF
        \end{itemize}
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}{Angular Distributions}
  \begin{figure}[ht]
    \rivethist[width=.49\columnwidth]{pheno/eta}
    \rivethist[width=.49\columnwidth]{pheno/cos_theta}
  \end{figure}
\end{frame}

\begin{frame}{Conclusions}
  \begin{itemize}
  \item parton showering and primordial \(\pt\) have biggest effect on
    shape
  \item hadronization and multiple interactions give rise to isolation
    effects
  \item for angular observables the \stone\ case gives a reasonably
    good qualitative picture
  \end{itemize}
  \pnote{
- no qed showers\\
- nlo me
}
\end{frame}

\section{Summary}
\begin{frame}
  \begin{columns}
    \begin{column}{.7\textwidth}
      We have...
      \begin{itemize}
      \item calculated the cross section for \(\qqgg\)
      \item studied and implemented Monte Carlo integration and
        sampling
        \begin{itemize}
        \item using in \vegas\ whenever possible :)
        \end{itemize}
      \item built a simple \(\ppgg\) event generator
      \item looked further down the road with sherpa
      \end{itemize}
    \end{column}
    \pause
    \begin{column}{.3\textwidth}
      \includegraphics[width=\columnwidth]{questions.jpeg}
    \end{column}
  \end{columns}
  \begin{center}
    {\huge Thanks for your attention! Questions: Now!}
  \end{center}
\end{frame}


\begin{frame}[allowframebreaks]
  \frametitle{References}
  \printbibliography
\end{frame}

\appendix
\section{Appendix}

\begin{frame}{\vegas\ Details}
  \begin{columns}
    \begin{column}{.6\textwidth}
      \begin{block}{Algorithm 1D}
        \begin{enumerate}
        \item start with \(N\) evenly spaced increments
          \(\{[x_i, x_{i+1}]\}_{i\in\overline{1,N}}\)
        \item calculate the integral weights
          \(w_i = \abs{\int_{x_i}^{x_{i+1}}f(x)\dd{x}}\) and define
          \(W=\sum_iw_i\)
          \begin{itemize}
          \item this is done with ordinary MC integration
          \end{itemize}
        \item calculate subdivide the \(i\)-th increment into
          \(K\frac{w_i}{W}\) increments (round up), where
          \(K = \mathcal{O}(1000)\)
        \item amalgamate the new increments into \(N\) groups \(=\)
          new increments
        \end{enumerate}
      \end{block}
    \end{column}
    \pause
    \begin{column}{.4\textwidth}
      \begin{block}{Advantages}
        \begin{itemize}
        \item number of \(f\) evaluations independent of number of
          hypercubes
        \item adaption itself is adaptive
        \item \textcolor{red}{the advantages only show if \(n\)
            ``high''.}
        \end{itemize}
      \end{block}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}
  \begin{figure}[ht]
    \centering \plot[scale=.9]{xs/xs_integrand_vegas}
    \caption{\(2\pi\dv{\sigma}{\theta}\) scaled to increments found by
      \vegas}
  \end{figure}
\end{frame}

\begin{frame}{\vegas\ + Hit or Miss}
\begin{figure}[ht]
  \centering
  \begin{subfigure}{.49\textwidth}
    \centering
    \plot[scale=.8]{xs_sampling/vegas_strat_dist}
    \caption[The distribution for \(\cos\theta\), derived from the
    differential cross-section and the \vegas-weighted
    distribution]{\label{fig:vegasdist} The distribution for
      \(\cos\theta\) and the \vegas-weighted
      distribution.}
  \end{subfigure}
  \begin{subfigure}{.49\textwidth}
    \centering
    \plot[scale=.8]{xs_sampling/vegas_rho}
    \caption[The weighting distribution generated by
    \vegas.]{\label{fig:vegasrho} The weighting distribution generated
      by \vegas. It is clear, that it closely follows the original
      distribution.}
  \end{subfigure}
  \caption{\label{fig:vegas-weighting} \vegas-weighted distribution
    and weighting distribution.}
\end{figure}
\end{frame}
\begin{frame}{Compatibility of Histograms}
  The compatibility of histograms is tested as described
in~\cite{porter2008:te}. The test value
is \[T=\sum_{i=1}^k\frac{(u_i-v_i)^2}{u_i+v_i}\] where \(u_i, v_i\)
are the number of samples in the \(i\)-th bin of the histograms
\(u,v\) and \(k\) is the number of bins. This value is \(\chi^2\)
distributed with \(k\) degrees, when the number of samples in the
histogram is reasonably high. The mean of this distribution is \(k\)
and its standard deviation is \(\sqrt{2k}\). The value
\[P = 1 - \int_0^{T}f(x;k)\dd{x}\] states with which probability the
\(T\) value would be greater than the obtained one, where \(f\) is the
probability density of the \(\chi^2\) distribution. Thus
\(P\in [0,1]\) is a measure of confidence for the compatibility of the
histograms. These formulas hold, if the total number of events in both
histograms is the same.
\end{frame}

\begin{frame}{Cut Flow}
\pnote{
- 2 kinds of impact: phase space and isolation\\
- these effects have an impact on fiducial xs\\
- PS, pT more phase space\\
- Hadr. and MI isolation
}
  \begin{table}[ht]
    \centering
    \begin{tabular}{l|SSS}
      &&\multicolumn{2}{c}{events discarded by cuts} \\
      Stage & {\(\sigma\) [\si{\pico\barn}]} & {phase space
                                               [\si{\percent}]} &
                                                                  {isolation
                                                                  [\SI{1e-4}{\percent}]} \\
      \toprule
      \stfive & 33.02(7) & 97.63 & 9.56 \\
      \stfour & 34.08(7) & 97.56 & 1.89\\
      \stthree & 33.97(7) & 97.56 & 3.52 \\
      \sttwo & 34.60(7) & 97.52 & 3.63 \\
      \stone & 38.74(7) & 96.77 & 0 \\

    \end{tabular}
    \caption{\label{tab:xscut}Cross sections and cut statistics.}
  \end{table}
\end{frame}

\begin{frame}
  \begin{figure}[ht]
    \rivethist[width=.49\columnwidth]{pheno/azimuthal_angle}
    \rivethist[width=.49\columnwidth]{pheno/pT_subl}
  \end{figure}
\end{frame}

\begin{frame}
  \begin{figure}[ht]
    \rivethist[width=.49\columnwidth]{pheno/azimuthal_angle}
    \rivethist[width=.49\columnwidth]{pheno/pT_subl}
  \end{figure}
\end{frame}

\begin{frame}
  \begin{figure}[ht]
    \rivethist[width=.49\columnwidth]{pheno/o_angle}
    \rivethist[width=.49\columnwidth]{pheno/o_angle_cs}
  \end{figure}
\end{frame}
\end{document}
