\chapter{ROOT analysis routines}
Two young researchers\footnote{Matteo Alfonsi (CERN) and Gabriele Croci (PhD student at the University of Siena)} from \textbf{RD51} built the low-level macros used to convert the binary output of the detectors to much more physicist-friendly ROOT \texttt{n-tuple}s.\\

My personal work consisted in writing down some routines in order to extract efficiency values from specific \textit{n-tuple}s, and make the data accessible via plots. The following pages collect the most significant pieces of code I wrote. In order to meet different data sets, raw data file names and break conditions should be modified.\\

\lstset{language=C++, basicstyle=\tiny, breaklines=true, frame=single, caption=\lstname, captionpos=t}

%\lstset{
%language=C++,
%basicstyle=\tiny%\ttfamily,
%commentstyle=\ttfamily%\color{gray},
%numbers=left,
%numberstyle=\footnotesize\ttfamily%\color{gray}\footnotesize,
%stepnumber=1,
%numbersep=5pt,
%%backgroundcolor=\color{white},
%showspaces=false,
%showstringspaces=false,
%showtabs=false,
%frame=single,
%tabsize=2,
%captionpos=b,
%breaklines=true,
%breakatwhitespace=false,
%title=\lstname,
%escapeinside={},
%keywordstyle={},
%morekeywords={}
%}

\section{Data reconstructing algorithms}

\lstset{caption=Builder.C}
	\lstinputlisting{Parts/Software/Builder.C}


\lstset{caption=Recoizer.C}
	\lstinputlisting{Parts/Software/Recoizer.C}


\lstset{caption=effex2.C}
	\lstinputlisting{Parts/Software/effex2.C}
	
%\lstset{caption=efficiency.cc}
%	\lstinputlisting{Parts/Software/efficiency.cc}
	
%\lstset{caption=nevents.cc}
%	\lstinputlisting{Parts/Software/nevents.cc}

\lstset{caption=efferrors.cc}
	\lstinputlisting{Parts/Software/efferrors.cc}

	
\lstset{caption=GetOffsets.cpp}
	\lstinputlisting{Parts/Software/GetOffsets.cpp}

	
\lstset{caption=Macro-CalibrationScanAndFit.C}
	\lstinputlisting{Parts/Software/Macro-CalibrationScanAndFit.C}


\section{Scan-specific algorithms}
\lstset{caption=EffRadius.cc}
	\lstinputlisting{Parts/Software/EffRadius.cc}

	
\lstset{caption=EffOverJunction.cpp}
	\lstinputlisting{Parts/Software/EffOverJunction.cpp}

	
\lstset{caption=EffradNoise.C}
	\lstinputlisting{Parts/Software/EffradNoise.C}
	
%	\lstinputlisting{Parts/Software/GasComparisonHV.C}
	
%	\lstinputlisting{Parts/Software/HVscanAmacro.C}
	
%	\lstinputlisting{Parts/Software/HVscanARCO2CF4.C}
	
%	\lstinputlisting{Parts/Software/HVscanHadronsBW.cpp}
	
\lstset{caption=HVscanPmacro.C}
	\lstinputlisting{Parts/Software/HVscanPmacro.C}
	
%	\lstinputlisting{Parts/Software/MSPLgasComparison.cpp}
	
%	\lstinputlisting{Parts/Software/MSPLscan867-902.C}
	
%	\lstinputlisting{Parts/Software/MSPLscan903-920.C}
	
\lstset{caption=MSPLscanPmacro.C}
	\lstinputlisting{Parts/Software/MSPLscanPmacro.C}
	
%	\lstinputlisting{Parts/Software/MuPiComp.C}
	
%	\lstinputlisting{Parts/Software/THscanAmacro.C}
	
\lstset{caption=THscanPmacro.C}
	\lstinputlisting{Parts/Software/THscanPmacro.C}

	
\lstset{caption=CPScan.cc}
	\lstinputlisting{Parts/Software/CPScan.cc}