% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 3.
%
% Seth Brown, Ph.D.
% sethbrown@drbunsen.org
%
% Compiled with XeLaTeX
% Dependencies:
%   Fontin Sans font (http://www.exljbris.com/fontinsans.html)
%
\documentclass{beamer}
\usepackage{pgf}
\usepackage{times}
\usepackage[T1]{fontenc}
%\usepackage[mathscr]{eucal}
%\usepackage{mathptmx}
%\usepackage{mathrsfs}
\usepackage{hyperref}
\usepackage{color}
\usepackage{graphicx}

% \usepackage{pgfpagfes}
% \setbeameroption{show notes on second screen}
%\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape]
\usepackage{xcolor}
%\usepackage[dvipsnames]{xcolor}
%\usepackage{amsfonts}
%\usepackage{amsmath}
% \usepackage[amssymb]{SIunits}
%\usepackage{natbib}
%\usepackage{amssymb}
\usepackage{hepparticles}
\usepackage{hepnicenames}
\usepackage{hepunits}
\usepackage{tikz}
\usepackage[english]{babel}
%%\usepackage{lmodern}
%\usepackage{feynmp}
% suppress navigation bar
\beamertemplatenavigationsymbolsempty
\usepackage[mathscr]{eucal}
\usepackage{mathrsfs}
\mode<presentation>
{
  \usetheme{bunsen}
  \setbeamercovered{transparent}
  \setbeamertemplate{items}[circle]
}

% set fonts
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{example}{Verbatim}{fontsize=\small}
\usepackage{listings}
  \usepackage{courier}
 \lstset{
         basicstyle=\footnotesize\ttfamily, % Standardschrift
         %numbers=left,               % Ort der Zeilennummern
         numberstyle=\tiny,          % Stil der Zeilennummern
         %stepnumber=2,               % Abstand zwischen den Zeilennummern
         numbersep=5pt,              % Abstand der Nummern zum Text
         tabsize=2,                  % Groesse von Tabs
         extendedchars=true,         %
         breaklines=true,            % Zeilen werden Umgebrochen
         keywordstyle=\color{red},
    		frame=b,         
 %        keywordstyle=[1]\textbf,    % Stil der Keywords
 %        keywordstyle=[2]\textbf,    %
 %        keywordstyle=[3]\textbf,    %
 %        keywordstyle=[4]\textbf,   \sqrt{\sqrt{}} %
         stringstyle=\color{white}\ttfamily, % Farbe der String
         showspaces=false,           % Leerzeichen anzeigen ?
         showtabs=false,             % Tabs anzeigen ?
         xleftmargin=17pt,
         framexleftmargin=17pt,
         framexrightmargin=5pt,
         framexbottommargin=4pt,
         %backgroundcolor=\color{lightgray},
         showstringspaces=false      % Leerzeichen in Strings anzeigen ?        
 }
 \lstloadlanguages{% Check Dokumentation for further languages ...
         %[Visual]Basic
         %Pascal
         %C
         C++
         %XML
         %HTML
         %Java
 }
    %\DeclareCaptionFont{blue}{\color{blue}} 

  %\captionsetup[lstlisting]{singlelinecheck=false, labelfont={blue}, textfont={blue}}
  \usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}

%\usepackage{gfsartemisia-euler}
%\usepackage[T1]{fontenc}
\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries}
\tikzstyle{decision} = [diamond, draw, fill=gray!20, 
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!10, 
    text width=5em, text centered, rounded corners, minimum height=2em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!10, node distance=3cm,
    minimum height=2em]

\tikzstyle{every picture}+=[remember picture]


\renewcommand{\PKs}{{\HepParticle{K}{S}{}\xspace}}
% color definitions
\usepackage{color}
\definecolor{uipoppy}{RGB}{225, 64, 5}
\definecolor{uipaleblue}{RGB}{96,123,139}
\definecolor{uiblack}{RGB}{0, 0, 0}

% caption styling
%\DeclareCaptionFont{uiblack}{\color{uiblack}}
%\DeclareCaptionFont{uipoppy}{\color{uipoppy}}
%\captionsetup{labelfont={uipoppy},textfont=uiblack}

% see the macros.tex file for definitions
\include{macros }

% title slide definition
\title{Software development}
%\subtitle{a bias report}
\author{Marcin Chrz\k{a}szcz}
\institute[Institute of Nuclear Physics]
{
Institute of Nuclear Physics,
\newline Polish Academy of Science,
\newline and INFN sezione di Pisa
}


\date{$23^{th}$ January 2013}

%--------------------------------------------------------------------
%                           Introduction
%--------------------------------------------------------------------

\begin{document}



\setbeamertemplate{background}
{\includegraphics[width=\paperwidth,height=\paperheight]{frontpage_bg_mine}}
\setbeamertemplate{footline}[default]

\begin{frame}
\vspace{1.1cm}
\begin{columns}
\column{2.75in}
  \titlepage

  \begin{center}
    \includegraphics[height=1.0cm,keepaspectratio ]{pic/ifj.png}
   \hspace{1cm}
   \includegraphics[height=1.5cm]{pic/babar.jpg}
      \hspace{1cm}
   \includegraphics[height=1.0cm]{pic/INFN.jpg}
   \end{center}
  \vspace{10cm}
\column{2.0in}
\end{columns}
\end{frame}

%--------------------------------------------------------------------
%                          OUTLINE
%--------------------------------------------------------------------




\section[Outline]{}
\begin{frame}
\tableofcontents
\end{frame}







%-------------------------------------------------------------------
%                          Introduction
%-------------------------------------------------------------------
%
% Set the background for the rest of the slides.
% Insert infoline
\setbeamertemplate{background}
 {\includegraphics[width=\paperwidth,height=\paperheight]{slide_bg}}
\setbeamertemplate{footline}[bunsentheme]



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamertemplate{background}
 {\includegraphics[width=\paperwidth,height=\paperheight]{slide_bg}}
\setbeamertemplate{footline}[bunsentheme]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Given task}
\begin{frame}
\only<1>{
\frametitle{Given task}
{~}
\begin{enumerate}

\item Truth Matching Ignores Final State Radiation(FSR).
\item Abi example: $\PDzero \to \pi K$ will not give MCtruth because the decay on list is  $\PDzero \to \pi K \gamma$
\item Task: correct this problem, with a on/off switch.
\end{enumerate}
}


\end{frame}



\section{Cod structure}
\begin{frame}

\frametitle{Cod structure}
\begin{columns}
\column{3.in}
\only<1>{
\begin{itemize}
\item The Top class is BtaMCAssoc, however the function is virtual =(
\item It's also defined in BtaMcAssocGHit, BtaMcAssocMicro, BtaMcAssocQuality, BtaMcAssocQuality,  
BtaMcAssocGHit
\item They are distributed over packages: BetaCoreTools, BetaMC and BetaMicroTruth.
\item Call mcFromReco is from BtaMcAssocMicro. Than it's checked that particle is a composite and if it is than mcFromRecoComposite is called. 
\end{itemize}

}

\only<2>{

\lstinputlisting[label=samplecode,caption=Oryginal declaration:]{softcode/oryginal.cc}

}

\only<3>{

\lstinputlisting[label=samplecode,caption=Implement switch:]{softcode/swich.cc}
\begin{small}
Definition of those functions have to be change in every inheritance class.  
\newline  There is a default argument set to false so old code written by others will not see the difference.
\end{small}
}


\column{1in}
\begin{figure}[h] 
\begin{center} 
\mbox{
	{\includegraphics[scale=0.34]{pic/classBtaMcAssoc.png}}
}

\end{center}
\end{figure}

\end{columns}

\end{frame}



\begin{frame}
\only<1>{
\frametitle{Real code}
{~}
\lstinputlisting[label=samplecode,caption=Implement switch:]{softcode/code.cc}
}

\end{frame}


\section{Tests}

\begin{frame}\frametitle{Tests}
I am lazzy =) For The $ \PDzero \to \pi K$ there exists a working code in the tutorial:

\center \href{https://bbr-wiki.slac.stanford.edu/bbr_wiki/index.php/Workbook_Tutorial/A_more_complex_example
}{LINK}
{~}
\end{frame}

\begin{frame}\frametitle{Before the modifications}
\begin{figure}[h] 
\begin{center} 
\mbox{
	{\includegraphics[scale=0.34]{pic/d0_old.png}}
}
\caption{183 events in data sample}
\end{center}
\end{figure}

\end{frame}


\begin{frame}\frametitle{After modifications and FSR==true}
\begin{figure}[h] 
\begin{center} 
\mbox{
	{\includegraphics[scale=0.34]{pic/do_new.png}}
}
\caption{230 events in data sample}
\end{center}
\end{figure}
For now looks ok. 
\end{frame}

\begin{frame}\frametitle{Consistency test old vs new with FSR == false}
\begin{figure}[h] 
\begin{center} 
\mbox{
	{\includegraphics[scale=0.2]{pic/d0_old.png}}
		{\includegraphics[scale=0.2]{pic/d0_old.png}}	
}

\end{center}
\end{figure}
Spot  difference =P. They have the same number of events:  183.


\end{frame}

\begin{frame}\frametitle{Consistency test 2}
Do we really get truth D0 in ntuple?

\begin{figure}[h] 
\begin{center} 
\mbox{
	{\includegraphics[scale=0.2]{pic/mc_mass.png}}
}

\end{center}
\end{figure}
I don't know different particle whith mass so close do $\PDzero$ so i think I can declare it that it works. (I also worked in decay tree =) )
\end{frame}







\end{document}
