]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/doc/doc.tex
Fix version number
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / doc / doc.tex
1 \documentclass[11pt]{article}
2 \renewcommand{\rmdefault}{ptm}
3 \usepackage{mathptmx}
4 \usepackage[margin=2cm,twoside,a4paper]{geometry}
5 \usepackage{amstext}
6 \usepackage{amsmath}
7 \usepackage[ruled,vlined,linesnumbered]{algorithm2e}
8 \usepackage{graphicx}
9 \usepackage{color}
10 \usepackage{units}
11 \usepackage{listings}
12 \usepackage[colorlinks,urlcolor=black,hyperindex,%
13             linktocpage,a4paper,bookmarks=true,%
14             bookmarksopen=true,bookmarksopenlevel=2,%
15             bookmarksnumbered=true]{hyperref}
16 %% \usepackage{bookmark}
17 \def\AlwaysText#1{\ifmmode\relax\text{#1}\else #1\fi}
18 \newcommand{\AbbrName}[1]{\AlwaysText{{\scshape #1}}}
19 \newcommand{\CERN}{\AbbrName{cern}}
20 \newcommand{\ALICE}{\AbbrName{alice}}
21 \newcommand{\SPD}{\AbbrName{spd}}
22 \newcommand{\ESD}{\AbbrName{esd}}
23 \newcommand{\AOD}{\AbbrName{aod}}
24 \newcommand{\INEL}{\AbbrName{inel}}
25 \newcommand{\INELONE}{$\AbbrName{inel}>0$}
26 \newcommand{\NSD}{\AbbrName{nsd}}
27 \newcommand{\FMD}[1][]{\AbbrName{fmd\ifx|#1|\else#1\fi}}
28 \newcommand{\OCDB}{\AbbrName{ocdb}}
29 \newcommand{\mult}[1][]{\ensuremath N_{\text{ch}#1}}
30 \newcommand{\dndetadphi}[1][]{{\ensuremath% 
31     \ifx|#1|\else\left.\fi%
32     \frac{d^2\mult{}}{d\eta\,d\varphi}%
33     \ifx|#1|\else\right|_{#1}\fi%
34 }}
35 \newcommand{\landau}[1]{{\ensuremath% 
36     \text{landau}\left(#1\right)}}
37 \newcommand{\dndeta}[1][]{{\ensuremath% 
38     \ifx|#1|\else\left.\fi%
39     \frac{1}{N}\frac{d\mult{}}{d\eta}%
40     \ifx|#1|\else\right|_{#1}\fi%
41 }}
42 \newcommand{\MC}{\AlwaysText{MC}}
43 \newcommand{\N}[2]{{\ensuremath N_{#1#2}}}
44 \newcommand{\NV}[1][]{\N{\text{V}}{#1}}
45 \newcommand{\NnotV}{\N{\not{\text{V}}}}
46 \newcommand{\NT}{\N{\text{T}}{}}
47 \newcommand{\NA}{\N{\text{A}}{}}
48 \newcommand{\Ngood}{{\ensuremath N_{\text{good}}}}
49 \newcommand{\GeV}[1]{\unit[#1]{\AlwaysText{GeV}}}
50 \newcommand{\TeV}[1]{\unit[#1]{\AlwaysText{TeV}}}
51 \newcommand{\cm}[1]{\unit[#1]{\AlwaysText{cm}}}
52 \newcommand{\secref}[1]{Section~\ref{#1}}
53 \newcommand{\figref}[1]{Figure~\ref{#1}}
54 \newcommand{\etaphi}{\ensuremath(\eta,\varphi)}
55 % Azimuthal acceptance
56 \newcommand{\Corners}{\ensuremath A^{\varphi}_{t}} 
57 % Acceptance due to dead strips
58 \newcommand{\DeadCh}{\ensuremath A^{\eta}_{v,i}\etaphi} 
59 \newcommand{\SecMap}{\ensuremath S_v\etaphi}
60 \setlength{\parskip}{1ex}
61 \setlength{\parindent}{0em}
62 \title{%
63   {\LARGE EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH}\\%
64   {\Large European Organization for Particle Physics}\\[2ex]%
65   {\normalsize%
66     \begin{tabular}[t]{@{}p{.25\textwidth}@{}%
67         p{.5\textwidth}@{}%
68         p{.25\textwidth}@{}}%
69       % \vfil%
70       \vfil
71       \includegraphics[keepaspectratio,width=.12\textwidth]{alice_logo_v3}%
72       \vfil%
73       &% 
74       \vfil
75       \begin{center}%
76         {\LARGE\bf Analysing the FMD data for $\dndeta$}%
77       \end{center}%
78       \vfil
79       &%
80       % \vfil%
81       \vfil
82       \begin{tabular}[t]{@{}p{.25\textwidth}@{}}
83         \hfill\includegraphics[keepaspectratio,width=.12\textwidth]{%
84           cernlogo}\\
85         \hfill ALICE--INT--2012--040 v2\\
86         \hfill \today%
87       \end{tabular}%
88       \vfil%
89     \end{tabular}}}
90 \author{Christian Holm
91   Christensen\thanks{\texttt{$\langle$cholm@nbi.dk$\rangle$}}\quad\&\quad
92   Hans Hjersing Dalsgaard\thanks{\texttt{$\langle$canute@nbi.dk$\rangle$}}\\ 
93   Niels Bohr Institute\\
94   University of Copenhagen}
95 \date{}
96 \begin{document}
97 \pdfbookmark{Analysing the FMD data for dN/deta}{top}
98 \maketitle 
99
100 \tableofcontents 
101 \section{Introduction}
102
103 This document describes the steps performed in the analysis of the
104 charged particle multiplicity in the forward pseudo--rapidity
105 regions.  The primary detector used for this is the \FMD{}
106 \cite{FWD:2004mz,cholm:2009}. 
107
108 The \FMD{} is
109 organised in 3 \emph{sub--detectors} \FMD{1}, \FMD{2}, and \FMD{3}, each
110 consisting of 1 (\FMD{1}) or 2 (\FMD{2} and~3) \emph{rings}.
111 The rings fall into two types: \emph{Inner} or \emph{outer} rings.
112 Each ring is in turn  azimuthally divided into \emph{sectors}, and each
113 sector is radially divided into \emph{strips}.  How many sectors,
114 strips, as well as the $\eta$ coverage is given in
115 \tablename~\ref{tab:fmd:overview}. 
116
117 \begin{table}[htbp]
118   \begin{center}
119     \caption{Physical dimensions of Si segments and strips.}
120     \label{tab:fmd:overview}
121     \vglue0.2cm
122     \begin{tabular}{|c|cc|cr@{\space--\space}l|r@{\space--\space}l|}
123       \hline
124       \textbf{Sub--detector/} &
125       \textbf{Azimuthal}&
126       \textbf{Radial} &
127       $z$ &
128       \multicolumn{2}{c|}{\textbf{$r$}} &
129       \multicolumn{2}{c|}{\textbf{$\eta$}} \\
130       \textbf{Ring}& 
131       \textbf{sectors} &
132       \textbf{strips} & 
133       \textbf{[cm]} &
134       \multicolumn{2}{c|}{\textbf{range [cm]}} &
135       \multicolumn{2}{c|}{\textbf{coverage}} \\
136       \hline
137       FMD1i & 20& 512& 320  &  4.2& 17.2& 3.68&  5.03\\
138       FMD2i & 20& 512&  83.4&  4.2& 17.2& 2.28&  3.68\\
139       FMD2o & 40& 256&  75.2& 15.4& 28.4& 1.70&  2.29\\
140       FMD3i & 20& 512& -75.2&  4.2& 17.2&-2.29& -1.70\\
141       FMD3o & 40& 256& -83.4& 15.4& 28.4&-3.40& -2.01\\
142       \hline
143     \end{tabular}
144   \end{center}
145 \end{table}
146
147 The \FMD{} \ESD{} object contains the scaled energy deposited $\Delta
148 E/\Delta E_{mip}$ for each of the 51,200 strips.  This is determined
149 in the reconstruction pass.  The scaling to $\Delta E_{mip}$ is done
150 using calibration factors extracted in designated pulser runs.  In
151 these runs, the front-end electronics is pulsed with an increasing
152 known pulse size, and the conversion factor from ADC counts to $\Delta
153 E_{mip}$  is determined \cite{cholm:2009}.  
154
155 The \SPD{} is used for determination of the position of the primary
156 interaction point.
157
158 The analysis is performed as a two--step process.  
159 \begin{enumerate}
160 \item The Event--Summary--Data (\ESD{}) is processed event--by--event
161   and passed through a number of algorithms, and
162   $\dndetadphi$ for each event is output to an Analysis--Object--Data
163   (\AOD{}) tree (see \secref{sec:gen_aod}).
164 \item The \AOD{} data is read in and the sub--sample of the data under
165   investigation is selected (e.g., \INEL{}, \INELONE{}, \NSD{}, or
166   some centrality class) and the $\dndetadphi$ histogram read in for
167   those events to build up $\dndeta$ (see \secref{sec:ana_aod}).
168 \end{enumerate}
169 The details of each step above will be expanded upon in the
170 following. 
171
172 In Appendix~\ref{app:nomen} is an overview of the nomenclature used in
173 this document. 
174
175
176
177 \section{Generating $\dndetadphi[i]$ event--by--event}
178 \label{sec:gen_aod}
179
180 When reading in the \ESD{}s and generating the $\dndetadphi$
181 event--by--event the following steps are taken (in order) for each
182 event $i$
183 \begin{description}
184 \item[Event inspection] The global properties of the event is
185   determined, including the trigger type and primary interaction
186   point\footnote{`Vertex' and `primary interaction point' will be used
187     interchangeably in the text, since there is no ambiguity with
188     particle production vertex in this analysis.} $z$ coordinate (see
189   \secref{sec:sub:event_inspection}).  
190 \item[Sharing filter] The \ESD{} object is read in and corrected for
191   sharing.  The result is a new \ESD{} object (see
192   \secref{sec:sub:sharing_filter}). 
193 \item[Density calculator] The (possibly un--corrected) \ESD{} object
194   is then inspected and an inclusive (primary \emph{and} secondary
195   particles), per--ring charged particle density
196   $\dndetadphi[incl,r,v,i]$ is made.  This calculation depends in
197   general upon the interaction vertex position along the $z$ axis
198   $v_z$ (see \secref{sec:sub:density_calculator}).
199 \item[Corrections] The 5 $\dndetadphi[incl,r,v,i]$ are corrected for
200   secondary production and acceptance.  The correction for the
201   secondary particle production is highly dependent on the vertex $z$
202   coordinate.  The result is a per--ring, charged primary particle
203   density $\dndetadphi[r,v,i]$ (see \secref{sec:sub:corrector}). 
204 \item[Histogram collector] Finally, the 5 $\dndetadphi[r,v,i]$ are
205   summed into a single $\dndetadphi[v,i]$ histogram, taking care of
206   the overlaps between the detector rings.  In principle, this
207   histogram is independent of the vertex, except that the
208   pseudo--rapidity range, and possible holes in that range, depends on
209   $v_z$ --- or rather the bin in which the $v_z$ falls (see
210   \secref{sec:sub:hist_collector}).
211 \end{description}
212
213 Each of these steps will be detailed in the following. 
214
215 \subsection{Event inspection}
216 \label{sec:sub:event_inspection}
217
218 The first thing to do, is to inspect the event for triggers.  A number
219 of trigger bits, like \INEL{} (Minimum Bias for Pb+Pb), \INELONE{}, \NSD{}, and so on is then
220 propagated to the \AOD{} output.  
221
222 Just after the sharing filter (described below) but before any further
223 processing, the vertex information is queried.  If there is no vertex
224 information, or if the vertex $z$ coordinate is outside the
225 pre--defined range, then no further processing of that event takes place. 
226
227 \subsubsection{Displaced Vertices}
228 \label{sec:sub:sub:dispvtx}
229
230 The analysis can be set up to run on the `displaced vertices' that
231 occur during LHC Pb+Pb running. Details on the displaced vertices, and
232 their selection can be found in the VZERO analysis note \cite{maxime}.
233 \subsection{Sharing filter}
234 \label{sec:sub:sharing_filter}
235
236 A particle originating from the vertex can, because of its incident
237 angle on the \FMD{} sensors traverse more than one strip (see
238 \figref{fig:share_fraction}).  This means that the energy loss of the
239 particle is distributed over 1 or more strips.  The signal in each
240 strip should therefore possibly be merged with its neighboring strip
241 signals to properly reconstruct the energy loss of a single particle.
242
243 \begin{figure}[htbp]
244   \centering
245   \includegraphics[keepaspectratio,height=3cm]{share_fraction}
246   \caption{A particle traversing 2 strips and depositing energy in
247     each strip. }
248   \label{fig:share_fraction}
249 \end{figure}
250
251 The effect is most pronounced in low--flux\footnote{Events with a low
252   hit density.} events, like proton--proton collisions or peripheral
253 Pb--Pb collisions, while in high--flux events the hit density is so
254 high that most likely each and every strip will be hit and the effect
255 cancel out on average.
256
257 Since the particles travel more or less in straight lines toward the
258 \FMD{} sensors, the sharing effect is predominantly in the $r$ or
259 \emph{strip} direction.  Only neighbouring strips in a given sector is
260 therefor investigated for this effect.  
261
262 Algorithm~\ref{algo:sharing} is applied to the signals in a given
263 sector.
264
265 \begin{algorithm}[htpb]
266   \belowpdfbookmark{Algorithm 1}{algo:sharing}
267   \SetKwData{usedThis}{current strip used}
268   \SetKwData{usedPrev}{previous strip used}
269   \SetKwData{Output}{output}
270   \SetKwData{Input}{input}
271   \SetKwData{Nstr}{\# strips}
272   \SetKwData{Signal}{current}
273   \SetKwData{Eta}{$\eta$}
274   \SetKwData{prevE}{previous strip signal} 
275   \SetKwData{nextE}{next strip signal} 
276   \SetKwData{lowFlux}{low flux flag} 
277   \SetKwFunction{SignalInStrip}{SignalInStrip}
278   \SetKwFunction{MultiplicityOfStrip}{MultiplicityOfStrip}
279   \usedThis $\leftarrow$ false\;
280   \usedPrev $\leftarrow$ false\;
281   \For{$t\leftarrow1$ \KwTo \Nstr}{ 
282     \Output${}_t\leftarrow 0$\;
283     \Signal $\leftarrow$ \SignalInStrip($t$)\;
284
285     \uIf{\Signal is not valid}{ 
286       \Output${}_t \leftarrow$ invalid\;
287     }
288     \uElseIf{\Signal is 0}{ 
289       \Output${}_t \leftarrow$ 0\;
290     }
291     \Else{
292       \Eta$\leftarrow$ $\eta$ of \Input${}_t$\;
293       \prevE$\leftarrow$ 0\;
294       \nextE$\leftarrow$ 0\;
295       \lIf{$t \ne 1$}{ 
296         \prevE$\leftarrow$ \SignalInStrip($t-1$)\;
297       }
298       \lIf{$t \ne $\Nstr}{ 
299         \nextE$\leftarrow$ \SignalInStrip($t+1$)\;
300       }
301       \Output${}_t\leftarrow$
302       \MultiplicityOfStrip(\Signal,\Eta,\prevE,\nextE,\\
303       \hfill\lowFlux,$t$,\usedPrev,\usedThis)\;
304     }   
305   }
306   \caption{Sharing correction}
307   \label{algo:sharing}
308 \end{algorithm}
309
310 Here the function \FuncSty{SignalInStrip}($t$) returns the properly
311 path--length corrected signal in strip $t$.  The function
312 \FuncSty{MultiplicityOfStrip} is where the real processing takes
313 place (see page \pageref{func:MultiplicityOfStrip}). 
314
315 \begin{function}[htbp]
316   \belowpdfbookmark{MultiplicityOfStrip}{func:MultiplicityOfStrip}
317   \caption{MultiplicityOfStrip(\DataSty{current},$\eta$,\DataSty{previous},\DataSty{next},\DataSty{low
318       flux flag},\DataSty{previous signal used},\DataSty{this signal
319       used})} 
320   \label{func:MultiplicityOfStrip}
321   \SetKwData{Current}{current} 
322   \SetKwData{Next}{next} 
323   \SetKwData{Previous}{previous} 
324   \SetKwData{lowFlux}{low flux flag}
325   \SetKwData{usedPrev}{previous signal used}
326   \SetKwData{usedThis}{this signal used}
327   \SetKwData{lowCut}{low cut}
328   \SetKwData{total}{Total}
329   \SetKwData{highCut}{high cut}
330   \SetKwData{Eta}{$\eta$}  
331   \SetKwFunction{GetHighCut}{GetHighCut}
332   \If{\Current is very large or \Current $<$ \lowCut} {
333     \usedThis $\leftarrow$ false\;
334     \usedPrev $\leftarrow$ false\;
335     \Return{0}
336   }
337   \If{\usedThis}{ 
338     \usedThis $\leftarrow$ false\;
339     \usedPrev $\leftarrow$ true\;
340     \Return{0}
341   }
342   \highCut $\leftarrow$ \GetHighCut($t$,\Eta)\;
343   %\If{\Current $<$ \Next and \Next $>$ \highCut and \lowFlux set}{ 
344   %  \usedThis $\leftarrow$ false\;
345   %  \usedPrev $\leftarrow$ false\;
346   %  \Return{0}
347   %}
348   \total $\leftarrow$ \Current\;
349   \lIf{\lowCut $<$ \Previous $<$ \highCut and not \usedPrev}{ 
350     \total $\leftarrow$ \total + \Previous\;
351   }
352   \If{\lowCut $<$ \Next $<$ \highCut}{ 
353     \total $\leftarrow$ \total + \Next\;  
354     \usedThis $\leftarrow$ true\;
355   }
356   \eIf{\total $>$ 0}{ 
357     \usedPrev $\leftarrow$ true\;
358     \Return{\total}
359   }{
360     \usedPrev $\leftarrow$ false\;
361     \usedThis $\leftarrow$ false\;
362     \Return{0}
363   }
364 \end{function}
365 Here, the function \FuncSty{GetHighCut} evaluates a fit to the energy
366 distribution in the specified $\eta$ bin (see also
367 \secref{sec:sub:density_calculator}).  It returns
368 $$
369 \Delta_{mp} - 2 w
370 $$
371 where $\Delta_{mp}$ is the most probable energy loss, and $w$ is the
372 width of the Landau distribution.  
373
374 The \KwSty{if} in line 5, says that if the previous strip was merged
375 with current one, and the signal of the current strip was added to
376 that, then the current signal is set to 0, and we mark it as used for
377 the next iteration (\DataSty{previous signal used}$\leftarrow$true).
378
379 % The \KwSty{if} in line 10 checks if the current signal is smaller than
380 % the next signal, if the next signal is larger than the upper cut
381 % defined above, and if we have a low--flux event\footnote{Note, that in
382 %   the current implementation there are never any low--flux events.}.
383 % If that condition is met, then the current signal is the smaller of
384 % two possible candidates for merging, and it should be merged into the
385 % next signal.  Note, that this \emph{only} applies in low--flux events.
386
387 In line 11, % 15, 
388 we test if the previous signal lies between our low and
389 high cuts, and if it has not been marked as being used.  If so, we add
390 it to our current signal.  
391
392 The next \KwSty{if} on line 12 % 16 
393 checks if the next signal is within our
394 cut bounds.  If so, we add that signal to the current signal and mark
395 it as used for the next iteration (\DataSty{this signal
396   used}$\leftarrow$true).  It will then be zero'ed on the next
397 iteration by the condition on line 6.
398
399 Finally, if our signal is still larger than 0, we return the signal
400 and mark this signal as used (\DataSty{previous signal
401   used}$\leftarrow$true) so that it will not be used in the next
402 iteration. Otherwise, we mark the current signal and the next signal
403 as unused and return a 0. 
404
405
406 \subsection{Density calculator}
407 \label{sec:sub:density_calculator}
408
409 The density calculator loops over all the strip signals in the sharing
410 corrected\footnote{The sharing correction can be disabled, in which
411   case the density calculator used the input \ESD{} signals.} \ESD{}
412 and calculates the inclusive (primary + secondary) charged particle
413 density in pre--defined $\etaphi$ bins.
414
415 \subsubsection{Inclusive number of charged particles: Energy Fits} 
416 \label{sec:sub:sub:eloss_fits}
417
418 The number charged particles in a strip $\mult[,t]$ is calculated
419 using multiple Landau-like distributions fitted to the energy loss
420 spectrum of all strips in a given at a given $\eta$ bin.
421 \begin{align}
422   \Delta_{i,mp} &= i (\Delta_{1,mp}+ \xi_1 \log(i))\nonumber\\
423   \xi_i         &= i\xi_1\nonumber\\
424   \sigma_i      &= \sqrt{i}\sigma_1\nonumber\\
425   \mult[,t]     &= \frac{\sum_i^{N_{max}}
426     i\,a_i\,F(\Delta_t;\Delta_{i,mp},\xi_i,\sigma_i)}{
427     \sum_i^{N_{max}}\,a_i\,F(\Delta_t;\Delta_{i,mp},\xi_i,\sigma_i)}\quad,
428 \end{align}
429 where $F(x;\Delta_{mp},\xi,\sigma)$ is the evaluation of the Landau
430 distribution $f_L$ with most probable value $\Delta_{mp}$ and width
431 $\xi$, folded with a Gaussian distribution with spread $\sigma$ at the
432 energy loss $x$ \cite{nim:b1:16,phyrev:a28:615}.
433 \begin{align}
434   \label{eq:energy_response}
435   F(x;\Delta_{mp},\xi,\sigma) = \frac{1}{\sigma \sqrt{2 \pi}}
436   \int_{-\infty}^{+\infty} d\Delta' f_{L}(x;\Delta',\xi)
437   \exp{-\frac{(\Delta_{mp}-\Delta')^2}{2\sigma^2}}\quad,
438 \end{align}
439 where $\Delta_{1,mp}$, $\xi_1$, and $\sigma_1$ are the parameters for
440 the first MIP peak, $a_1=1$, and $a_i$ is the relative weight of the
441 $i$-fold MIP peak.  The parameters $\Delta_{1,mp}, \xi_1,
442 \sigma_1, \mathbf{a} = \left(a_2, \ldots a_{N_{max}}\right)$ are
443 obtained by fitting 
444 $$
445 F_j(x;C,\Delta_{mp},\xi,\sigma,\mathbf{a}) = C 
446 \sum_{i=1}^{j} a_i F(x;\Delta_{i,mp},\xi_{i},\sigma_i) 
447 $$
448 for increasing $j$ to the energy loss spectra in separate $\eta$ bins.
449 The fit procedure is stopped when one for $j+1$ 
450 \begin{itemize}
451 \item the reduced $\chi^2$ exceeds a certain threshold, or
452 \item the relative error $\delta p/p$ of any parameter of the fit
453   exceeds a certain threshold, or 
454 \item when the weight $a_j+1$ is smaller than some number (typically
455   $10^{-5}$). 
456 \end{itemize}
457 $N_{max}$ is then set to $j$.  Examples of the result of these fits
458 are given in \figref{fig:eloss_fits} in Appendix~\ref{app:eloss_fits}.
459 \subsubsection{Inclusive number of charged particles: Poisson Approach} 
460 \label{sec:sub:sub:poisson}
461 Another approach to the calculation of the number of charged particles
462 is using Poisson statistics. 
463 Assume that in a region of the FMD % where
464 $\mult$ 
465 %is azimuthally uniform in $\eta$ intervals it 
466 is
467 distributed according to a Poisson distribution. This means that the
468 probability of $\mult=n$ becomes:
469 \begin{equation}
470 P(n) = \frac{\mu^n e^{-\mu}}{n!} \label{eq:PoissonDef}
471 \end{equation}
472 In particular the measured occupancy, $\mu_{meas}$, is the probability
473 of any number of hits, thus using \eqref{eq:PoissonDef} :
474 \begin{equation}
475 \mu_{meas} = 1 - P(0) = 1 - e^{-\mu } 
476 %\Rightarrow \mu = \ln
477 %(1 - \mu_{meas})^{-1} \label{eq:PoissonDef2}
478 \end{equation}
479 which implies:
480 \begin{equation}
481 \mu = \ln
482 (1 - \mu_{meas})^{-1} \label{eq:PoissonDef2}
483 \end{equation}
484 The mean number of particles in a hit strip becomes:
485 \begin{eqnarray}
486 C &=& \frac{\sum_{n>0} n P(n>0)}{\sum_{n>0} P(n>0)} \nonumber \\
487   &=& \frac{e^{-\mu}}{1-e^{-\mu}} \mu  \sum \frac{\mu^n}{n!} 
488   \nonumber \\
489   &=& \frac{e^{-\mu}}{1-e^{-\mu}} \mu e^{\mu} \nonumber \\
490   &=& \frac{\mu}{1-e^{-\mu}}
491 \end{eqnarray}
492 %While $\mu$ can be calculated analytically for practical purposes we
493 With $\mu$ defined in \eqref{eq:PoissonDef2} this calculation is
494 carried out per event in
495 regions of the FMD each containing 256 strips. %Defining
496 %$\mu_{meas}^{region}$ to be the measured occupancy
497  In such a region,
498 $\mult$ for a hit strip ($N_{hits} \equiv 1$) in that region becomes:
499 \begin{equation}
500 \mult = N_{hits} \times C = 1 \times C = C
501 \end{equation}
502 Where C is calculated using $\mu_{meas}^{region}$.
503
504 \subsubsection{Azimuthal Acceptance}
505
506 Before the signal $\mult[,t]$ can be added to the $\etaphi$
507 bin in one of the 5 per--ring histograms, it needs to be corrected for
508 the $\varphi$ acceptance of the strip.
509
510 The sensors of the \FMD{} are not perfect arc--segments --- the two
511 top corners are cut off to allow the largest possible sensor on a 6''
512 Si-wafer.   This means, however, that the strips in these outer
513 regions do not fully cover $2\pi$ in azimuth, and there is therefore a
514 need to correct for this limited acceptance.  
515
516 The acceptance correction is only applicable where the strip length
517 does not cover the full sector.  This is the case for the outer strips
518 in both the inner and outer type rings.  The acceptance correction is
519 then simply 
520 \begin{align}
521   \label{eq:acc_corr}
522   \Corners{} &= \frac{l_t}{\Delta\varphi}\quad
523 \end{align}
524 where $l_t$ is the strip length in radians at constant $r$, and
525 $\Delta\varphi$ is $2\pi$ divided by the number of sectors in the
526 ring (20 for inner type rings, and 40 for outer type rings). 
527
528 Note, that this correction is a hardware--related correction, and does
529 not depend on the properties of the collision (e.g., primary vertex
530 location). 
531
532 The final $\etaphi$ content of the 5 output vertex dependent,
533 per--ring histograms of the inclusive charged particle density is then
534 given by
535 \begin{align}
536   \label{eq:density}
537   \dndetadphi[incl,r,v,i\etaphi] &= \sum_t^{t\in\etaphi}
538   \mult[,t]\,\Corners{}
539 \end{align}
540 where $t$ runs over the strips in the $\etaphi$ bin. 
541
542 \subsection{Corrections}
543 \label{sec:sub:corrector}
544
545 The corrections code receives the five vertex dependent,
546 per--ring histograms of the inclusive charged particle density
547 $\dndetadphi[incl,r,v,i]$ from the density calculator and applies
548 two corrections 
549
550 \subsubsection{Secondary correction}
551 %%
552 %%                hHits_FMD<d><r>_vtx<v> 
553 %% hCorrection = -----------------------
554 %%                hPrimary_FMD_<r>_vtx<v>
555 %%
556 %% where 
557 %% - hPrimary_FMD_<r>_vtx<vtx> is 2D of eta,phi for all primary ch
558 %%   particles
559 %% - hHits_FMD<d><r>_vtx<v>  is 2D of eta,phi for all track-refs that
560 %%   hit the FMD - The 2D version of hMCHits_nocuts_FMD<d><r>_vtx<v>
561 %%   used below. 
562 This is a 2 dimensional histogram generated from simulations, as the
563 ratio of primary particles to the total number of particles that fall
564 within an $\etaphi$ bin for a given vertex bin
565
566 \begin{align}
567   \label{eq:secondary}
568   \SecMap{} &=
569   \frac{\sum_i^{\NV[,v]}\mult[,\text{primary},i]\etaphi}{
570     \sum_i^{\NV[,v]}\mult[,\text{\FMD{}},i]\etaphi}\quad,
571 \end{align}
572 where $\NV[,v]$ is the number of events with a valid trigger and a
573 vertex in bin $v$, and $\mult[,\FMD{},i]$ is the total number of
574 charged particles that hit the \FMD{} in event $i$ in the specified
575 $\etaphi$ bin and $\mult[,\text{primary},i]$ is number of
576 primary charged particles in event $i$ within the specified
577 $\etaphi$ bin.
578
579 $\mult[,\text{primary}]\etaphi$ is given by summing over the
580 charged particles labelled as primaries \emph{at the time of the
581   collision} as defined in the simulation code.  That is, it is the
582 number of primaries within the $\etaphi$ bin at the collision
583 point --- not at the \FMD{}.
584
585 $\SecMap$ is varies from $\approx 1.5$ for the most forward bins to
586 $\approx 3$ for the more central bins.  For pp, different event
587 generators were used and found to give compatible results within
588 3--5\%.   For pp, at least some millions of events must be
589 accumulated to reach satisfactory statistics.  For Pb--Pb where the
590 general hit density is larger, reasonable statistics can be achieved
591 with less data.  
592
593 \subsubsection{Acceptance due to dead channels}
594
595 Some of the strips in the \FMD{} have been marked up as \emph{dead},
596 meaning that they are not used in the reconstruction or analysis.
597 This leaves holes in the acceptance of each defined $\etaphi$
598 which need to be corrected for.  
599
600 Dead channels are marked specially in the \ESD{}s with the flag
601 \textit{Invalid Multiplicity}.  This is used in the analysis to build
602 up and event--by--event acceptance correction in each $\etaphi$
603 bin by calculating the ratio
604 \begin{align}
605   \label{eq:dead_channels} 
606   \DeadCh{} &= 
607   \frac{\sum_t^{t\in\etaphi}\left\{\begin{array}{cl}
608         1 & \text{if not dead}\\
609         0 & \text{otherwise}
610       \end{array}\right.}{\sum_t^{t\in\etaphi} 1}\quad,
611 \end{align}
612 where $t$ runs over the strips in the $\etaphi$ bin.  This correction
613 is obviously $v_z$ dependent since which $\etaphi$ bin a strip $t$
614 corresponds to depends on its relative position to the primary vertex.
615
616 Alternatively, pre--made acceptance factors can be used.  These are
617 made from the off-line conditions database (\OCDB{}).
618
619 The 5 output vertex dependent, per--ring histograms of the primary
620 charged particle density is then given by
621 \begin{align}
622   \dndetadphi[r,v,i\etaphi] &=
623   \SecMap{} \frac{1}{\DeadCh{}}\dndetadphi[incl,r,v,i\etaphi]
624 \end{align}
625
626 \subsection{Histogram collector}
627 \label{sec:sub:hist_collector}
628
629 The histogram collector collects the information from the 5 vertex
630 dependent, per--ring histograms of the primary charged particle
631 density $\dndetadphi[r,v,i]$ into a single vertex dependent histogram
632 of the charged particle density $\dndetadphi[v,i]$.  
633
634 To do this, it first calculates, for each vertex bin, the $\eta$ bin
635 range to use for each ring.  It investigates the secondary correction
636 maps $\SecMap{}$ to find the edges of each map.  The edges are given
637 by the $\eta$ range where $\SecMap{}$ is larger than some
638 threshold\footnote{Typically $t_s\approx 0.1$.}  $t_s$. The code
639 applies safety margin of a $N_{cut}$ bins\footnote{Typically
640   $N_{cut}=1$.}, to ensure that the data selected does not have too
641 large corrections associated with it.
642
643 It then loops over the bins in the defined $\eta$ range and sums the
644 contributions from each of the 5 histograms.  In the $\eta$ ranges
645 where two rings overlap, the collector calculates the average and adds
646 the errors in quadrature\footnote{While not explicitly checked, it was
647   found that the histograms agrees within error bars in the
648   overlapping region}.
649
650 The output vertex dependent histogram of the primary
651 charged particle density is then given by
652 \begin{align}
653   \label{eq:superhist}
654   \dndetadphi[v,i\etaphi] &=
655   \frac{1}{N_{r\in\etaphi}}\sum_{r}^{r\in\etaphi}  
656   \dndetadphi[r,v,i\etaphi]\\
657   \delta\left[\dndetadphi[v,i\etaphi]\right] &=
658   \frac{1}{N_{r\in\etaphi}}\sqrt{\sum_{r}^{r\in\etaphi}   
659     \delta\left[\dndetadphi[r,v,i\etaphi]\right]^2}
660   \quad,
661 \end{align}
662 where $N_{r\in\etaphi}$ is the number of overlapping histograms
663 in the given $\etaphi$ bin. 
664
665 The histogram collector stores the found $\eta$ ranges in the
666 underflow bin of the histogram produced.  The content of the overflow
667 bins are 
668 \begin{align}
669   \label{eq:overflow}
670   I_{v,i}(\eta) &= 
671   \frac{1}{N_{r\in(\eta)}}
672   \sum_{r}^{r\in(\eta)} \left\{\begin{array}{cl} 
673       0 & \eta \text{\ bin not selected}\\ 
674       1 & \eta \text{\ bin selected}
675       \end{array}\right.\quad,
676 \end{align}
677 where $N_{r\in(\eta)}$ is the number of overlapping histograms in the
678 given $\eta$ bin.  The subscript $v$ indicates that the content
679 depends on the current vertex bin of event $i$.
680
681 \section{Building the final $\dndeta$}
682 \label{sec:ana_aod}
683
684 To build the final $\dndeta$ distribution it is enough to sum
685 \eqref{eq:superhist} and \eqref{eq:overflow} over all interesting
686 events and correct for the acceptance $I(\eta)$ 
687 \begin{align}
688   \dndetadphi[\etaphi] &= \sum_i^{\NA}\dndetadphi[i,v\etaphi]\\ 
689   I(\eta) &= \sum_i^{\NA}I_{i,v}(\eta)\quad.
690 \end{align}
691 Note, that $I(\eta)\le\NA$.  
692
693 We then need to normalise to the total number of events $N_X$, given
694 by 
695 \begin{align}
696   \N{X}{} &= \frac{1}{\epsilon_X}\left[\NA + \alpha(\NnotV -
697     \beta)\right]  \label{eq:fulleventnorm}\\
698   & = \frac{1}{\epsilon_X}\left[\NA + \frac{\NA}{\NV}(\NT-\NV{} -
699     \beta)\right]\nonumber \\
700   & =\frac{1}{\epsilon_X}\NA\left[1+\frac{1}{\epsilon_V}-1-
701     \frac{\beta}{\NV}\right]\nonumber\\ 
702   & = \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}\NA
703   \left(1-\frac{\beta}{\NT{}}\right)\nonumber
704 \end{align}
705 where
706 \begin{description}
707 \item[$\epsilon_X$]  is the trigger efficiency for type
708   $X\in[\text{\INEL},\text{\INELONE},\text{\NSD},...]$
709 \item[$\epsilon_V=\frac{\NV{}}{\NT{}}$] is the vertex efficiency
710   evaluated over the data.
711 \item[$\NA$] is the number of events with a trigger \emph{and} a valid
712   vertex in the selected range
713 \item[$\NV{}$] is the number of events with a trigger \emph{and} a valid
714   vertex. 
715 \item[$\NT$] is the number of events with a trigger.
716 \item[$\NnotV{}=\NT-\NV{}$] is the number of events with a trigger
717   \emph{but no} valid vertex
718 \item[$\alpha=\frac{\NA}{\NV}$] is the fraction of accepted events of
719   the total number of events with a trigger and valid vertex.  
720 \item[$\beta=\N{a}{}+\N{b}{}-\N{e}{}$] is the number of background
721   events \emph{with} a valid off-line trigger.
722 \end{description}
723 The two terms under the parenthesis in \eqref{eq:fulleventnorm} refers
724 to the observed number of event $\NA$, and the events missed because
725 of no vertex reconstruction.  Note, for $\beta\ll\NT{}$
726 \eqref{eq:fulleventnorm} reduces to the simpler expression
727 $$
728 \N{X}{} = \frac1{\epsilon_X}\frac1{\epsilon_V}\NA{}
729 $$
730 The trigger efficiency $\epsilon_X$ for a given trigger type $X$ is
731 evaluated from simulations as
732 \begin{align}
733   \epsilon_X = \frac{\N{X\wedge \text{T}}{}}{\N{X}{}}\quad,
734 \end{align}
735 that is, the ratio of number of events of type $X$ with a
736 corresponding trigger to the number of events of type $X$. 
737
738 The final event--normalised charged particle density then becomes 
739 \begin{align}
740   \frac{1}{N}\frac{dN_{\text{ch}}}{d\eta} &= 
741   \frac{1}{\N{X}{}} \int_0^{2\pi} d\varphi
742   \frac{\dndetadphi[\etaphi]}{I(\eta)}
743   \label{eq:eventnormdndeta}
744 \end{align}
745
746 If the trigger $X$ introduces a bias on the measured number of events,
747 then \eqref{eq:eventnormdndeta} need to be modified to 
748 \begin{align}
749   \frac{1}{N}\frac{dN_{\text{ch}}}{d\eta} &= 
750   \frac{1}{\N{X}{}} \int_0^{2\pi} d\varphi
751   \frac{\frac{1}{B\etaphi}\dndetadphi[\etaphi]}{I(\eta)}
752   \label{eq:eventnormdndeta2}\quad,
753 \end{align}
754 where $B\etaphi$ is the bias correction.  This is typically
755 calculated from simulations using the expression 
756 \begin{align}
757   B\etaphi = \frac{\frac{1}{\N{X\wedge
758         \text{T}}{}}\sum_i^{\N{X\wedge \text{T}}{}}
759     \mult[,\text{primary}]\etaphi}{\frac{1}{\N{X}{}}\sum_i^{\N{X}{}}
760     \mult[,\text{primary}]\etaphi}
761 \end{align}
762
763
764 \section{Using the per--event $\dndetadphi[i,v]$ histogram for other
765   analysis} 
766
767 \subsection{Multiplicity distribution} 
768
769 To build the multiplicity distribution for a given $\eta$ range
770 $[\eta_1,\eta_2]$, one needs to find the total multiplicity in that
771 $\eta$ range for each event. To do so, one should sum the
772 $\dndetadphi[i,v]$ histogram over all $\varphi$ and in the selected
773 $\eta$ range.
774 \begin{align}
775   n'_{i[\eta_1,\eta_2]}, &= \int_{\eta_1}^{\eta_2}d\eta\int_0^{2\pi}d\varphi
776   \dndetadphi[i,v]\quad.\nonumber
777 \end{align}
778 However, $n'_i$ is not corrected for the coverage in $\eta$ for the
779 particular vertex range $v$.  One therefor needs to correct for the
780 number of missing bins in the range $[\eta_1,\eta_2]$.  Suppose
781 $[\eta_1,\eta_2]$ covers $N_{[\eta_1,\eta_2]}$ $\eta$ bins, then the acceptance
782 correction is given by 
783 \begin{align}
784   A_{i,[\eta_1,\eta_2]} = \frac{N_{[\eta_1,\eta_2]}}{\int_{\eta_1}^{\eta_2}d\eta\,
785     I_{i,v}(\eta)}\quad.\nonumber
786 \end{align}
787 The per--event multiplicity is then given by 
788 \begin{align}
789   n_{i,[\eta_1,\eta_2]} &= A_{i,[\eta_1,\eta_2]}\,n'_{i,[\eta_1,\eta_2]}\nonumber\\
790   &= \frac{N_{[\eta_1,\eta_2]}}{\int_{\eta_1}^{\eta_2}\eta
791     I_{i,v}(\eta)} \int_{\eta_1}^{\eta_2}d\eta\int_0^{2\pi}d\varphi
792   \dndetadphi[i,v]
793   \label{eq:event_n}
794 \end{align}
795
796 \subsection{Forward--Backward correlations} 
797
798 To do forward--backward correlations, one need to calculate
799 $n_{i,[\eta_1,\eta_2]}$ as shown in \eqref{eq:event_n} in two bins
800 $n_{i,[\eta_1,\eta_2]}$ and $n_{i,[-\eta_2,-\eta_1]}$ \textit{e.g.},
801 $n_{i,f}=n_{i,[-3,-1]}$ and $n_{i,b}=n_{i,[1,3]}$. 
802
803 \clearpage
804 \section{Some results}
805
806 %% \figurename{}s \ref{fig:1} to \ref{fig:3} shows some results.
807 Figures below show some examples \cite{hhd:2009}.  Note these are not finalised
808 plots. 
809 \begin{figure}[hbp]
810   \centering
811   \includegraphics[keepaspectratio,width=\textwidth]{%
812     results_ppdndeta}
813   \caption{$\dndeta$ for pp for \INEL{} events at
814     $\sqrt{s}=\GeV{900}$, $\sqrt{s}=\TeV{2.76}$, and $\sqrt{s}=\TeV{7}$
815     $\cm{-10}\le v_z\le\cm{10}$, rebinned by a factor 5 \cite{hhd:2009}. 
816 % Middle panel
817 %    shows the ratio of ALICE data to UA5, and the bottom panel shows
818 %    the ratio of the right (positive) side to the left (negative) side
819 %    of the forward $\dndeta$.
820 }
821   \label{fig:1}
822 \end{figure} 
823 \begin{figure}[hbp]
824   \centering
825   \includegraphics[keepaspectratio,width=\textwidth]{%
826     results_PbPbdndeta}
827   \caption{$\dndeta$ for Pb+Pb for Minimum Bias events at
828     $\sqrt{s_{NN}}=\TeV{2.76}$ $\cm{-10}\le v_z\le\cm{10}$, rebinned by a
829     factor 5 in 10 centrality intervals \cite{hhd:2009}. 
830 % Middle panel
831 %    shows the ratio of ALICE data to UA5, and the bottom panel shows
832 %    the ratio of the right (positive) side to the left (negative) side
833 %    of the forward $\dndeta$.
834 }
835   \label{fig:2}
836 \end{figure} 
837
838
839 \iffalse
840 \begin{figure}[hbp]
841   \centering
842   \includegraphics[keepaspectratio,width=\textwidth]{%
843     dndeta_pp_0900GeV_INEL_m10p10cm}
844   \caption{$\dndeta$ for pp for \INEL{} events at $\sqrt{s}=\GeV{900}$,
845     $\cm{-10}\le v_z\le\cm{10}$, rebinned by a factor 5.  Middle panel
846     shows the ratio of ALICE data to UA5, and the bottom panel shows
847     the ratio of the right (positive) side to the left (negative) side
848     of the forward $\dndeta$.}
849   \label{fig:1}
850 \end{figure} 
851
852
853 \begin{figure}[tbp]
854   \centering
855   \includegraphics[keepaspectratio,width=\textwidth]{%
856     dndeta_0900GeV_m10-p10cm_rb05_inelgt0}
857   \caption{$\dndeta$ for pp for \INELONE{} events at
858     $\sqrt{s}=\GeV{900}$, $\cm{-10}\le v_z\le\cm{10}$, rebinned by a
859     factor 5.  Comparisons to other measurements shown where
860     applicable}
861   \label{fig:2}
862 \end{figure} 
863 \begin{figure}[tbp]
864   \centering
865   \includegraphics[keepaspectratio,width=\textwidth]{%
866     dndeta_0900GeV_m10-p10cm_rb05_nsd}
867   \caption{$\dndeta$ for pp for \NSD{} events at $\sqrt{s}=\GeV{900}$,
868     $\cm{-10}\le v_z\le\cm{10}$, rebinned by a factor 5.  Comparisons
869     to other measurements shown where applicable}
870   \label{fig:3}
871 \end{figure} 
872 \fi
873
874 \clearpage
875 %% \currentpdfbookmark{Appendices}{Appendices}
876 \appendix 
877 \section{Nomenclature} 
878 \label{app:nomen}
879
880 \begin{table}[hbp]
881   \centering
882   \begin{tabular}[t]{|lp{.8\textwidth}|}
883     \hline 
884     \textbf{Symbol}&\textbf{Description}\\
885     \hline 
886     \INEL & In--elastic event\\ 
887     \INELONE & In--elastic event with at least one tracklet in the
888     \SPD{} in the region $-1\le\eta\le1$\\ 
889     \NSD{} & Non--single--diffractive event.  Single diffractive
890     events are events where one of the incident collision systems
891     (proton or nucleus) is excited and radiates particles, but there
892     is no other processes taking place\\ 
893     \hline
894     $\NT{}$ & Number of events with a valid trigger\\
895     $\NV{}$ & Number of events with a valid trigger \emph{and} a valid
896     vertex.\\  
897     $\NA{}$ & Number of events with a valid trigger
898     \emph{and} a valid vertex \emph{within} the selected vertex range.\\ 
899     $\N{a,c,ac,e}{}$ & Number of events with background triggers $A$,
900     $B$, $AC$, or $E$, \emph{and} a valid off-line trigger of the
901     considered type.   Background triggers are typically flagged with
902     the trigger words \texttt{CINT1-A},  \texttt{CINT1-C},
903     \texttt{CINT1-AC}, \texttt{CINT1-E}, or similar.\\
904     \hline
905     $\mult{}$ & Charged particle multiplicity\\ 
906     $\mult[,\text{primary}]$ & Primary charged particle multiplicity
907     as given by simulations\\ 
908     $\mult[,\text{\FMD{}}]$ & Number of charged particles that hit the
909     \FMD{} as given by simulations\\ 
910     $\mult[,t]$ & Number of charged particles in an \FMD{} strip as
911     given by evaluating the energy response functions $F$\\ 
912     \hline
913     $F$ & Energy response function (see \eqref{eq:energy_response})\\
914     $\Delta_{mp}$ & Most probably energy loss\\ 
915     $\xi$ & `Width' parameter of a Landau distribution\\
916     $\sigma$ & Variance of a Gaussian distribution\\ 
917     $a_i$ & Relative weight of the $i$--fold MIP peak in the energy
918     loss spectra.\\ 
919     \hline
920     $\Corners{}$ & Azimuthal acceptance of strip $t$\\ 
921     $\SecMap{}$ & Secondary particle correction factor in $\etaphi$
922     for a given vertex bin $v$\\  
923     $\DeadCh{}$ & Acceptance in $\etaphi$ for a given vertex bin $v$\\ 
924     \hline
925     $\dndetadphi[incl,r,v,i]$ & Inclusive (primary \emph{and}
926     secondary) charge particle density in event $i$ with vertex $v$,
927     for \FMD{} ring $r$.\\ 
928     $\dndetadphi[r,v,i]$ & Primary charged particle
929     density in event $i$ with vertex $v$ for \FMD{} ring $r$. \\
930     $\dndetadphi[v,i]$ & Primary charged particle density in event $i$
931     with vertex $v$\\  
932     $I_{v,i}(\eta)$ & $\eta$ acceptance of event $i$ with vertex $v$\\ 
933     $I(\eta)$ & Integrated $\eta$ acceptance over $\NA$ events.
934     Note, that this has a value of $\NA$ for $(\eta)$ bins where we
935     have full coverage\\ 
936     \hline 
937     $X_t$ & Value $X$ for strip number $t$ (0-511 for inner rings,
938     0-255 for outer rings)\\ 
939     $X_r$ & Value $X$ for ring $r$ (where rings are \FMD{1i},
940     \FMD{2i}, \FMD{2o}, \FMD{3o}, and \FMD{3i} in decreasing $\eta$
941     coverage).\\ 
942     $X_v$ & Value $X$ for vertex bin $v$ (typically 10 bins from -10cm
943     to +10cm)\\ 
944     $X_i$ & Value $X$ for event $i$\\
945     \hline
946   \end{tabular}
947   \caption{Nomenclature used in this document}
948   \label{tab:nomenclature}
949 \end{table}
950 \clearpage
951
952
953 \section{Second pass example code}
954 \label{app:exa_pass2}
955 \lstset{basicstyle=\small\ttfamily,% 
956   keywordstyle=\color[rgb]{0.627,0.125,0.941}\bfseries,% 
957   identifierstyle=\color[rgb]{0.133,0.545,0.133}\itshape,%
958   commentstyle=\color[rgb]{0.698,0.133,0.133},%
959   stringstyle=\color[rgb]{0.737,0.561,0.561},
960   emph={TH2D,TH1D,TFile,TTree,AliAODForwardMult},emphstyle=\color{blue},%
961   emph={[2]dndeta,sum,norm},emphstyle={[2]\bfseries\underbar},%
962   emph={[3]file,tree,mult,nV,nBg,nA,nT,i,gSystem},emphstyle={[3]},%
963   language=c++,%
964 }
965 \begin{lstlisting}[caption={Example 2\textsuperscript{nd} pass code to
966     do $\dndeta$},label={lst:example},frame=single,captionpos=b]
967 void Analyse(int mask=AliAODForwardMult::kInel,
968              float vzLow=-10, float vzHigh=10, float trigEff=1)
969
970   gSystem->Load("libANALYSIS.so");      // Load analysis libraries
971   gSystem->Load("libANALYSISalice.so"); // General ALICE stuff
972   gSystem->Load("libPWGLFforward2.so");  // Forward analysis code
973
974   int                nT      = 0;              // # of ev. w/trigger
975   int                nV      = 0;              // # of ev. w/trigger&vertex
976   int                nA      = 0;              // # of accepted ev.
977   int                nBg     = 0;              // # of background ev
978   TH2D*              sum     = 0;              // Summed hist
979   AliAODForwardMult* mult    = 0;              // AOD object
980   TFile*             file    = TFile::Open("AliAODs.root","READ");
981   TTree*             tree    = static_cast<TTree*>(file->Get("aodTree"));
982   tree->SetBranchAddress("Forward", &forward); // Set the address
983
984   for (int i = 0; i < tree->GetEntries(); i++) { 
985     // Read the i'th event 
986     tree->GetEntry(i);
987
988     // Create sum histogram on first event - to match binning to input
989     if (!sum) 
990       sum = static_cast<TH2D*>(mult->GetHistogram()->Clone("d2ndetadphi"));
991     
992     // Calculate beta=A+C-E
993     if (mult->IsTriggerBits(mask|AliAODForwardMult::kA))    nBg++;
994     if (mult->IsTriggerBits(mask|AliAODForwardMult::kC))    nBg++;
995     if (mult->IsTriggerBits(mask|AliAODForwardMult::kE))    nBg--;
996
997     // Other trigger/event requirements could be defined 
998     if (!mult->IsTriggerBits(mask)) continue; 
999     nT++;
1000
1001     // Check if we have vertex and select vertex range (in centimeters) 
1002     if (!mult->HasIpZ()) continue;
1003     nV++;
1004     
1005     if (!mult->InRange(vzLow, vzHigh) continue; 
1006     nA++;
1007
1008     // Add contribution from this event
1009     sum->Add(&(mult->GetHistogram()));
1010   }
1011
1012   // Get acceptance normalisation from underflow bins 
1013   TH1D* norm   = sum->ProjectionX("norm", 0, 0, "");
1014   // Project onto eta axis - _ignoring_underflow_bins_!
1015   TH1D* dndeta = sum->ProjectionX("dndeta", 1, -1, "e");
1016   // Normalize to the acceptance, and scale by the vertex efficiency 
1017   dndeta->Divide(norm);
1018   dndeta->Scale(trigEff * nT/nV / (1 - nBg/nT), "width");
1019   // And draw the result
1020   dndeta->Draw();
1021 }
1022 \end{lstlisting}
1023
1024 \section{$\Delta E$ fits} 
1025 \label{app:eloss_fits}
1026
1027 \begin{figure}[htbp]
1028   \centering
1029   \includegraphics[keepaspectratio,width=\textwidth]{eloss_fits}
1030   \caption{Summary of energy loss fits in each $\eta$ bin (see also
1031     \secref{sec:sub:sub:eloss_fits}).
1032     \newline
1033     On the left side: Top panel shows the
1034     reduced $\chi^2$, second from the top shows the found
1035     scaling constant, 3\textsuperscript{rd} from the top is
1036     the most probable energy loss $\Delta_{mp}$, 4\textsuperscript{th}
1037     shows the width parameter $\xi$ of the Landau, and the
1038     5\textsuperscript{th} is the Gaussian width $\sigma$.
1039     $\Delta_{mp}$, $\xi$, and $\sigma$ have units of $\Delta E/\Delta
1040     E_{mip}$. 
1041     \newline
1042     On the right: The top panel shows the maximum number of
1043     multi--particle signals that where fitted, and the 4 bottom panels
1044     shows the weights $a_2,a_3,a_4,$ and $a_5$ for 2, 3, 4, and 5
1045     particle responses.}
1046   \label{fig:eloss_fits}
1047 \end{figure}
1048
1049 \clearpage
1050 \currentpdfbookmark{References}{References}
1051 \begin{thebibliography}{99}
1052 \bibitem{FWD:2004mz} \ALICE{} Collaboration, Bearden, I.~G.\ \textit{et al}
1053   \textit{ALICE technical design report on forward detectors: FMD, T0
1054     and V0}, \CERN{}, 2004, CERN-LHCC-2004-025
1055 \bibitem{cholm:2009} Christensen, C.~H., \textit{The ALICE Forward
1056     Multiplicity Detector --- From Design to Installation},
1057   Ph.D.~thesis, University of Copenhagen, 2009,
1058   \url{http://www.nbi.dk/~cholm/}. 
1059 \bibitem{maxime} Guilbaud, M. \textit{et al}, \textit{Measurement of the charged-particle
1060 multiplicity density at forward rapidity
1061 with ALICE VZERO detector in central
1062 Pb-Pb collision at $\sqrt{s_{NN}}=\TeV{2.76}$},
1063   ALICE internal note, 2012,
1064   \url{https://aliceinfo.cern.ch/Notes/node/17/}. 
1065 \bibitem{nim:b1:16} 
1066 %% \bibitem{Hancock:1983ry}
1067   S.~Hancock, F.~James, J.~Movchet {\it et al.},
1068   ``Energy Loss Distributions For Single Particles And Several
1069   Particles In A Thin Silicon Absorber,'' Nucl.\ Instrum.\ Meth.\
1070   \textbf{B1} (1984)  16, \url{http://cdsweb.cern.ch/record/147286/files/cer-000058451.pdf}.
1071 \bibitem{phyrev:a28:615} 
1072 %% \bibitem{Hancock:1983fp}
1073   S.~Hancock, F.~James, J.~Movchet {\it et al.}, ``Energy Loss And
1074   Energy Straggling Of Protons And Pions In The Momentum Range
1075   0.7-gev/c To 115-gev/c,'' Phys.\ Rev.\ \textbf{A28} (1983) 615,
1076   \url{http://cdsweb.cern.ch/record/145395/files/PhysRevA.28.615.pdf}. 
1077 \bibitem{hhd:2009} Dalsgaard, H.~H., \textit{Pseudorapidity Densities in p+p and Pb+Pb collisions at
1078       LHC measured with the ALICE experiment},
1079   Ph.D.~thesis, University of Copenhagen, 2011,
1080   \url{http://www.nbi.dk/~canute/thesis.pdf}. 
1081 \end{thebibliography}
1082 \end{document}
1083
1084 % Local Variables:
1085 %   ispell-local-dictionary: "british"
1086 %   TeX-PDF-mode: t
1087 % End:
1088 %
1089 % LocalWords:  tracklet diffractive IsTriggerBits AliAODForwardMult ProjectionX