% This is a starting point for a presentation
% It expects to live in a subdirectory

\documentclass[xcolor=dvipsnames]{beamer}

\setbeamertemplate{navigation symbols}{}
%\setbeamertemplate{background}[grid][step=1cm]
\useoutertheme{infolines}

\usepackage{tikz}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{color}
\usepackage{hyperref}
\author{Brett Viren}
\institute[BNL] % (optional, but mostly needed)
{
  Physics Department

  \includegraphics[height=1.5cm]{../common/dyb_logo}
  \includegraphics[height=1.5cm]{../common/bnl-logo}
  \includegraphics[height=1.5cm]{../common/dyw_logo}
}
\title[GenDecay]{GenDecay: Data Driven, General Radioactive Decay Generator and GenTool \\ (DocDB 3700)}
\date[090609]{09/06/11 DB Simulation WS}

\newcommand{\fixme}[1]{\textbf{FIXME:} \textit{#1}}

\newlength{\overlaywd}
\newlength{\overlayht}
\newcommand{\overlay}[4]{%
  \settowidth{\overlaywd}{#2}\settoheight{\overlayht}{#2}%
  \raisebox{#4\overlayht}{%
    \makebox[0pt][l]{\hspace{#3\overlaywd}%
      #1}}%
  #2}%

\begin{document}
\lstset{%
  emphstyle=\color{red},
  keywordstyle=\color{black}\bfseries,
  basicstyle=\footnotesize,
  identifierstyle=\color{DarkOrchid}\ttfamily,
  commentstyle=\color{Brown}\ttfamily,
  stringstyle=\color{blue}\ttfamily,
  showstringspaces=false}

\begin{frame}
  \titlepage
\end{frame}
\begin{frame}
  \frametitle{Outline}
  \tableofcontents    
\end{frame}

\section{Current Radioactivity Generators}

\begin{frame}
  \frametitle{Current state of radioactivity generators}
  \begin{itemize}
  \item Implemented as mostly unrelated, stand-alone executables
    producing HepEVT formatted output.
  \item Do not integrate well into Gaudi/GenTools.
    \begin{itemize}
    \item No way to set correct number of events
    \item Different random number generators than Geant4/Gaudi
    \end{itemize}
  \item Some implemented in FORTRAN.
  \item U/Th generators are cryptic\footnote{My opinion.}, with hard coded and some incorrectness.
  \end{itemize}
\end{frame}

\section{The \texttt{GenDecay} Package}

\begin{frame}
  \frametitle{Guiding Principles for Developing \texttt{GenDecay}}
  \begin{itemize}
  \item Use ``official'' nuclear decay data.\footnote{\url{http://www.nndc.bnl.gov/ensdf/}}
  \item Allow data to be updated - no hard coding.
  \item Data driven: let decay data define the decay chain, do not setup unphysical decay chains or miss branches.
  \item Keep decay ``engine'' and GenTool codes separate.
  \item Allow flexibility, make no assumptions on relative/absolute
    radioactive parent abundances nor detection mechanism (detector correlation
    times).
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Evaluated Nuclear Structure Data File (ENSDF) Data Sets}
  
  ENSDF:
  \begin{itemize}
  \item Maintained by National Nuclear Data Center (NNDC) @
    BNL\footnote{\url{http://www.nndc.bnl.gov/}}.
  \item \textbf{Very} baroque format!  Cryptic, FORTRAN oriented. 
  \item $\alpha$ and $\beta$ decays tabulated
    differently from $\gamma$s
  \item Challenging to algorithmically form decay chain due to slight
    energy level inconsistencies.
  \item Geant4 has a digested version in \texttt{G4RadioactiveDecay}
    data files, but wary of provenance, conversion errors and if they
    are kept up to date.
  \end{itemize}
  ``\texttt{libmore}'' (mostly) to the rescue$\longrightarrow$
\end{frame}

\begin{frame}
  \frametitle{libmore}
  \begin{itemize}
  \item Free Software, C++ library by Petter Urkedal.
  \item Parses ENSDF files.
  \item Long time stable, now in bug-fix-only mode.
  \item Developer very helpful and has given me commit access for a few minor fixes.
  \item Installed by default after offline upgrade $\to$ trunk merge.\footnote{See DocDB 3571}
  \item For more info see: \url{http://more.sf.net/}
  \end{itemize}
  In-memory representation still follows ENSDF schema so must do some
  work to build up chains, particularly careful determination of
  daughter energy levels.

  \texttt{GenDecay} library $\longrightarrow$
\end{frame}

\begin{frame}
  \frametitle{GenDecay library: building a chain} 

  Forms a decay chain in the form of a directed graph of
  \texttt{NucState} objects connected by \texttt{NucDecay} objects.

  \begin{description}
  \item[\texttt{NucState}] Z/A, half life, energy level, collection of \texttt{NucDecay}
  \item[\texttt{NucDecay}] pointer to mother and daughter \texttt{NucState}'s, decay type, energy of radiation and decay fraction (branching ratio).
  \end{description}

  \overlay{Example: $^{238}$U $\alpha$-decays to $^{234}$Th}{\includegraphics[width=\textwidth]{U-238-to-Th-234}}{0.4}{0.9}

\end{frame}

\begin{frame}[fragile]
  \frametitle{Another interesting example: $^{234}$Th $\to$ $^{234}$Pa $\to$ $^{234}$U}

  \framezoom<1><2>[border](7.0cm,0.0cm)(1.cm,0.5cm)
  \framezoom<1><3>[border](3.7cm,0.7cm)(1.0cm,0.5cm)
  \framezoom<1><4>[border](7.0cm,0.0cm)(1.cm,0.5cm)
  \framezoom<1><5>[border](9.6cm,0.3cm)(1.0cm,0.5cm)
  %\pgfimage[width=\textwidth]{Th-234-to-Pa-234}    
  \pgfimage[width=\textwidth]{Th-234-to-U-234}    
  \begin{itemize}
  \item $^{234}$Th can \textcolor{blue}{$\beta$-decay} to
    $^{234}$Pa meta-stable E=74keV$^*$
    excited state.
    \begin{itemize}
    \item Unmeasured, small energy splitting between 74keV$^*$
      and 74keV states  (marked as ``[24]'' and ``[0]'' in the graph, respectively).
    \end{itemize}
  \item This \textbf{excited} state almost always (br=99.8\%)
    \textcolor{blue}{$\beta$-decays} directly to $^{234}$U ground or indirectly and
    sub-dominantly, but rich, spectra of \\ \textcolor{blue}{$\beta$}s +
    \textcolor{red}{$\gamma$}s.
  \item Only rarely (br=0.16\%) has isomeric transition (IT) to
    E=74keV, followed by \textcolor{red}{$\gamma$-decay} to $^{234}$Pa
    ground and $\beta$-decay to $^{234}$U states (note: their subsequent
    $\beta$-decays are not shown in graph).
  \end{itemize}
\end{frame}

\section{Comparison with current U/Th generators}

\begin{frame}
  \frametitle{Current U/Th Generators}
  Current U/Th generators by A. Peipke (\textcolor{red}{AP})
  \begin{itemize}
  \item DocDB 441, Jianglai Liu \& Christopher Mauger, 
    \begin{itemize}
    \item $\alpha$ and $\beta + \gamma$ spectra at kinematics level.
    \item below, will compare against this study.
    \end{itemize}
  \item DocDB 1408, Xiaobo Li, Liangjian Wen \& Jun Cao, 
    \begin{itemize}
    \item spectra at Geant4 PMT hit level.
    \end{itemize}
  \item Secular equilibrium (SE) and correlation time (CT) \\
    \begin{itemize}
    \item SE: daughters decay at same rate as mother,
    \item CT: unless their half life is less than some cut, then
      forced to decay along with mother.
    \item Correlation time for \textcolor{red}{AP} apparently $\sim$4
      days.\footnote{Based on the chain graphs in these documents.}
    \item Some decays will never be
      simulated in practice due to $\ll 4$ days simulation run.
    \end{itemize}
  \end{itemize}
\end{frame}


% \begin{frame}
%   \frametitle{Secular Equilibrium \& Imposed Correlation Time}
%   \begin{center}
%     \includegraphics[width=\textwidth]{th-232-chain-from-1408}    
%   \end{center}
%   Taken from DocDB 1408.
% \end{frame}

\begin{frame}[fragile]
  \frametitle{Simulation Parameters for Comparison}
    \vspace{10mm}
  \begin{minipage}[b]{0.4\textwidth}
    Focus on $^{238}$U 
    \begin{itemize}
    \item $10^6$ decays
    \item GenDecay: 1 second \& \\ 4 day correlation times
    \item DocDB 441 ROOT files from Jianglai
    \end{itemize}
    Plots to follow colored as: 
    \begin{itemize}
    \item \textbf{GenDecay in black}
    \item \textbf{\textcolor{red}{AP in red}}
    \end{itemize}
    Look at $\alpha$, $\beta$ and $\gamma$ spectra.
    \vspace{20mm}
  \end{minipage}%
  \begin{pgfpicture}{0}{0}{0.6\textwidth}{0.8\textheight}
    \pgfputat{\pgforigin}{\pgfimage[width=0.6\textwidth]{u-238-chain-from-1408}}
    \pgftext[base,at={\pgfpoint{4.5cm}{2cm}}] {From DocDB 1408}
  \end{pgfpicture}
\end{frame}


\begin{frame}[fragile]
  \frametitle{$E_\alpha$ ``lines''}
  Apparent issues with \textcolor{red}{AP} generator:
  \begin{itemize}
  \item Mismatch $\alpha$ lines: missing (branch not considered) or over represented (forced to decay with mother due to too-long correlation time).
    \begin{itemize}
    \item apparently a problem but not yet tracked down specifics
    \end{itemize}
  \item No daughter nucleus recoil ($\propto\frac{A-4}{A}$) $\Rightarrow E_\alpha \sim2\%$ too high.
  \item Artificial broadening due to low precision in HepEVT
    momentum.\footnote{Thanks Jianglai for tracking this down.}
  \end{itemize}

  \includegraphics[width=0.5\textwidth]{hist/u_4day_Ealpha}%
  \includegraphics[width=0.5\textwidth]{hist/u_4day_Ealpha_zoom}\\

\end{frame}

\begin{frame}[fragile]
  \frametitle{$E_\beta$ spectra}
  \includegraphics[width=0.5\textwidth]{hist/u_4day_Ebeta}%
  \includegraphics[width=0.5\textwidth]{hist/u_1sec_Ebeta}
  \begin{itemize}
  \item Mostly reproduce \textcolor{red}{AP} shape using 4 day correlation time.
  \item More realistic correlation time shows some missing beta energy.
  \item Missing is rare $^{214}$Bi $\alpha$-decay to \textcolor{blue}{$^{210}$Tl} which $\beta$-decays with $E_{\beta,max} = 4.4$ MeV
    \begin{itemize}
    \item \textbf{\textcolor{blue}{blue curve}} shows this contribution to \textbf{total} GenDecay spectrum.
    \end{itemize}
  \end{itemize}
\end{frame}


\begin{frame}[fragile]
  \frametitle{$E_\gamma$ spectra}
  \includegraphics[width=0.5\textwidth]{hist/u_4day_Egamma}%
  \includegraphics[width=0.5\textwidth]{hist/u_1sec_Egamma}

  Apparent \textcolor{red}{AP} generator problems:
  \begin{itemize}
  \item Many $\gamma$s not included.
  \item No $\gamma$s above $\sim$2.5MeV
    \begin{itemize}
    \item In GenDecay, these come from \textcolor{blue}{$^{214}$Bi} excited states.
    \item Not checked why \textcolor{red}{AP} generator lacks them.
    \end{itemize}
  \end{itemize}

\end{frame}

\section{Summary}

\begin{frame}
  \frametitle{Summary \& Future Work}
  Summary:
  \begin{itemize}
  \item A new data-driven, general-purpose radioactive decay generator
    engine and GenTool have been developed.
    \begin{itemize}
    \item Better integration with Gaudi and removes need for FORTRAN.
    \end{itemize}
  \item Some apparent deficiencies found with current $^{238}$U generator.
  \end{itemize}
  Future work (open to interested parties!):
  \begin{itemize}
  \item Check $^{232}$Th spectra in same manner as $^{238}$U.
  \item Convert other Radioactivity generators.
  \item Include other decays (eg. ``radiated'' N \& P)
  \item Survey for any not-yet-considered nuclei?
  \item Consider expanding scope / applying \texttt{libmore} to n-capture.\footnote{In talks with David.}
  \end{itemize}
\end{frame}

\end{document}
