]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/doc/trd_software_writeup.tex
update documenta
[u/mrichter/AliRoot.git] / TRD / doc / trd_software_writeup.tex
CommitLineData
883031eb 1% ---------------------------------------------------------------------
2%
3% TRD Software Writeup
4%
5% ---------------------------------------------------------------------
6%
7\documentclass{alicetdr}
8%\documentclass[draft]{alicetdr}
9%
10% For figures
11\usepackage{graphicx}
12%
13% Helvetica
14\usepackage{helvet}
15\renewcommand{\rmdefault}{phv}
16\renewcommand{\sfdefault}{phv}
17%
18\let\Otemize =\itemize
19\let\Onumerate =\enumerate
20\let\Oescription =\description
21% Zero the vertical spacing parameters
22\def\Nospacing{\itemsep=0pt\topsep=0pt\partopsep=0pt\parskip=0pt\parsep=0pt}
23\def\Topspac{\vspace{-0.5\baselineskip}}
24\def\Botspac{\vspace{-0.2\baselineskip}}
25% Redefine the environments in terms of the original values
26\newenvironment{Itemize}{\Topspac\Otemize\Nospacing}{\endlist\Botspac}
27\newenvironment{Enumerate}{\Topspac\Onumerate\Nospacing}{\endlist\Botspac}
28\newenvironment{Description}{\Topspac\Oescription\Nospacing}{\endlist\Botspac}
29%
30\include{alicedefs}
31%
32\begin{document}
33%
34\pagenumbering{roman}
35%
36%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37%
38% Title page
39%
40\font\HUGEA=phvr at 36mm % declare very big font
41\font\HUGEB=phvr at 14mm % declare very big font
42%
43\begin{titlepage}
44%
45\vspace{10.0cm}
46%
47\begin{center}
48{\HUGEA T\hspace{5.mm}R\hspace{5.mm}D} \\
49%
50\vspace{3.5cm}
51{\HUGEB Offline Software Writeup} \\
52%
53\vspace{2.0cm}
54{\Large Version 1.0, \today}\\
55%
56\vfill
57%
58\vspace{5.5cm}
59%
60\end{center}
61%
62\end{titlepage}
63%
64%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65%
66% Empty page to adjust page numbering
67%
68\onecolumn
69\thispagestyle{empty}
70\mbox{ }
71%
72\setcounter{page}{0}
73\onecolumn
74%
75%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76%
77\pagenumbering{arabic}
78%
79%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80%
757c05c1 81% List of content
82%
83%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84%
85\thispagestyle{empty}
86\tableofcontents
87%
88%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
89%
883031eb 90% Text
91%
92%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
93%
94%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95\setcounter{chapter}{0}
96\setcounter{section}{0}
97\Chapter{Introduction}
98\thispagestyle{empty}
99%
100This document is supposed to provide a description of the offline
101software components that are specific to the TRD. It is an attempt
102to collect useful informations on the design and usage of the TRD
103software, in order to facilitate newcomers the introduction to the
104code. The most important classes and procedures are described and
105several examples und use cases are given.
106However, this writeup is not meant to be a basic AliRoot introduction.
107For this purpose the reader is referred to the general AliRoot users
108guide \cite{ALIROOT}.
109%
110%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111\newpage
112\setcounter{chapter}{1}
113\setcounter{section}{0}
114\Chapter{Simulation}
115\thispagestyle{empty}
116%
117\section{Geometry}
118\label{GEO:intro}
119%
120{\it Author: C.~Blume (blume@ikf.uni-frankfurt.de)}
121\smallskip
122\\
123%
124The TRD geometry, as implemented in {\tt AliTRDgeometry}, consists of
125several components: The readout chambers (ROC), the services, and the
126supermodule frame. All these parts are placed inside the TRD mother
127volumes, which in turn are part of the space frame geometry
128({\tt AliFRAMEv2}). Therefore, the space frame geometry has to be
129present to build the TRD geometry. For each of the 18 supermodules
130one single mothervolume is provided (BTRDxx). This allows to configure
131the TRD geometry in {\tt Config.C} such that it only contains a subset
132of supermodules in the total ALICE geometry via
133{\tt AliTRDgeometry::SetSMstatus()}. An incomplete detector setup, as
134it exists for first data taking, can thus be modelled. The class
135{\tt AliTRDgeometry} also serves as the central place to collect all
136geometry relevant numbers and the definitions of various numbering
137schemes of detector components (e.g. sector numbers). However, all
138geometric parameters that refer to the pad planes are compiled in
139{\tt AliTRDpadPlane}.
140%
141\subsection{Readout Chambers}
142\label{GEO:rocs}
143%
144\begin{figure}[htb]
145\begin{center}
146\includegraphics[width=0.85\textwidth]{plots/geo_roc.eps}
147\end{center}
148\caption{
149A TRD read out chamber as implemented in the AliRoot geometry. The
150various material layers are visible. Also, the MCMs on top of the
151chamber, as well as the cooling pipes are shown.
152}
153\label{FIG_GEO:roc_geom}
154\end{figure}
155%
156All ROCs are modelled in the same way, only their dimensions vary.
157They consist of an aluminum frame, which contains the material for
158the radiator and the gas of the drift region, a Wacosit frame (whose
159material is represented by carbon), that surrounds the amplification
160region, and the support structure, consisting of its aluminum frame,
161material for the read out pads, back panel, and readout boards). The
162material inside the active parts of the chambers (radiator, gas, wire
163planes, pad planes, glue, read out boards, etc.) is introduced by
164uniform layers of the corresponding material, whose thicknesses were
165chosen such to result in the correct radiation length. On top of the
166individual ROCs the multi chip modules (MCM) as well as the cooling
167pipes and cables are placed. One obvious simplification, already visible
168in Fig.~\ref{FIG_GEO:roc_geom}, is that in the AliRoot geometry the pipes
169run straight across the chambers instead of following the meandering path
170as in reality.
171%
172\subsection{Supermodules}
173\label{GEO:smframes}
174%
175\begin{figure}[htb]
176\begin{center}
177\begin{minipage}[b]{0.49\textwidth}
178\begin{center}
179\includegraphics[width=0.65\textwidth,angle=270]{plots/geo_smframe.eps}
180\end{center}
181\end{minipage}
182\begin{minipage}[b]{0.49\textwidth}
183\begin{center}
184\includegraphics[width=0.70\textwidth,angle=270]{plots/geo_sm.eps}
185\end{center}
186\end{minipage}
187\end{center}
188\caption{
189A TRD supermodule, as implemented in the AliRoot geometry. The left
190panel shows only the support structures of the aluminum frame, together
191with some service elements. The right panel shows a complete
192supermodule including some surrounding parts of the space frame.
193}
194\label{FIG_GEO:sm_geom}
195\end{figure}
196%
197The supermodule frames consist of the aluminum sheets on the sides, top,
198and bottom of a supermodule together with the traversing support structures.
199The left panel of Fig.~\ref{FIG_GEO:sm_geom} shows the structures that are
200implemented in the TRD geometry. Also, parts of the services like the LV
201power bus bars and cooling arterias can be seen. Additional electronics
202equipment (e.g. ``Sch\"utten-Box``) is represented by aluminum boxes that
203contain corresponding copper layers to mimic the present material. The
204services also include e.g. gas distribution boxes, cooling pipes, power and
205readout cables, and power connection panels. Part of the services extend
206into the baby and the back frame. Therefore, additional mother volumes
207have been introduced in order to accomodate this material. All supermodules
208have inserts of carbon fiber sheets in the bottom part of the aluminum
209casing, for the ones in front of the PHOS detector (sectors 11--15) also
210the top part includes carbon fiber inserts. The supermodules in the sectors
21113--15 do not contain any ROCs in the middle stack in order to provide the
212holes for the PHOS detector. Instead, gas tubes of stainless steel have
213been built in.
214%
215Generally, the TRD volumina start with the letter ``{\bf U}''. The geometry
216is defined by the function {\tt AliTRDgeometry::CreateGeometry()}, which
217generates the TRD mother volumes ({\bf UTI1}, {\bf UTI2}, {\bf UTI3}) and the
218volumes that constitute a single ROC. This function in turn also calls
219{\tt AliTRDgeometry::CreateFrame()} to create the TRD support frame,
220{\tt AliTRDgeometry::CreateServices()} to create the services, and
221{\tt AliTRDgeometry::GroupChambers()} which assembles the alignable
222volumes for a single ROC ({\bf UTxx}, where {\bf xx} is the detector
223number {\bf DET-SEC}, defined inside a single super module, see below). The
224materials, together with their tracking parameters, that are assigned to
225the volumina, are defined in {\tt AliTRD::CreateMaterials()}.
226In the following table the most important TRD volumina are described
227({\bf xx} = {\bf DET-SEC} number):
228%
229\begin{center}
230\begin{tabular}{l|l}
231Name & Description \\ \hline
232{\bf UTR1} & TRD mothervolume for default supermodules \\
233{\bf UTR2} & TRD mothervolume for supermodules in front of PHOS \\
234{\bf UTR3} & As {\bf UTR2}, but w/o middle stack \\ \hline
235{\bf UTxx} & Top volume of a single ROC \\
236 & Defines the alignable volume for a single ROC \\ \hline
237{\bf UAxx} & Lower part of the ROCs, including drift volume and radiator \\
238{\bf UDxx} & Amplification region \\
239{\bf UFxx} & Back panel, including pad planes and PCB boards of readout electronics \\
240{\bf UUxx} & Contains services on chambers (cooling, cables, DCS boards) and MCM chips \\
241\end{tabular}
242\end{center}
243%
244\subsection{Material Budget and Weight}
245%
246\begin{figure}[htb]
247\begin{center}
248\includegraphics[width=0.75\textwidth]{plots/geo_material_budget.eps}
249\end{center}
250\caption{
251The radiation length map in units of $X/X_{0}$ in part of the active
252detector area of super module 0 as a function of the pseudorapidity
253$\eta$ and the azimuth angle $\phi$, calculated from the geometry in
254AliRoot. Visible are the positions of the MCMs and the cooling pipes
255as hot spots.
256}
257\label{FIG_GEO:mat_budget}
258\end{figure}
259%
260The volumina defining a ROC contain several layers that represent the
261different materials present inside a chamber and which therefore define
262the material budget inside the sensitive areas:
263\begin{center}
264\begin{tabular}{l|l|l|l|c|c|c}
265Name & Mother & Material & Description & Thickness & Density & $X/X_{0}$ \\
266 & & & & [cm] & [g/cm$^{3}$] & [\%] \\ \hline
267{\bf URMYxx} & UAxx & Mylar & Mylar layer on radiator (x2) & 0.0015 & 1.39 & 0.005 \\
268{\bf URCBxx} & UAxx & Carbon & Carbon fiber mats (x2) & 0.0055 & 1.75 & 0.023 \\
269{\bf URGLxx} & UAxx & Araldite & Glue on the fiber mats (x2) & 0.0065 & 1.12 & 0.018 \\
270{\bf URRHxx} & UAxx & Rohacell & Sandwich structure (x2) & 0.8 & 0.075 & 0.149 \\
271{\bf URFBxx} & UAxx & PP & Fiber mats inside radiator & 3.186 & 0.068 & 0.490 \\ \hline
272{\bf UJxx} & UAxx & Xe/CO$_{2}$ & The drift region & 3.0 & 0.00495 & 0.167 \\
273{\bf UKxx} & UDxx & Xe/CO$_{2}$ & The amplification region & 0.7 & 0.00495 & 0.039 \\
274{\bf UWxx} & UKxx & Copper & Wire planes (x2) & 0.00011 & 8.96 & 0.008 \\ \hline
275{\bf UPPDxx} & UFxx & Copper & Copper of pad plane & 0.0025 & 8.96 & 0.174 \\
276{\bf UPPPxx} & UFxx & G10 & PCB of pad plane & 0.0356 & 2.0 & 0.239 \\
277{\bf UPGLxx} & UFxx & Araldite & Glue on pad plane & 0.0923 & 1.12 & 0.249 \\
278 & & Araldite & + additional glue (leaks) & 0.0505 & 1.12 & 0.107 \\
279{\bf UPCBxx} & UFxx & Carbon & Carbon fiber mats (x2) & 0.019 & 1.75 & 0.078 \\
280{\bf UPHCxx} & UFxx & Aramide & Honeycomb structure & 2.0299 & 0.032 & 0.169 \\
281{\bf UPPCxx} & UFxx & G10 & PCB of readout boards & 0.0486 & 2.0 & 0.326 \\
282{\bf UPRDxx} & UFxx & Copper & Copper of readout boards & 0.0057 & 8.96 & 0.404 \\
283{\bf UPELxx} & UFxx & Copper & Electronics and cables & 0.0029 & 8.96 & 0.202 \\
284\end{tabular}
285\end{center}
286This material budget has been adjusted to match the estimate given
287in~\cite{CLEMENS}, with the exception of the glue layer in the back panel
288({\bf UPGLxx}), which has been made thicker to include all the additional
289glue that has been applied to fix the gas leaks. Figure~\ref{FIG_GEO:mat_budget}
290shows the resulting radiation length map in the active detector area for
291super module 0, which has only carbon fiber inserts at the bottom and is
292thus one of the super modules with the largest material budget. It is
293clearly visible that the MCMs and the cooling pipes introduce hots spots
294in $X/X_{0}$. However, after averaging over the shown area, the mean
295value is found to be $\langle X/X_{0}\rangle =$~24.7~\%. For a supermodule
296with carbon fiber inserts at the top and the bottom one finds
297$\langle X/X_{0}\rangle =$~23.8~\% and in the regions of the PHOS holes (i.e.
298in the middle stack of supermodules 13--15) it is only
299$\langle X/X_{0}\rangle =$~1.9~\%.
300
301The total weight of a single TRD super module in the AliRoot geometry,
302including all services, is currently 1595kg, which is ca. 5\% short of its
303real weight. A single ROC of the type L0C1 with electronics and cooling
304pipes weighs 21.82kg.
305%
306\subsection{Naming Conventions and Numbering Schemes}
307%
308\begin{figure}[htb]
309\begin{minipage}[b]{0.49\textwidth}
310\begin{center}
311\includegraphics[width=\textwidth]{plots/sector_numbering.eps}
312\end{center}
313\end{minipage}
314\begin{minipage}[b]{0.49\textwidth}
315\begin{center}
316\includegraphics[width=\textwidth]{plots/layer_numbering.eps}
317\vspace{1.4cm}
318\end{center}
319\end{minipage}
320\begin{center}
321\includegraphics[width=0.60\textwidth]{plots/stack_numbering.eps}
322\end{center}
323\caption{
324Illustration of the TRD numbering scheme for super modules, defined in
325the global ALICE coordinate system: a) {\bf SECTOR} number, b)
326{\bf LAYER} number, c) {\bf STACK} number.
327}
328\label{FIG_GEO:sm_numbering}
329\end{figure}
330%
331The numbering schemes and the orientations of coordinate systems generally
332follow the official ALICE-TRD definition \cite{DAVID}. Therefore, the
333whole geometry is defined in the global ALICE coordinate system.
334%
335Inside the code we use the following nomenclature (see
336Fig.~\ref{FIG_GEO:sm_numbering}), which should be used consistently
337throughout the TRD code:
338%
339\begin{center}
340\begin{tabular}{l|l|l}
341Name & Definition & Range \\ \hline
342{\bf SECTOR} & TRD sector in azimuth (i.e. one supermodule) & 0--17 \\
343{\bf LAYER} & Layer inside a supermodule & 0--5 \\
344{\bf STACK} & Division of a supermodule along z-direction & 0--4 \\
345{\bf DET} & Single ROC in whole TRD & 0--539 \\
346{\bf DET-SEC} & Single ROC in one super module & 0--29
347\end{tabular}
348\end{center}
349%
350Due to the holes in front of the PHOS detector, naturally not all {\bf DET}
351numbers correspond to existing ROCs. A single ROC can thus be uniquely
352addressed by either using the three numbers
353({\bf LAYER}, {\bf STACK}, {\bf SECTOR}) or the single {\bf DET} number.
354The correspondence between the two possibilities is defined as:
355\begin{center}
356\mbox{{\bf DET} = {\bf LAYER} + {\bf STACK}$\times$5 + {\bf SECTOR}$\times$5$\times$4}
357\end{center}
358Additionally, there is a number that is unique inside a given super module (i.e.
359sector) and therefore has a range of 0~--~29:
360\begin{center}
361\mbox{{\bf DET-SEC} = {\bf LAYER} + {\bf STACK}$\times$5}
362\end{center}
363The class {\tt AliTRDgeometry} provides a set of functions that could/should
364be used to convert the one into the other:\\
365\hspace*{1.5cm}{\tt AliTRDgeometry::GetDetector(layer,stack,sector)} \\
366\hspace*{1.5cm}{\tt AliTRDgeometry::GetDetectorSec(layer,stack)} \\
367\hspace*{1.5cm}{\tt AliTRDgeometry::GetLayer(det)} \\
368\hspace*{1.5cm}{\tt AliTRDgeometry::GetStack(det)} \\
369\hspace*{1.5cm}{\tt AliTRDgeometry::GetSector(det)} \\
370%
371\subsection{Pad Planes}
372%
373All geometric parameters relevant to the pad planes are handled via the
374class {\tt AliTRDpadPlane}. This comprises the dimensions of the pad planes
375and the pad themselves, the number of padrows, padcolumns, and their tilting angle.
376The initialization of the needed {\tt AliTRDpadPlane} objects is done in
377{\tt AliTRDgeometry::CreatePadPlaneArray()}. The number of padrows can be 12
378(C0-type) or 16 (C1-type), the number of padcolumns is 144 in any case. Again,
379the numbering convention follows the definition given in \cite{DAVID}. Thus,
380the padrow numbers in a given pad plane increase from 0 to 11(15) with decreasing
381$z$-position, while the padcolumn numbers increase from 0 to 144 with increasing
382$\phi$ angle (i.e. counter clockwise). The tilting angle of the pads is 2~degrees,
383with alternating signs at different layers, beginning with +2~degrees for layer~0.
384The class {\tt AliTRDpadPlane} provides a variety of functions that allow to assign
385a pad number (row/column) to signals generated at a given hit position and which
386are used during the digitization process.
387%
388\section{Hit Generation}
389%
390{\it Author: C.~Blume (blume@ikf.uni-frankfurt.de)}
391\smallskip
392\\
393%
394In the case of the TRD a single hit corresponds to a cluster of electrons
395resulting from the ionization of the detector gas. This ionization can be due
396to the normal energy loss process of a charged particle or due to the
397absorption of a transition radiation (TR) photon. A single TRD hit, as
398defined in {\tt AliTRDhit} therefore contains the following data members:
399%
400\begin{center}
401\begin{tabular}{ll}
402{\tt fTrack} & Index of MC particle in kine tree \\
403{\tt fX} & X-position of the hit in global coordinates \\
404{\tt fY} & Y-position of the hit in global coordinates \\
405{\tt fZ} & Z-position of the hit in global coordinates \\
406{\tt fDetector} & Number of the ROC ({\bf DET} number) \\
407{\tt fQ} & Number of electrons created in the ionization step. Negative for TR hits \\
408{\tt fTime} & Absolute time of the hit in $\mu$s. Needed for pile-up events \\
409\end{tabular}
410\end{center}
411%
412On top of this, it is also stored in the {\tt TObject} bit field status word
413whether a hit is inside the drift or the amplification region
414(see {\tt AliTRDhit::FromDrift()} and {\tt AliTRDhit::FromAmplification()}).
415The creation of hits is steered by {\tt AliTRDv1::StepManager()}.
416%
417\subsection{Energy loss}
418%
419A charged particle, traversing the gas volume of the TRD chambers, will release
420charge proportional to its specific energy loss. In the TRD code this process
421is implemented in \\{\tt AliTRDv1::StepManager()}. This implementation used a
422fixed step size. The standard value here is 0.1~cm, but other values can be
423set via {\tt AliTRDv1::SetStepSize()}. The energy deposited in a given step is
424then calculated by the chosen MC program (typically Geant3.21), which after
425division by the ionization energy gives the number of electrons of the new hit.
426The version 2) will also work for an Ar/CO$_{2}$ mixture, which can be selected
427by \\{\tt AliTRDSimParam::SetArgon()}.
428%
429\subsection{Photons from transition radiation}
430%
431Additionally to the hits from energy loss, also hits from the absorbtion of
432TR photons are generated. This is done in {\tt AliTRDv1::CreateTRhit()}, which
433in turn is called by the chosen step manager for electrons and positrons
434entering the entering the drift volume. The process consists of two steps:
435first the number and energies of the TR photons have to be determined and then
436their absorbtion position inside the gas volume has to be calculated. The
437corresponding procedures, used by {\tt AliTRDv1::CreateTRhit()}, are
438implemented in {\tt AliTRDsimTR()}. This class contains a parametrization
439of TR photons generated by a regular foil stack radiator \cite{TRPHOT}. This
440parametrization has been tuned such that the resulting spectrum matches the
441one of the fiber radiator that used in reality. Since the TR production
442depends also on the momentum of the electron, the parameters have been
443adjusted in several momentum bins. After a TR photon has been generated and put
444on the particle stack, it is assumed that it follows a straight trajectory
445whose direction is determined by the momentum vector of the generating electron.
446Since the emission angle for TR photons is very small ($\sim 1/\gamma$) this
447is a valid approximation. The absorbtion length, which thus determines the
448TR hit position, is randomly chosen according to the absorbtion cross sections
449in the gas mixture. These energy dependent cross sections are also included
450in {\tt AliTRDsimTR}.
451%
452\subsection{Track references}
453%
454The TRD simulation produces track references ({\tt AliTrackReference}) each time
455a charged particle is entering the drift region and exiting the amplification
456region. These track references thus provide information on the position where
457the MC particle was entering and existing the sensitive region of a ROC, as well
458as on its momentum components at this positions. Also, the index to the MC particle
459in the kinematic tree is stored so that the full MC history can be retrieved.
460%
461\section{Digitization}
462%
463{\it Author: C.~Blume (blume@ikf.uni-frankfurt.de)}
464\smallskip
465\\
466%
467The second step in the simulation chain is the translation of the hit information,
468i.e. position and amount of deposited charge, into the final detector response
469that can be stored in digits objects ({\tt AliTRDdigits}):
470%
471\begin{center}
472\begin{tabular}{ll}
473{\tt fAmp} & Signal amplitude \\
474{\tt fId} & Number of the ROC ({\bf DET} number) \\
475{\tt fIndexInList} & Track index \\
476{\tt fRow} & Pad row number \\
477{\tt fColumn} & Pad column number \\
478{\tt fTime} & Time bin number \\
479\end{tabular}
480\end{center}
481%
482However, in practise {\tt AliTRDdigits} is not used to store the digits
483information. Instead the data containers described in \ref{DIGITS:containers}
484are used for this purpose. The digitization process includes as an
485intermediate step between hit and digits the so-called summable digits, or
486sdigits:
487\begin{center}
488\mbox{{\bf HITS} $\Longrightarrow$ {\bf SDIGITS} $\Longrightarrow$ {\bf DIGITS}}
489\end{center}
490They sdigits contain the detector signals before discretization and the addition
491of noise and are used to merge several events into a single one.
492%
493\subsection{Digitizer}
494%
495The class {\tt AliTRDdigitizer} contains all the necessary procedures to convert
496hits into sdigits and subsequently sdigits into digits. The standard sequence to
497produce sdigits, as would be initiated by {\tt AliSimulation}, is shown here:
498%
499\begin{center}
500\unitlength1.0cm
501\begin{picture}(10,9)
502\put(2.5,8.0){\framebox(5.0,0.8){{\tt MakeDigits()}}}
503\put(2.5,6.4){\framebox(5.0,0.8){{\tt SortHits()}}}
504\put(2.5,4.8){\framebox(5.0,0.8){{\tt ConvertHits(det)}}}
505\put(2.5,3.2){\framebox(5.0,0.8){{\tt ConvertSignals(det)}}}
506\put(2.5,1.6){\framebox(5.0,0.8){{\tt Signal2SDigits(det)}}}
507\put(2.5,0.0){\framebox(5.0,0.8){{\tt TRD.SDigits.root}}}
508\put(5.0,8.0){\vector(0,-1){0.8}}
509\put(5.0,6.4){\vector(0,-1){0.8}}
510\put(5.0,4.8){\vector(0,-1){0.8}}
511\put(5.0,3.2){\vector(0,-1){0.8}}
512\put(5.0,1.6){\vector(0,-1){0.8}}
513\put(5.0,1.2){\line(-1,0){4.0}}
514\put(1.0,1.2){\line(0,1){4.8}}
515\put(1.0,6.0){\vector(1,0){4.0}}
516\put(0.2,6.1){{\tt det=0-539}}
517\end{picture}
518\end{center}
519%
520The first function {\tt SortHits()} sorts the simulated hits according to
521their {\bf DET} number, so that the digitization procedures can be called
522for a single ROCs in the following loop. The function {\tt ConvertHits()}
523does the conversion of the hit information into a detector signal. In this
524procedure each electron of a given hit is in principle followed along its
525path from the position of the primary ionization towards the anode wire.
526The position of this electron can be modified by diffusion in the gas
527({\tt AliTRDdigitizer::Diffusion()}), ExB effect ({\tt AliTRDdigitizer::ExB()}),
528and absorbtion ({\tt AliTRDdigitizer::Absorbtion()}, off per default).
529The drift time of the electrons is also modified according to their distance
530to the corresponding anode wire position ({\tt AliTRDdigitizer::TimeStruct()}),
531since the electric field lines are not uniform inside the amplification region.
532This results in a non-isochronity of the drift time, which has been
533simulated with the GARFIELD program and the tabulated results of this
534simulation are used in the digitizing process to adjust the drift times
535accordingly. Once the position and the drift time of the electron at the
536anode wire plane are know, the signal induced on the pads can be calculated.
537This involves three effects: the pad response, which distributes the charge
538on several pads ({\tt AliTRDdigitizer::PadResponse()}), the time reponse due
539to the slow ion drift and the PASA response function, which distributes the
540charge onto the following time bins, ({\tt AliTRDdigitizer::TimeResponse()}),
541and the cross talk between neighbouring pads ({\tt AliTRDdigitizer::CrossTalk()}).
542At the end of this procedure, the charge seen by each pad in each time bin
543is available. Also, the indices of maximally three MC particles in the kine
544tree contributing to a given pad signal are stored, so that in a later
545analysis it can be tested which particle generated what signal.
546As a next step the signals could either directly be converted into {\bf DIGITS},
547or, which is the default procedure, they are stored as {\bf SDIGITIS}.
548The correponding functions ({\tt AliTRDdigitizer::Signal2SDigits()} and
549{\tt AliTRDdigitizer::Signal2ADC()}) are called from
550{\tt AliTRDdigitizer::ConvertSignals()}, depending on the configuation.
551The function {\tt AliTRDdigitizer::Signal2SDigits()} stores the signals as
552{\bf SDIGITS} in data structures of the type {\tt AliTRDarraySignal} (see
553section \ref{DIGITS:containers}).
554
555If desired, the {\bf SDIGITS} can now be added to the {\bf SDIGITS} from other
556simulated events, e.g. in order to embed a specific signal into a background
557event ({\tt AliTRDdigitizer::MergeSDigits()}). After this optional step, the
558{\bf SDIGITS} are finally being converted into {\bf DIGITS}. This process is
559steered by the function ({\tt AliTRDdigitizer::ConvertSDigits()}).
560%
561\begin{center}
562\unitlength1.0cm
563\begin{picture}(10,9)
564\put(2.5,8.0){\framebox(5.0,0.8){{\tt Exec()}}}
565\put(2.5,6.4){\framebox(5.0,0.8){{\tt SDigits2Digits()}}}
566\put(2.5,4.8){\framebox(5.0,0.8){{\tt MergeSDigits()}}}
567\put(2.5,3.2){\framebox(5.0,0.8){{\tt ConvertSDigits()}}}
568\put(2.5,1.6){\framebox(5.0,0.8){{\tt Signal2ADC(det)}}}
569\put(2.5,0.0){\framebox(5.0,0.8){{\tt TRD.Digits.root}}}
570\put(5.0,8.0){\vector(0,-1){0.8}}
571\put(5.0,6.4){\vector(0,-1){0.8}}
572\put(5.0,4.8){\vector(0,-1){0.8}}
573\put(5.0,3.2){\vector(0,-1){0.8}}
574\put(5.0,1.6){\vector(0,-1){0.8}}
575\put(5.0,1.2){\line(-1,0){4.0}}
576\put(1.0,1.2){\line(0,1){1.6}}
577\put(1.0,2.8){\vector(1,0){4.0}}
578\put(0.2,2.9){{\tt det=0-539}}
579\end{picture}
580\end{center}
581%
582The essential step in the final {\bf SDIGITS} $\Longrightarrow$ {\bf DIGITS}
583conversion is performed by the function {\tt AliTRDdigitizer::Signal2ADC()}.
584Here pad signals, that are stored as floats, are finally translated into
585integer ADC values. This conversion involves a number of parameters: the pad
586coupling and time coupling factors, the gain of the PASA and of the
587amplification at the anode wire, and the input range and baseline of the ADCs.
588The coupling factors take into account that only a fraction of the incoming
589signal is sampled in the digitization process. At this point also the relative
590gain factors derived from the calibration procedures for a given dataset will
591be used to distort the simulated data correspondingly. The noise is generated
592according to a Gaussian distribution of a given width and added to the output.
593Finally, the converted signals are discretized into the ADC values of the
594defined resolution. At this stage also the zero suppression mechanism is applied
595to the simulated ADC values ({\tt AliTRDdigitizer::ZS()}), in order to reduce
596the output volume (see section \ref{DIGITS:zs}). These {\bf DIGITS} can then
597serve as input to the raw data simulation (see section \ref{RAWSIM}).
598%
599\subsection{Simulation parameter}
600%
601The parameters that are needed to configure the digitization, are either
602read from the OCDB (e.g. calibration gain factors) or are taken from the
603parameter class {\tt AliTRDSimParam}. This class contains the default values
604of these parameters, but it can be configured in order to test different
605scenarios. The following table lists the available parameters:
606%
607\begin{center}
608\begin{tabular}{lll}
609Parameter & Description & Default value \\ \hline
610{\tt fGasGain} & Gas gain at the anode wire & 4000 \\
611{\tt fNoise} & Noise of the chamber readout & 1250 \\
612{\tt fChipGain} & Gain of the PASA & 12.4 \\
613{\tt fADCoutRange} & ADC output range (number of ADC channels) & 1023 (10bit) \\
614{\tt fADCinRange} & ADC input range (input charge) & 2000 (2V) \\
615{\tt fADCbaseline} & ADC intrinsic baseline in ADC channels & 0 \\
616{\tt fElAttachProb} & Probability for electron attachment per meter & 0 \\
617{\tt fPadCoupling} & Pad coupling factor & 0.46 \\
618{\tt fTimeCoupling} & Time coupling factor & 0.4 \\ \hline
619{\tt fDiffusionOn} & Switch for diffusion & kTRUE \\
620{\tt fElAttachOn} & Switch for electron attachment & kFALSE \\
621{\tt fTRFOn} & Switch for time response & kTRUE \\
622{\tt fCTOn} & Switch for cross talk & kTRUE \\
623{\tt fTimeStructOn} & Switch for time structure & kTRUE \\
624{\tt fPRFOn} & Switch for pad response & kTRUE \\
625{\tt fGasMixture} & Switch for gas mixture (0: Xe/CO2, 1: Ar/CO2) & 0 \\
626\end{tabular}
627\end{center}
628%
629\subsection{Digits manager}
630\label{DIGITS:manager}
631%
632{\it Author: H.~Leon~Vargas (hleon@ikf.uni-frankfurt.de)}
633\smallskip
634\\
635%
636The class {\tt AliTRDdigitsManager} handles arrays of data container
637objects in the form of ROOT's {\tt TObjArray}. Its main functionality
638is that it provides setters and getters for the information of each chamber.
639%
640\begin{figure}[htb]
641\begin{center}
642\includegraphics[width=0.85\textwidth]{plots/digitsmanager_containers.eps}
643\end{center}
644\caption{
645Data containers used in the class {\tt AliTRDdigitsManager}.
646}
647\label{FIG_DIG:manager}
648\end{figure}
649%
650\subsection{Data containers}
651\label{DIGITS:containers}
652%
653During simulation different kinds of information are created and stored
654in various data containers depending on their characteristics.
655These containers were designed with the idea of keeping the code as
656simple as possible and to ease its maintenance.
657The simulated signals or sdigits for a given row, column and time bin
658of each detector, as generated by \\ {\tt AliTRDdigitizer::ConvertHits()},
659are stored in an object of the class {\tt AliTRDarraySignal}. This
660class stores the data in an array of floating point values. In this
661case, the compression method takes as an argument a threshold. All the
662values equal or below that threshold will be set to zero during
663compression. The threshold can take any value greater or equal to zero.
664The sdigits data is used during event merging.
665
666In the simulation the information about the particles that generated the
667hits (index in kine tree) is stored for each detector in an object
668of the class {\tt AliTRDarrayDictionary}. In this case the information
669is stored in an array of integer values, which is initialized to -1.
670
671In the digitizer, the signals stored in the sdigits are converted
672afterwards into ADC values and kept in objects of the class
673{\tt AliTRDarrayADC}. This class saves the ADC values in an array of
674short values. The ADC range uses only the first 9 bits, bits 10 to 12
675are used to set the pad status. An uncompressed object of the class
676{\tt AliTRDarrayADC} should only contain values that are equal or
677greater than -1, because the compression algorithm of this class uses
678all the other negative values in the range of the short data type. The
679value -1 in the data array is used in the simulation to indicate where
680an ADC value was ``zero suppressed''. This is done in this way so we
681are be able to discriminate between real zeroes and suppressed zeroes.
682For the details of the use of pad status refer to the method
683{\tt AliTRDarrayADC::SetPadStatus()} in the implementation file of this class.
684%
685\subsection{Zero suppression}
686\label{DIGITS:zs}
687%
688{\it Author: H.~Leon~Vargas (hleon@ikf.uni-frankfurt.de)}
689\smallskip
690\\
691%
692The zero suppression algorithm was applied at the end of digitization
693in order to decrease the size of the digits file. The code is implemented
694in the class {\tt AliTRDmcmSim}. This algorithm is based on testing
695three conditions on the ADC values of three neighboring pads as seen
696in Fig.~\ref{FIG_DIG:zs} (for more information see the Data Indication
697subsection in the TRAP User Manual). The conditions are the following:\\
698
6991) Peak center detection:\\
700
701ADC-1(t) $\leq$ ADC(t) $\geq$ ADC+1(t)\\
702
7032) Cluster:\\
704
705ADC-1(t)+ADC(t)+ADC+1(t) $>$ Threshold\\
706
7073) Absolute Large Peak:\\
708
709ADC(t) $>$ Threshold\\
710
711If a given combination of these conditions is not fulfilled, the value ADC(t)
712is suppressed. The algorithm runs over all ADC values.
713%
714\begin{figure}[htb]
715\begin{center}
716\includegraphics[width=0.60\textwidth]{plots/zsuppression.eps}
717\end{center}
718\caption{
719Zero suppression code.
720}
721\label{FIG_DIG:zs}
722\end{figure}
723%
724\section{Raw Data Simulation}
725\label{RAWSIM}
726%
757c05c1 727\section{Trigger Simulation}
728\label{TRGSIM}
729{\it Author: J.~Klein (jklein@physi.uni-heidelberg.de)}
730\vspace{.3cm}
731
732The trigger generation chain of the TRD can be simulated within
733AliRoot as well. It contains several stages as in the real
734hardware (s. Fig.~\ref{fig:trgsim}).
735
736For each event the hits in the active volume are converted to
737digitized signals in the AliTRDdigitizer. The digital processing as
738done in the TRAP is simulated in its method \\
739{\tt RunDigitalProcessing()} calling the MCM simulation (in {\tt
740 AliTRDmcmSim}) which implements the filters, zero-suppression and
741tracklet calculation. Here the same integer arithmetics is used as in
742the real TRAP. The trigger-relevant preprocessed data, i.e. the
743tracklets, are stored using a dedicated loader. From there they are
744accessed by the GTU simulation which runs the stackwise tracking. The
745individual stages are discussed in more detail in the following
746sections.
747\begin{figure}
748\begin{center}
749\includegraphics[angle=0,width=0.9\textwidth]{plots/trgsim_ov}
750\end{center}
751\caption[Trigger simulation overview]{Overview of the trigger
752 simulation}
753\label{fig:trgsim}
754\end{figure}
755
756\subsection{MCM simulation}
757The MCM simulation is contained in {\tt AliTRDmcmSim}. This class
758mimicks the digital part of an MCM. It can be used for the simulation
759after digitization has been performed.
760
761Internally, an object of {\tt AliTRDmcmSim} can hold the data of
76221~ADC channels both raw and filtered. After the instantiation {\tt
763 Init()} has to be called to define the position of the MCM. Then,
764the data can be fed using either of the following methods:
765\begin{description}
766\item[{\tt SetData(Int\_t iadc, Int\_t *adc)}] ~\\ Set the data for the
767 given ADC channel {\it iadc} from an array {\it adc} containing the
768 data for all timebins.
769\item[{\tt SetData(Int\_t iadc, Int\_t it, Int\_t adc)}] ~\\ Set the data for the
770 given ADC channel {\it iadc} and timebin {\it it} to the value {\it adc}.
771\item[{\tt SetData(AliTRDarrayADC *adcArray)}] ~\\ Set the data for the
772 whole MCM from the digits array pointed to by {\it adcArray}.
773\item[{\tt LoadMCM(AliRunLoader *rl, Int\_t det, Int\_t rob, Int\_t mcm)}]
774 ~\\ This method automatically initializes the MCM for the specified
775 location and loads the relevant data via the runloader pointed by
776 {\it rl}.
777\end{description}
778
779After loading of the data the processing stages can be run
780individually:
781\begin{description}
782\item[{\tt Filter()}] ~\\ The pedestal, gain and tail cancellation filters
783 are run on the currently loaded raw data. The filter settings
784 (including bypasses) are used as configured in the TRAP
785 (s.~\ref{sec:trapcfg}). The unfiltered raw data is kept such that it
786 is possible to rerun Filter(), e.g. with different settings.
787\item[{\tt Tracklet()}] ~\\ The tracklet calculation operates on the
788 filtered data (which is identical to the unfiltered data if Filter()
789 was not called). First, the hits are calculated and the fit
790 registers filled. Subsequently, the straight line fits for the four
791 most promising tracklets are calculated.
792\item[{\tt ZSMapping()}] ~\\ This methods performs the zero-suppression
793 which can be based on different criteria (to be configured in the
794 TRAP).
795\end{description}
796
797The results of the MCM simulation can be accessed in different ways:
798\begin{description}
799\item[{\tt WriteData(AliTRDarrayADC *digits)}] ~\\ Hereby, the data are
800 written to the pointed digits array. It is part of the TRAP
801 configuration whether raw or filtered data is written (EBSF).
802\item[{\tt ProduceRawStream(UInt\_t *buf, Int\_t bufsize, UInt\_t
803 iEv)}] ~\\ Produce the raw data stream for this MCM as it will
804 appear in the raw data of the half-chamber.
805\item[{\tt ProduceTrackletStream(UInt\_t *buf, Int\_t bufsize)}] ~\\
806 Produce the raw stream of tracklets as they appear in raw data.
807\item[{\tt StoreTracklets()}] ~\\ The tracklets are stored via the
808 runloader. This has to be called explicitly, otherwise the tracklets
809 will not be written.
810\end{description}
811
812\subsection{TRAP configuration}
813\label{sec:trapcfg}
814The TRAP configuration is kept in {\tt AliTRDtrapConfig} which is
815implemented as singleton. After obtaining a pointer to the class by a
816call to {\tt AliTRDtrapConfig::Instance()} values can be changed and read by:
817\begin{description}
818\item[{\tt SetTrapReg(TrapReg\_t reg, Int\_t value, Int\_t det, Int\_t rob,
819 Int\_t mcm)}] ~\\ This sets the given TRAP register given as the
820 abbreviation from the TRAP manual with preceding 'k' (enum) to the
821 given value. If you specify {\it det}, {\it rob} or {\it mcm} the
822 values are changed for individual MCMs. Not specified the setting is
823 applied globally.
824\item[{\tt GetTrapReg(TrapReg\_t reg, Int\_t det, Int\_t rob, Int\_t mcm)}]
825 ~\\ This method gets the current value of the given TRAP
826 registers. If the values are set individually for different MCMs you
827 have to pass {\it det}, {\it rob} and {\it mcm}. Otherwise, these
828 parameters can be omitted.
829\item[{\tt PrintTrapReg(TrapReg\_t reg, Int\_t det, Int\_t rob, Int\_t mcm)}]
830 ~\\ It is similar to the preceding method but prints the information
831 to stdout.
832\end{description}
833
834The calculated tracklets can be stored by a call to {\tt AliTRDmcmSim::StoreTracklets()}.
835
836\subsection{Tracklet classes}
837In order to unify the different sources of tracklets, e.g. real data
838or simulation, all implementations of tracklets derive from the
839abstract base class {\tt AliTRDtrackletBase}. The following
840implementations are currently in use:
841\begin{description}
842\item[{\tt AliTRDtrackletWord}] ~\\ This class is meant to represent the
843 information as really available from the FEE, i.e. only a 32-bit
844 word and the information on the detector it was produced on.
845\item[{\tt AliTRDtrackletMCM}] ~\\ Tracklets of this type are produced in
846 the MCM simulation and contain additional MC information.
847\item[{\tt AliTRDtrackletGTU}] This class is used during the GTU tracking
848 and contains a pointer to a tracklet and information assigned to it
849 during the global tracking.
850\end{description}
851
852\subsection{GTU simulation}
853
854The simulation of the TRD global tracking on tracklets is steered by
855AliTRDgtuSim. This class provides all the interface. The following
856classes are involved:
857\begin{description}
858\item[{\tt AliTRDgtuParam}] ~\\ This class contains or generates the relevant
859 parameters used for the GTU tracking.
860\item[{\tt AliTRDgtuTMU}] ~\\ This class holds the actual tracking algorithm
861 as it runs in one Track Matching Unit (TMU) which corresponds to one
862 stack.
863\end{description}
864
865The GTU simulation can be run by calling {\tt
866 AliTRDgtuSim::RunGTU(AliLoader *loader, AliESDEvent *esd)} where
867{\it loader} points to the TRD loader and {\it esd} to an ESD
868event. The latter can be omitted in which case the output is not
869written to the ESD. The tracklets are automatically retrieved via the
870loader and the found tracks of type {\tt AliTRDtrackGTU} are
871internally stored in a tree for which a getter exists to access. If a
872pointer to an {\tt AliESDEvent} is given, the tracks are also written
873to the ESD (as {\tt AliESDTrdTrack}). For this the method {\tt
874 AliTRDtrackGTU::CreateTrdTrack()} is used which creates the {\tt
875 AliESDTrdTrack} (with reduced information compared to {\tt
876 AliTRDtrackGTU}).
877
878\subsection{CTP interface}
879
880The interface to the central trigger is defined in {\tt
881 AliTRDTrigger}. This class is called automatically during simulation
882and produces the trigger inputs for TRD (in {\tt
883 CreateInputs()}). They are only considered if they are part of the
884used trigger configuration (e.g. GRP/CTP/p-p.cfg).
885
886The actual trigger generation has to be contained in {\tt
887 Trigger()}. Currently, the GTU simulation is run from here using the
888previously calculated tracklets. The generated tracks are stored and
889the trigger inputs are propagated to CTP. Which trigger classes make
890use of the TRD inputs has to be defined in the trigger configuration.
891%
883031eb 892%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
893\newpage
894\setcounter{chapter}{2}
895\setcounter{section}{0}
757c05c1 896\Chapter{Reconstruction}\label{REC:}
897{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
883031eb 898\thispagestyle{empty}
899%
900\section{Raw Data Reading}
901%
757c05c1 902\section{Cluster Finding}\label{REC:CL:}
903%
bb774328 904\subsection[Cluster position reconstruction]{Cluster position reconstruction\footnote{The procedures described in this section are implemented in the functions
905{\tt AliTRDcluster::GetXloc()}, {\tt AliTRDcluster::GetYloc()},
906{\tt AliTRDcluster::GetSX()} and {\tt AliTRDcluster::GetSY()}.}}\label{REC:CL:rphi}
757c05c1 907{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
bb774328 908
909{\bf Calculation of cluster position in the radial direction} in local chamber coordinates (with respect to the anode wire
910position) is using the following parameters:\\
911 $t_0$ - calibration aware trigger delay $[\mu s]$\\
912 $v_d$ - drift velocity in the detector region of the cluster $[cm/\mu s]$\\
913 z - distance to the anode wire [cm]. By default average over the drift cell width\\
914 q \& $x_q$ - array of charges and cluster positions from previous clusters in the tracklet [a.u.]
915
916The estimation of the radial position is based on calculating the drift time and the drift velocity at the point of
917estimation. The drift time can be estimated according to the expression:
918\begin{equation}
919t_{drift} = t_{bin} - t_{0} - t_{cause}(x) - t_{TC}(q_{i-1}, q_{i-2}, ...)
920\end{equation}
921where $t_0$ is the delay of the trigger signal. $t_{cause}$ is the causality delay between ionisation electrons hitting
922the anode and the registration of mean signal by the electronics - due to the rising time of the TRF
923A second order correction here comes from the fact that the time spreading of charge at anode is the convolution of
924TRF with the diffusion and thus cross-talk between clusters before and after local clusters changes with drift length.
925$t_{TC}$ is the residual charge from previous (in time) clusters due to residual tails after tail cancellation.
926This tends to push cluster forward and depends on the magnitude of their charge.
927
928The drift velocity varies with the drift length (and distance to anode wire) as described by cell structure simulation.
929Thus one, in principle, can calculate iteratively the drift length from the expression:
930\begin{equation}
931x = t_{drift}(x)*v_{drift}(x)
932\end{equation}
933In practice we use a numerical approach (see AliTRDcluster::GetXcorr() and Figure \ref{FIG_CLUSTER:Xcorr} left) to correct for anisochronity obtained from MC
934comparison (see AliTRDclusterResolution::ProcessSigma() for the implementation). Also the calibration of the 0 approximation (no x dependence)
935for $t_{cause}$ is obtained from MC comparisons and impossible to disentangle in real life from trigger delay.
936\begin{figure}[htb]
937\begin{center}
938\includegraphics[width=0.48\textwidth]{plots/clusterXcorr.eps}
939\includegraphics[width=0.48\textwidth]{plots/clusterYcorr.eps}
940\end{center}
941\caption{
942Correction of the radial and $r-\phi$ position of the TRD cluster.}
943\label{FIG_CLUSTER:Xcorr}
944\end{figure}
945
946For {\bf the calculation of the $r-\phi$ offset} of the cluster from the middle of the center pad three methods are implemented:
947 - Center of Gravity (COG) see AliTRDcluster::GetDYcog()
948 - Look-up Table (LUT) see AliTRDcluster::GetDYlut()
949 - Gauss shape (GAUS) see AliTRDcluster::GetDYgauss()
950In addition for the case of LUT method position corrections are also applied (see AliTRDcluster::GetYcorr() and Figure \ref{FIG_CLUSTER:Xcorr} right).
951
952One may calculate the $r-\phi$ offset, based on the gaussian approximation of the PRF, from the signals $q_{i-1}$, $q_i$ and $q_{i+1}$ in the 3 adiacent pads by:
953\begin{equation}
954y = \frac{1}{w_{1}+w_{2}} [{w_{1}({y_{0}-\frac{W}{2}+\frac{s^{2}}{W}ln\frac{q_{i}}{q_{i-1}}})+w_{2}({y_{0}+ \frac{W}{2}+\frac{s^{2}}{W}ln\frac{q_{i+1}}{q_{i}}}})]
955\end{equation}
956where W is the pad width, $y_0$ is the position of the middle of the center pad and $s^2$ is given by
957\begin{equation}
958s^{2} = s^{2}_{0} + s^{2}_{diff} (x,B) + \frac{tg^{2}(\phi-\alpha_{L})*l^{2}}{12}
959\end{equation}
960with $s_0$ being the PRF for 0 drift and track incidence phi equal to the lorentz angle $\alpha_L$ and the diffusion term being described by:
961\begin{equation}
962s_{diff} (x,B) = \frac{D_{L}\sqrt{x}}{1+({\omega\tau}^{2}})
963\end{equation}
964with x being the drift length. The weights $w_1$ and $w_2$ are taken to be $q_{i-1}^2$ and $q_{i+1}^2$ respectively.
965
966{\bf Determination of shifts by comparing with MC}\\
967
968The resolution of the cluster corrected for pad tilt with respect to MC in the $r-\phi$ (measuring) plane can be
969expressed by:
970\begin{eqnarray}
971\Delta y&=&w - y_{MC}(x_{cl})\\
972w &=& y_{cl}^{'} + h*(z_{MC}(x_{cl})-z_{cl})\\
973y_{MC}(x_{cl}) &=& y_{0} - dy/dx*x_{cl}\\
974z_{MC}(x_{cl}) &=& z_{0} - dz/dx*x_{cl}\\
975y_{cl}^{'} &=& y_{cl}-x_{cl}*tg(\alpha_{L})
976\end{eqnarray}
977where $x_{cl}$ is the drift length attached to a cluster, $y_{cl}$ is the $r-\phi$ coordinate of the cluster measured by
978charge sharing on adjacent pads and $y_0$ and $z_0$ are MC reference points (as example the track references at
979entrance/exit of a chamber). If we suppose that both $r-\phi$ (y) and radial (x) coordinate of the clusters are
980affected by errors we can write
981\begin{eqnarray}
982x_{cl} &=& x_{cl}^{*} + \delta x\\
983y_{cl} &=& y_{cl}^{*} + \delta y
984\end{eqnarray}
985where the starred components are the corrected values. Thus by definition the following quantity
986\begin{equation}
987\Delta y^{*}= w^{*} - y_{MC}(x_{cl}^{*})
988\end{equation}
989has 0 average over all dependency. Using this decomposition we can write:
500851ab 990\begin{equation}\label{EQ_CLUSTER:shift}
bb774328 991<\Delta y>=<\Delta y^{*}> + <\delta x * (dy/dx-h*dz/dx) + \delta y - \delta x * tg(\alpha_{L})>
992\end{equation}
993which can be transformed to the following linear dependence:
994\begin{equation}
995<\Delta y>= <\delta x> * (dy/dx-h*dz/dx) + <\delta y - \delta x * tg(\alpha_{L})>
996\end{equation}
997if expressed as function of dy/dx-h*dz/dx. Furtheremore this expression can be plotted for various clusters
998i.e. we can explicitely introduce the diffusion ($x_{cl}$) and drift cell - anisochronity ($z_{cl}$) dependences. From
999plotting this dependence and linear fitting it with:
1000\begin{equation}
1001<\Delta y>= a(x_{cl}, z_{cl}) * (dy/dx-h*dz/dx) + b(x_{cl}, z_{cl})
1002\end{equation}
1003the systematic shifts will be given by:
1004\begin{eqnarray}
1005\delta x (x_{cl}, z_{cl}) &=& a(x_{cl}, z_{cl})\\
1006\delta y (x_{cl}, z_{cl}) &=& b(x_{cl}, z_{cl}) + a(x_{cl}, z_{cl}) * tg(\alpha_{L})
1007\end{eqnarray}
1008In Figure \ref{FIG_CLUSTER:shift} left there is an example of such dependency.
1009\begin{figure}[htb]
1010\begin{center}
1011\includegraphics[width=0.48\textwidth]{plots/clusterShiftMethod.eps}
1012\includegraphics[width=0.48\textwidth]{plots/clusterSigmaMethod.eps}
1013\end{center}
1014\caption{
1015Linear relation to estimate radial and $r-\phi$ cluster shifts and error.}
1016\label{FIG_CLUSTER:shift}
1017\end{figure}
1018
1019The occurance of the radial shift is due to the following conditions \\
1020- the approximation of a constant drift velocity over the drift length (larger drift velocities close to
1021 cathode wire plane)\\
1022- the superposition of charge tails in the amplification region (first clusters appear to be located at the
1023 anode wire)\\
1024- the superposition of charge tails in the drift region (shift towards anode wire)\\
1025- diffusion effects which convolute with the TRF thus enlarging it\\
1026- approximate knowledge of the TRF (approximate measuring in test beam conditions) \\
1027The numerical results for ideal simulations for the radial are displayed in Figure \ref{FIG_CLUSTER:Xcorr}.
1028
500851ab 1029The representation of $dy=f(y_cen, x_drift| layer, \phi=tg(\alpha_L))$ can be also used to estimate the systematic shift in the $r-\phi$
1030coordinate resulting from imperfection in the cluster shape parameterization. From Eq. \ref{EQ_CLUSTER:shift} with $\phi=tg(\alpha_L)$ one gets:
1031\begin{eqnarray}
1032<\Delta y>&=& <\delta x> * (tg(\alpha_{L})-h*dz/dx) + <\delta y - \delta x * tg(\alpha_{L})>\\
1033<\Delta y>(y_{cen})&=& -h*<\delta x>(x_{drift}, q_{cl}) * dz/dx + \delta y(y_{cen}, ...)
1034\end{eqnarray}
1035where all dependences are made explicit. This last expression can be used in two ways:
1036 - by average on the dz/dx we can determine directly dy (the method implemented here - see Figure \ref{FIG_CLUSTER:Xcorr} right)
1037 - by plotting as a function of dzdx one can determine both dx and dy components in an independent method.
bb774328 1038The occurance of the $r-\phi$ shift is due to the following conditions:\\
1039 - approximate model for cluster shape (LUT)\\
1040 - rounding-up problems
1041
1042
1043\subsection[Cluster error parameterization]{Cluster error parametrization\footnote{The procedures described in this section are implemented in the functions
1044{\tt AliTRDcluster::SetSigmaY2()}, {\tt AliTRDclusterResolution::ProcessCharge()}, {\tt AliTRDclusterResolution::ProcessCenterPad()}, {\tt AliTRDclusterResolution::ProcessSigma()} and {\tt AliTRDclusterResolution::ProcessMean()}.}}\label{REC:CL:error}
1045{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
1046
1047The error of TRD cluster is represented by the variance in the $r-\phi$ and radial direction. For the z direction the error is simply given by:
1048\begin{equation}
1049\sigma^2_z=L^2_{pad}/12
1050\end{equation}
1051
1052The parameters on which the {\bf $r-\phi$ error parameterization} depends are:\\
1053 - $s^2$ - variance due to PRF width for the case of Gauss model. Replaced by parameterization in case of LUT.\\
1054 - dt - transversal diffusion coeficient\\
1055 - exb - tg of lorentz angle\\
1056 - x - drift length - with respect to the anode wire\\
1057 - z - offset from the anode wire\\
1058 - tgp - local tangent of the track momentum azimuthal angle\\
1059
1060The ingredients from which the error is computed are:\\
1061 - PRF (charge sharing on adjacent pads) - see AliTRDcluster::GetSYprf()
1062 - diffusion (dependence with drift length and [2nd order] distance to anode wire) - see AliTRDcluster::GetSYdrift()\\
1063 - charge of the cluster (complex dependence on gain and tail cancellation) - see AliTRDcluster::GetSYcharge()\\
1064 - lorentz angle (dependence on the drift length and [2nd order] distance to anode wire) - see AliTRDcluster::GetSX()\\
1065 - track angle (superposition of charges on the anode wire) - see AliTRDseedV1::Fit()\\
1066 - projection of radial(x) error on $r-\phi$ due to fixed value assumed in tracking for x - see AliTRDseedV1::Fit()\\
1067
1068The last 2 contributions to cluster error can be estimated only during tracking when the track angle
1069is known (tgp). For this reason the errors (and optional position) of TRD clusters are recalculated during
1070tracking and thus clusters attached to tracks might differ from bare clusters.
1071
1072Taking into account all contributions one can write the the TRD cluster error parameterization as:
1073\begin{equation}\label{EQ_CLUSTER:error}
1074\sigma_{y}^{2} = (\sigma_{diff}*Gauss(0, s_{ly}) + \delta_{\sigma}(q))^{2} + tg^{2}(\alpha_{L})*\sigma_{x}^{2} + tg^{2}(\phi-\alpha_{L})*\sigma_{x}^{2}+[tg(\phi-\alpha_{L})*tg(\alpha_{L})*x]^{2}/12
1075\end{equation}
1076From this formula one can deduce that the simplest calibration method for PRF and diffusion contributions is
1077by measuring resolution at B=0T and phi=0. To disentangle further the two remaining contributions one has
1078to represent $s^2$ as a function of drift length.
1079
1080In the gaussian model the diffusion contribution can be expressed as:
1081\begin{equation}
1082\sigma^{2}_{y} = \sigma^{2}_{PRF} + \frac{x\delta_{t}^{2}}{(1+tg(\alpha_{L}))^{2}}
1083\end{equation}
1084thus resulting the PRF contribution. For the case of the LUT model both contributions have to be determined from
500851ab 1085the fit (see AliTRDclusterResolution::ProcessCenterPad() for details).\\
bb774328 1086
1087{\bf Parameterization with respect to the distance to the middle of the center pad}\\
1088
1089If $\phi = \alpha_L$ in Eq. \ref{EQ_CLUSTER:error} one gets the following expression:
1090\begin{equation}\label{EQ_CLUSTER:errorPhiAlpha}
1091\sigma_{y}^{2} = \sigma_{y}^{2}|_{B=0} + tg^{2}(\alpha_{L})*\sigma_{x}^{2}
1092\end{equation}
1093where we have explicitely marked the remaining term in case of absence of magnetic field. Thus one can use the
1094previous equation to estimate $s_y$ for B=0 and than by comparing in magnetic field conditions one can get the $s_x$.
1095This is a simplified method to determine the error parameterization for $s_x$ and $s_y$ as compared to the one
1096implemented in ProcessSigma(). For more details on cluster error parameterization please see also
500851ab 1097AliTRDcluster::SetSigmaY2().\\
bb774328 1098
1099{\bf Parameterization with respect to drift length and distance to the anode wire}\\
1100
500851ab 1101As the $r-\phi$ coordinate is the only one which is measured by the TRD detector we have to rely on it to
1102estimate both the radial (x) and $r-\phi$ (y) errors. This method is based on the following assumptions.
1103The measured error in the y direction is the sum of the intrinsic contribution of the $r-\phi$ measurement
1104with the contribution of the radial measurement - because x is not a parameter of Alice track model (Kalman).
1105\begin{equation}
1106\sigma^{2}|_{y} = \sigma^{2}_{y*} + \sigma^{2}_{x*}
1107\end{equation}
1108In the general case
1109\begin{eqnarray}
1110\sigma^{2}_{y*}& =& \sigma^{2}_{y} + tg^{2}(\alpha_{L})\sigma^{2}_{x_{drift}}\\
1111\sigma^{2}_{x*} &=& tg^{2}(\phi - \alpha_{L})*(\sigma^{2}_{x_{drift}} + \sigma^{2}_{x_{0}} + tg^{2}(\alpha_{L})*x^{2}/12)
1112\end{eqnarray}
1113where we have explicitely show the lorentz angle correction on y and the projection of radial component on the y
1114direction through the track angle in the bending plane ($\phi$). Also we have shown that the radial component in the
1115last equation has two terms, the drift and the misalignment ($x_0$). For ideal geometry or known misalignment one
1116can solve the equation
1117\begin{equation}
1118\sigma^{2}|_{y} = tg^{2}(\phi - \alpha_{L})*(\sigma^{2}_{x} + tg^{2}(\alpha_{L})*x^{2}/12)+ [\sigma^{2}_{y} + tg^{2}(\alpha_{L})\sigma^{2}_{x}]
1119\end{equation}
1120by fitting a straight line:
1121\begin{equation}
1122\sigma^{2}|_{y} = a(x_{cl}, z_{cl}) * tg^{2}(\phi - \alpha_{L}) + b(x_{cl}, z_{cl})
1123\end{equation}
1124the error parameterization will be given by:
1125\begin{eqnarray}
1126\sigma_{x} (x_{cl}, z_{cl}) &=& \sqrt{a(x_{cl}, z_{cl}) - tg^{2}(\alpha_{L})*x^{2}/12}\\
1127\sigma_{y} (x_{cl}, z_{cl}) &=& \sqrt{b(x_{cl}, z_{cl}) - \sigma^{2}_{x} (x_{cl}, z_{cl}) * tg^{2}(\alpha_{L})}
1128\end{eqnarray}
1129In Figure \ref{FIG_CLUSTER:shift} left, there is an example of such dependency.
1130
1131The error parameterization obtained by this method are implemented in the functions AliTRDcluster::GetSX() and
1132AliTRDcluster::GetSYdrift().
1133
1134An independent method to determine $s_y$ as a function of drift length (see AliTRDclusterResolution::ProcessCenterPad()) is to plot cluster resolution as a function of drift length at $\phi = \alpha_L$ as seen in Eq. \ref{EQ_CLUSTER:errorPhiAlpha}. Thus one can use directly the
1135previous equation to estimate $s_y$ for $B=0$ and than by comparing in magnetic field conditions one can get the $s_x$.
1136
1137One has to keep in mind that while the first method returns the mean $s_y$ over the distance
1138to the middle of center pad ($y_{center}$) distribution the second method returns the *STANDARD* value at $y_{center}=0$ (maximum). To recover the
1139standard value one has to solve the obvious equation:
1140\begin{equation}
1141\sigma_{y}^{STANDARD} = \frac{<\sigma_{y}>}{\int{s exp(s^{2}/\sigma) ds}}
1142\end{equation}
1143with "$<s_y>$" being the value calculated in first method and "sigma" the width of the $s_y$ distribution calculated in the second.\\
1144
bb774328 1145{\bf Parameterization with respect to cluster charge}\\
1146
1147In Eq. \ref{EQ_CLUSTER:errorPhiAlpha} one can explicitely write:
1148\begin{equation}
1149\sigma_{y}|_{B=0} = \sigma_{diff}*Gauss(0, s_{ly}) + \delta_{\sigma}(q)
1150\end{equation}
1151which further can be simplified to:
1152\begin{eqnarray}
1153<\sigma_{y}|_{B=0}>(q) &=& <\sigma_{y}> + \delta_{\sigma}(q)\\
1154<\sigma_{y}> &=& \int{f(q)\sigma_{y}dq}
1155\end{eqnarray}
1156The results for $s_y$ and $f(q)$ are displayed in Figure \ref{FIG_CLUSTER:errorCharge}:
1157\begin{figure}[htb]
1158\begin{center}
1159\includegraphics[width=0.48\textwidth]{plots/clusterQerror.eps}
500851ab 1160\includegraphics[width=0.48\textwidth]{plots/clusterSX.eps}
1161\includegraphics[width=0.48\textwidth]{plots/clusterSY.eps}
bb774328 1162\end{center}
1163\caption{
1164Cluster error parameterization for different components.}
1165\label{FIG_CLUSTER:errorCharge}
1166\end{figure}
1167The function has to extended to accomodate gain calibration scalling and errors.
1168
757c05c1 1169%
1170\setcounter{footnote}{0}
500851ab 1171\section{The TRD tracklet}\label{REC:Tracklet:}
1172{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}\\
757c05c1 1173
1174\noindent
1175The tracking in TRD can be done in two major ways:
1176\begin{itemize}
1177\item Track prolongation from TPC.
1178\item Stand alone track finding.
1179\end{itemize}
1180The first mode is the main tracking mode for all barrel tracks while the second
1181is used to peak-up track segments fully contained in the TRD fiducial volume
1182like conversions. Another feature of the TRD tracking besides the relative high
1183thickness (conversions) is the spatial correlation of the signals in the radial
1184direction due to residual tails in the cluster signals. This feature asked for
1185an intermediate step between clusters and tracks, the tracklets. The TRD
1186tracklets are linear fits of the clusters from one chamber. They are implemented
1187in the class {\tt AliTRDseedV1} and they represent the core of the TRD offline
1188reconstruction. In the following the tracklets will be described independently
1189of the framework in which they are living (tracking) in the sections
1190\ref{REC:Tracking:TrackletAttach}, \ref{REC:Tracking:TrackletFit} and
1191\ref{REC:Tracking:TrackletErrors} and than their usage will be outlined in the
1192barrel (section \ref{REC:Tracking:Propagate}) and stand alone tracking (section
1193\ref{REC:Tracking:Clusters2TracksStack}).
1194
bb774328 1195\subsection[Tracklet building]{Tracklet building - Attaching clusters to tracklet\footnote{The
757c05c1 1196procedures described in this section are implemented in the function
1197{\tt AliTRDseedV1::AttachClusters()}.}}\label{REC:Tracking:TrackletAttach}
1198
bb774328 1199Projective algorithm to attach clusters to seeding tracks. The following steps are performed :\\
12001. Collapse x coordinate for the full detector along track direction dydx.\\
12012. truncated mean on y (r-phi) direction\\
12023. purge clusters\\
12034. truncated mean on z direction\\
12045. purge clusters\\
1205Optionally one can use the z, dz/dx information from the sseding track to correct for tilting.
1206
1207We start up by defining the track direction in the xy plane and roads. The roads are calculated based
1208on tracking information (variance in the $r-\phi$ direction) and estimated variance of the standard
1209clusters (see AliTRDcluster::SetSigmaY2()) corrected for tilt (see GetCovAt()). From this the road is.
1210\begin{eqnarray}
1211r_{y} &=& 3*\sqrt{12*(\sigma^{2}_{Trk}(y) + \frac{\sigma^{2}_{cl}(y) + tg^{2}(\alpha_{L})\sigma^{2}_{cl}(z)}{1+tg^{2}(\alpha_{L})})}\\
1212r_{z} &= &1.5*L_{pad}
1213\end{eqnarray}
1214
1215\subsection[Tracklet fitting]{Tracklet fitting\footnote{The procedures described in this
757c05c1 1216section are implemented in the function {\tt AliTRDseedV1::Fit()}.}}\label{REC:Tracking:TrackletFit}
1217
1218{\bf Fit in the xy plane}\\
1219
1220The fit is performed to estimate the y position of the tracklet and the track
1221angle in the bending plane. The clusters are represented in the chamber coordinate
1222system (with respect to the anode wire - see {\tt AliTRDtrackerV1::FollowBackProlongation()}
1223on how this is set). The $x$ and $y$ position of the cluster and also their variances
1224are known from clusterizer level (see {\tt AliTRDcluster::GetXloc()},
1225{\tt AliTRDcluster::GetYloc()}, {\tt AliTRDcluster::GetSX()} and \\
1226{\tt AliTRDcluster::GetSY()}). If a Gaussian approximation is used to calculate
1227$y$ coordinate of the cluster the position is recalculated taking into account the
1228track angle.
1229
1230Since errors are calculated only in the $y$ directions, radial errors ($x$ direction)
1231are mapped to $y$ by projection i.e.
1232\begin{equation}
1233\sigma_{x|y} = tg(\phi) \sigma_{x}
1234\end{equation}
1235and also by the Lorentz angle correction.\\
1236
1237{\bf Fit in the xz plane}\\
1238
1239The "fit" is performed to estimate the radial position ($x$ direction) where pad
1240row cross happens. If no pad row crossing the $z$ position is taken from geometry
1241and radial position is taken from the xy fit (see below).
1242
1243There are two methods to estimate the radial position of the pad row cross:\\
12441. leading cluster radial position : Here the lower part of the tracklet is
1245considered and the last cluster registered (at radial $x_{0}$) on this segment
1246is chosen to mark the pad row crossing. The error of the $z$ estimate is given by :
1247\begin{equation}
500851ab 1248\sigma_{z} = tg(\theta) \Delta x_{x_{0}}/\sqrt{12}
757c05c1 1249\end{equation}
1250The systematic errors for this estimation are generated by the following sources:
1251 - no charge sharing between pad rows is considered (sharp cross)
1252 - missing cluster at row cross (noise peak-up, under-threshold signal etc.).
1253\\
12542. charge fit over the crossing point : Here the full energy deposit along
1255the tracklet is considered to estimate the position of the crossing by a fit
1256in the qx plane. The errors in the q directions are parameterized as
1257$\sigma_q = q^2$. The systematic errors for this estimation are generated by the
1258following sources:
1259 - no general model for the qx dependence
1260 - physical fluctuations of the charge deposit
1261 - gain calibration dependence.\\
1262
1263{\bf Estimation of the radial position of the tracklet}\\
1264
1265For pad row cross the radial position is taken from the xz fit (see above).
1266Otherwise it is taken as the interpolation point of the tracklet i.e. the
1267point where the error in $y$ of the fit is minimum. The error in the $y$
1268direction of the tracklet is (see {\tt AliTRDseedV1::GetCovAt()}):
1269\begin{equation}
1270\sigma_{y} = \sigma^{2}_{y_{0}} + 2x\:cov(y_{0}, dy/dx) + \sigma^{2}_{dy/dx}
1271\end{equation}
1272and thus the radial position is:
1273\begin{equation}
1274x = - cov(y_{0}, dy/dx)/\sigma^{2}_{dy/dx}
1275\end{equation}
1276
1277{\bf Estimation of tracklet position error}\\
1278
1279The error in $y$ direction is the error of the linear fit at the radial
1280position of the tracklet while in the $z$ direction is given by the cluster
1281error or pad row cross error. In case of no pad row cross this is given by:
1282\begin{eqnarray}
500851ab 1283\sigma_{y} &=& \sigma^{2}_{y_{0}} - 2cov^{2}(y_{0}, dy/dx)/\sigma^{2}_{dy/dx} + \sigma^{2}_{dy/dx}\\
1284\sigma_{z} &=& L_{pad}/\sqrt{12}
757c05c1 1285\end{eqnarray}
1286For pad row cross the full error is calculated at the radial position of the
1287crossing (see above) and the error in $z$ by the width of the crossing region -
1288being a matter of parameterization.
1289\begin{equation}
500851ab 1290\sigma_{z} = tg(\theta) \Delta x_{x_{0}}/\sqrt{12}
757c05c1 1291\end{equation}
1292In case of no tilt correction (default in the barrel tracking) the tilt is
1293taken into account by the rotation of the covariance matrix. See
1294{\tt AliTRDseedV1::GetCovAt()} or \ref{REC:Tracking:TrackletErrors} for details.
1295
bb774328 1296\subsection[Tracklet errors]{Tracklet errors\footnote{The procedures described in this
757c05c1 1297section are implemented in the function {\tt AliTRDseedV1::GetCovAt()}.}}\label{REC:Tracking:TrackletErrors}
1298
500851ab 1299In general, for the linear transformation
757c05c1 1300\begin{equation}
1301Y = T_{x} X^{T}
1302\end{equation}
500851ab 1303the error propagation has the general form
757c05c1 1304\begin{equation}
1305C_{Y} = T_{x} C_{X} T_{x}^{T}
1306\end{equation}
1307We apply this formula 2 times. First to calculate the covariance of the tracklet
1308at point $x$ we consider:
1309\begin{eqnarray}
1310T_{x} &=& (1\; x)\\
1311X&=&(y0\; dy/dx)\\
1312C_{X}&=&
1313 \left( \begin{array}{cc}
1314 Var(y0) & Cov(y0, dy/dx)\\
1315 Cov(y0, dy/dx) & Var(dy/dx)
1316 \end{array} \right)
1317\end{eqnarray}
1318and secondly to take into account the tilt angle
1319\begin{eqnarray}
1320T_{\alpha}& = &
1321 \left( \begin{array}{cc}
1322 cos(\alpha)&sin(\alpha)\\
1323 -sin(\alpha)& cos(\alpha)
1324 \end{array} \right)\\
1325X&=&(y\; z)\\
1326C_{X}&=&
1327 \left( \begin{array}{cc}
1328 Var(y) &0\\
1329 0 &Var(z)
1330 \end{array} \right)
1331\end{eqnarray}
1332using simple trigonometrics one can write for this last case
1333\begin{equation}
1334C_{Y}=\frac{1}{1+tg^{2}\alpha}
1335 \left( \begin{array}{cc}
1336 \sigma_{y}^{2}+tg^{2}(\alpha)\sigma_{z}^{2} & tg(\alpha)(\sigma_{z}^{2}-\sigma_{y}^{2})\\
1337 tg(\alpha)(\sigma_{z}^{2}-\sigma_{y}^{2}) & \sigma_{z}^{2}+tg^{2}(\alpha)\sigma_{y}^{2}
1338 \end{array} \right)
1339\end{equation}
1340which can be aproximated for small alphas (2 deg) with
1341\begin{equation}
1342C_{Y}=
1343 \left( \begin{array}{cc}
1344 \sigma_{y}^{2} & (\sigma_{z}^{2}-\sigma_{y}^{2})tg(\alpha)\\
1345 ((\sigma_{z}^{2}-\sigma_{y}^{2})tg(\alpha) & \sigma_{z}^{2}
1346 \end{array} \right)
1347\end{equation}
1348before applying the tilt rotation we also apply systematic uncertainties
1349to the tracklet position which can be tuned from outside via the
1350{\tt AliTRDrecoParam::SetSysCovMatrix()}. They might account for extra
1351misalignment/miscalibration uncertainties.
1352
500851ab 1353\subsection[Tracklet dE/dx]{Energy loss calculations\footnote{The procedures described in this
1354section are implemented in the function {\tt AliTRDseedV1::CookdEdx()} and {\tt AliTRDseedV1::GetdQdl()}.}}\label{REC:Tracking:TrackletdEdx}
1355
1356Using the linear approximation of the track inside one TRD chamber (TRD tracklet)
1357the charge per unit length can be written as:
1358\begin{equation}
1359\frac{dq}{dl}(x) = \frac{q_{c}}{dx(x) * \sqrt{1 + (\frac{dy}{dx})^{2}_{fit} + (\frac{dz}{dx})^{2}_{ref}}}
1360\end{equation}
1361where $q_c$ is the total charge collected in the current time bin and dx is the length
1362of the time bin (see Figure \ref{FIG_TRACKLET:dEdx} left). The representation of charge deposit used for PID differs thus in principle from the measured dQ/dt distribution (see Figure \ref{FIG_TRACKLET:dEdx} right)
1363\begin{figure}[htb]
1364\begin{center}
1365% \includegraphics[width=0.48\textwidth]{plots/trackletDQDL.eps}
1366% \includegraphics[width=0.48\textwidth]{plots/trackletDQDT.eps}
1367\end{center}
1368\caption{
1369Enargy loss measurement on the tracklet as a function of drft length [left] and as a function of drift time [right] for different particle species.}
1370\label{FIG_TRACKLET:dEdx}
1371\end{figure}
1372
1373The following correction are applied :
1374 - charge : pad row cross corrections
1375 [diffusion and TRF assymetry] TODO
1376 - dx : anisochronity.
1377Due to anisochronity of the TRD detector drift velocity varies as function of drift length and distance to the anode wire. Thus
1378\begin{eqnarray}
1379dx(x) &=& dx(\inf) + \delta_x(x,z)\\
1380 &=& dt*v_d^{\inf} + \delta_x(x,z)
1381\end{eqnarray}
1382the dependence of $\delta_x$ can be found in Figure \ref{FIG_CLUSTER:Xcorr}.
1383
1384\setcounter{footnote}{0}
1385\section{Tracking}\label{REC:Tracking:}
1386{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}\\
1387
1388The tracking procedures in TRD are responsible to attach clusters to tracks
1389and to estimate/update the track parameters accordingly. The main class involved
1390in this procedure is {\tt AliTRDtrackerV1} and the helper classes {\tt AliTRDcluster},
1391{\tt AliTRDseedV1} and {\tt AliTRDtrackV1}. Additionally, information from
1392{\tt AliTRDrecoParam} is mandatory to select the proper setup of the reconstruction.
1393\\
1394
bb774328 1395\subsection[Track propagation barrel]{Track propagation in barrel tracking\footnote{The
757c05c1 1396procedures described in this section are implemented in the function
1397{\tt AliTRDtrackerV1::PropagateBack()}.}}\label{REC:Tracking:Propagate}
1398
1399{\bf TRD Tracklet initialization and Kalman fit}\footnote{The procedures
1400described in this section are implemented in the function
1401{\tt AliTRDtrackerV1::FollowBackProlongation()}.}\\
1402
bb774328 1403\subsection[Stand alone track finding]{Stand alone track finding\footnote{The procedures
757c05c1 1404described in this section are implemented in the function
1405{\tt AliTRDtrackerV1::Clusters2TracksStack()}.}}\label{REC:Tracking:Clusters2TracksStack}
1406
1407{\bf TRD track finding}\footnote{The procedures described in this section
1408are implemented in the function {\tt AliTRDtrackerV1::MakeSeeds()}.}
1409\\
883031eb 1410%
1411%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1412\newpage
1413\setcounter{chapter}{3}
1414\setcounter{section}{0}
1415\Chapter{Calibration}
1416%
1417{\it Author: R.~Bailhache (rbailhache@ikf.uni-frankfurt.de)}
1418\smallskip
1419\\
1420%
1421\section{Database Entries}
1422A local database with default parameters can be found in the AliRoot
1423installation directory. The official database is in Alien under the
1424directory
1425{\tt /alice/data/$\langle$year$\rangle$/$\langle$LHCPeriod$\rangle$/OCDB}.
1426The calibration objects are stored in root files named according to their
1427run validity range, their version and subversion number. For the TRD they
1428are in the subdirectory {\tt \$AliRoot/OCDB/TRD/Calib} and correspond to
1429a perfect TRD detector. The parameters are listed in Tab.\ref{entriesdatabase}.\\
1430\begin{table} [h]
1431 \begin{center}
1432 \begin{tabular}{|c|c|c|c|c|c|}
1433 \hline Parameter & Description & Number of & Data type & Unit & Default value \\
1434 & & channels & & & \\ \hline
1435 ChamberGainFactor & Mean gas gain & 540 & Float & $-$ & 1.0 \\
1436 $ $ & per chamber & & & & \\ \hline
1437 LocalGainFactor & Gas gain & 1181952 & UShort & $-$ & 1.0 \\
1438 & per pad & 1181952 & UShort & $-$ & 1.0 \\ \hline
1439 ChamberVdrift & Mean drift velocity & 540 & Float & cm$/$$\mu$s & 1.5 \\
1440 & per chamber & 540 & Float & cm$/$$\mu$s & 1.5 \\ \hline
1441 LocalVdrift & Drift velocity & 1181952 & UShort & $-$ & 1.0 \\
1442 & per pad & 1181952 & UShort & $-$ & 1.0 \\ \hline
1443 ChamberT0 & Minimum timeoffset & 540 & Float & timebin & 0.0 \\
1444 & in the chamber & 540 & Float & timebin & 0.0 \\ \hline
1445 LocalT0 & Timeoffset & 1181952 & UShort & timebin & 0.0 \\
1446 & per pad & & & & \\ \hline
1447 PRFWidth & Width of the PRF & 1181952 & UShort & pad width & 0.515 ( layer 0) \\
1448 $ $ & per pad & $ $ & $ $ & $ $ & 0.502 ( layer 1) \\
1449 $ $ & $ $ & $ $ & $ $ & $ $ & 0.491 ( layer 2) \\
1450 $ $ & $ $ & $ $ & $ $ & $ $ & 0.481 ( layer 3) \\
1451 $ $ & $ $ & $ $ & $ $ & $ $ & 0.471 ( layer 4) \\
1452 $ $ & $ $ & $ $ & $ $ & $ $ & 0.463 ( layer 5) \\ \hline
1453 DetNoise & Scale factor & 540 & Float & $-$ & 0.1 \\ \hline
1454 PadNoise & Noise & 1181952 & UShort & ADC & 12 \\
1455 & per pad & & & counts & \\ \hline
1456 PadStatus & Status & 1181952 & char & $-$ & $-$ \\
1457 & per pad & & & & \\ \hline
1458 \end{tabular}
1459 \end{center}
1460\caption{\label{entriesdatabase}Entries in the database}
1461\end{table}
1462%
1463They are related to the calibration of:
1464\begin{itemize}
1465\item the gas gain: {\tt ChamberGainFactor} and {\tt LocalGainFactor}
1466\item the electron drift velocity: {\tt ChamberVdrift} and {\tt LocalVdrift}
1467\item the timeoffset: {\tt ChamberT0} and {\tt LocalT0}
1468\item the width of the Pad Response Function: {\tt PRFWidth}
1469\item the noise per channel: {\tt DetNoise}, {\tt PadNoise} and {\tt PadStatus}.
1470\end{itemize}
1471To save disk space the values per pad are stored in UShort (2 Bytes)
1472format in AliTRDCalROC objects, one per chamber, that are members of
1473a general {\tt AliTRDCalPad} object. The final constants have a
1474numerical precision of 10$^{-4}$. They are computed by
1475multiplication (gain, drift velocity and noise) or addition (timeoffset)
1476of the detector and pad coefficients. From the pad noise level a status
1477is determined for each pad ( masked, bridgedleft, bridgedright, read by
1478the second MCM, not connected). One example macro ({\tt AliTRDCreate.C})
1479to produce a local database is given in the {\tt \$AliRoot/TRD/Macros}
1480directory.\\
1481During the simulation of the detector response and the reconstruction
1482of the events the parameters are used to compute the amplitude of the
1483signal and its position inside the detector. The database has to be
1484first choosen with the help of the {\tt AliCDBManager}. The parameters
1485are then called by an {\tt AliTRDcalibDB} instance. The macro
1486{\tt \$AliRoot/TRD/Macros/ReadCDD.C} shows how to read a local database
1487and plot the gas gain or drift velocity as function of the detector
1488number or pad number.
1489%
1490\section{DAQ Calibration}
1491Calibration procedures are performed online during data-taking on
1492different systems. The principal role of the Data AcQuisition System is
1493to build the events and archive the data to permanent storage tapes. In
1494addition it also provides an efficient access to the data. Nevertheless
1495the complete reconstruction of the events with tracks is not available.
1496Two algorithms are executed on DAQ for the TRD: a pedestal algorithm and
1497an algorithm for the drift velocity and timeoffset. They are implemented
1498as rpm packages, that can be easily built inside AliRoot compiled with
1499the DATE software \cite{DATE}. The outputs of the algorithms are stored
1500in root files and put on the DAQ File Exchange Server (FXS). At the end
1501of the run they are picked up by the so called SHUTTLE and further
1502processed in the Preprocessor to fill finally the OCDB.
1503\begin{figure}[h]
1504 \centering\mbox{\epsfig{file=plots/baselinenoisedet0run34510ex.eps,width=0.45\textwidth}}
1505 \caption{\label{baselinenoisedet0run34510ex}2D histogram of the
1506detector 0 (SM 0, S0, L0) with the ADC value distributions around
1507the baseline (10 ADC counts) for each pad (PEDESTAL run 34510).}
1508\end{figure}
1509\subsection{Pedestal algorithm}
1510During a pedestal run empty events without zero suppression are taken
1511with the TRD alone and a random trigger. They are used to determine
1512the noise in ADC counts of each pad. The algorithm can be found in the
1513{\tt TRDPEDESTALda.cxx} file of the AliRoot TRD directory. It is
1514executed on the Local Data Concentrators (LDCs), which are part of the
1515dataflow and gives access to sub-events. The TRD has three LDCs
1516corresponding to the following blocks of supermodules (SMs):
1517\begin{itemize}
1518\item 0-1-2-9-10-11
1519\item 3-4-5-12-13-14
1520\item 6-7-8-15-16-17
1521\end{itemize}
1522Three algorithms are therefore executed in parallel during a PEDESTAL
1523run for a full installed TRD. After about 100 events, the data-taking
1524stops automatically and a 2D histogram is filled for each chamber with
1525the ADC amplitude distributions around the baseline for each pad. Such
1526a histogram is shown in Fig.\ref{baselinenoisedet0run34510ex} for
1527chamber 0 (SM 0 Stack 0 Layer 0).
1528\begin{figure}[h]
1529 \centering\mbox{\epsfig{file=plots/run38125sm0nounfold.eps,width=0.88\textwidth,height=0.55\textwidth}}
1530 \caption{\label{run38125sm0nounfold}Noise in the six planes of
1531SM 0 (PEDESTAL run 38125). The five stacks in each layer are in
1532the {\it{z}} direction.}
1533\end{figure}
1534The chambers should be so configured that the data is without zero
1535suppression otherwise an error message appears on the DAQ online
1536Logbook. The container class is called {\tt AliTRDCalibPadStatus}
1537and allows to further fit the distributions with a Gaussian to
1538determine the baseline and noise of each pad. The function is called
1539{\tt AliTRDCalibPadStatus::AnalyseHisto()}. In
1540Fig.\ref{run38125sm0nounfold} the noise in SM 0 is plotted for the
1541PEDESTAL run 38125. It shows stripe patterns of higher noise in the
1542$z$-direction (beam direction) correlated to the static pad capacitance
1543of the pad plane. The noise distributions has to be first corrected
1544for the expected noise variations induced by the pad capacitance
1545before a status can be given to each pad. This is not done on the DAQ
1546but just before storing the parameters inside the Offline Condition
1547Database (OCDB) in the Preprocessor.
1548
1549\subsection{Drift velocity and timeoffset algorithm}
1550The drift velocity and timeoffset are calibrated with physics events,
1551$pp$ or $PbPb$ collisions. The algorithm is called
1552{\tt TRDVDRIFTda.cxx} and can be found in the AliRoot TRD directory.
1553It is executed on a dedicated monitoring server, which is not part
1554of the dataflow and gives access to full events of the TRD. The
1555physics events are used to fill continuously during data-taking an
1556average pulse height for each detector. They are stored in a
1557{\tt TProfile2D}, which is a member of a { \tt AliTRDCalibraFillHisto}
1558object. The {\tt TProfile2D} is written at the end of the run in a
1559root file put on the DAQ FXS.\\
1560\begin{figure}[h]
1561 \centering\mbox{\epsfig{file=plots/referenceph2d.eps,width=0.6\textwidth,,height=0.5\textwidth}}
1562 \caption{\label{referenceph2d}2D histogram containing the average
1563pulse height distributions of each calibration group (here detector),
1564produced with decalibrated simulated $pp$ events.}
1565\end{figure}
1566
1567Fig.\ref{referenceph2d} shows an output {\tt TProfile2D} obtained
1568from simulated decalibrated $pp$ collisions at 14\,TeV. The first
1569peak in time corresponds to the amplification region, where the
1570contributions of ionization electrons, which come from both sides
1571of the anode wire plane, are overlapping. The flat plateau results
1572from the electrons in the drift region. The tail is caused by the
1573Time Response Function. From this average signal as function of time
1574the drift velocity and timeoffset can be extracted by fit procedures.
1575This last step is performed in the Preprocessor.\\
1576Since no tracking is available on DAQ, a simple tracklet finder is
1577used. It was optimized for a low charged particle multiplicity
1578environment. The algorithm looks for a maximum of the signal
1579amplitudes in the chamber after integration over all timebins. The
1580average pulse height is then filled for a spot of two pad rows
1581($z$ direction) and four pad columns ($r\phi$ direction) around the
1582maximum. Further details can be found in the function
1583{\tt AliTRDCalibraFillHisto::ProcessEventDAQ}.
1584%
1585\section{HLT Calibration}
1586The High Level Trigger has the big advantage to provide an online
1587reconstruction of the events. The idea is then to run the calibration
1588procedures in a transparent way, independent whether online or
1589offline. The same function
1590\\{\tt AliTRDCalibraFillHisto::UpdateHistogramsV1(AliTRDtrackV1 *t)}
1591is used to fill the $dE/dx$ distributions (gain), the average pulse
1592height (drift velocity and timeoffset) and the Pad Response Function
1593for each detector in respectively one {\tt TH2I} and two
1594{\tt TProfile2Ds}. The calibration is nevertheless done per chamber,
1595whereas by integrating statistics it will be possible to get the gain,
1596drift velocity and timeoffset distributions inside the chambers offline.
1597Therefore the class {\tt AliTRDCalibraFillHisto} contains a flag
1598({\tt fIsHLT}) to avoid extra calculations not needed at the detector
1599level.\\
1600\begin{figure}[hbt]
1601 \centering\mbox{\epsfig{file=plots/referencech2d.eps,width=0.55\textwidth,,height=0.45\textwidth}}
1602 \caption{\label{referencech2d}A 2D histogram containing the
1603$dE$$/$$dx$ distributions of each detector. These were produced
1604with decalibrated simulated $pp$ events.}
1605\end{figure}
1606
1607Fig.\ref{referencech2d} shows one example of a {\tt TH2I} histogram,
1608where the $dE/dx$ distributions of each detector is stored for $pp$
1609collisions at 14\,TeV. No minimal $p_{T}$ cut was applied on the
1610TRD tracks. Assuming that the charged particles are uniformy
1611distributed over the TRD chambers, the position of the Most Probable
1612Value of the $dE/dx$ distribution is used to calibrate the gain.\\
1613At the beginning of each run, a local copy of the OCDB is updated
1614on the HLT cluster: the HCDB (HLT Condition Database). The last set
1615of calibration objects are used to reconstruct the events. The gain
1616correction preformed during the tracking has to be taken into account
1617when filling the $dE/dx$ distributions. That is why the calibration
1618algorithm has to know which database was used during the
1619reconstruction. The TRD HLT code can be found in the {\tt HLT/TRD}
1620subdirectory of the AliRoot installation. The calibration is
1621implemented as an {\tt AliHLTTRDCalibrationComponent}, whose members
1622are an {\tt AliCDBManager} together with the path for the current
1623database used, and an {\tt AliTRDCalibraFillHisto} object. The main
1624functions are:
1625\begin{itemize}
1626\item {\tt AliHLTCalibrationComponent::InitCalibration}, where the
1627{\tt TH2I} and {\tt TProfile2Ds} are created.
1628\item {\tt AliHLTCalibrationComponent::ProcessCalibration}, where
1629the function\\
1630{\tt AliTRDCalibraFillHisto::UpdateHistogramsV1(AliTRDtrackV1 *t)}
1631is called to fill the histograms.
1632\item {\tt AliHLTCalibrationComponent::FormOutput}, which returns
1633a {\tt TObjArray} with the histograms.
1634\end{itemize}
1635The histograms are shipped at the end of each run to the HLT File
1636Exchange Server to be picked up by the SHUTTLE and further processed
1637by the Preprocessor, exactly as the data from the calibration on DAQ.
1638%
1639\section{Preprocessor}
1640%
1641The online systems, like the Detector Control System (DCS), the DAQ
1642and the HLT, are protected from outside by a firewall. A special
1643framework, called the SHUTTLE, has been developped to retrieve offline
1644data in the online systems or store relevant information from the
1645online systems in the OCDB. The SHUTTLE has access to the DCS, DAQ
1646and HLT FXS. At the end of each run the reference data, outputs of
1647the calibration algorithms on DAQ and HLT, are retrieved and further
1648processed to determine the calibration constants (gain, drift velocity,
1649timeoffset and width of the Pad Response Function). The reference
1650data are finally stored in the Grid reference Data Base, whereas the
1651results of the fit procedures are stored in the OCDB.\\
1652The code is contained in the {\tt AliTRDPreprocessor} class. The
1653Process function is executed for the run types: PEDESTAL, STANDALONE,
1654DAQ and PHYSICS.
1655\begin{itemize}
1656\item The PEDESTAL run are dedicated to the calibration of the noise
1657on DAQ. Only the output of the DAQ pedestal algorithm is retrieved at
1658the SHUTTLE. From the noise and baseline of each pad, a pad status is
1659determined. Disconnected pads are recognizable by a small noise.
1660Bridged pads have the same noise and baseline. The noise and
1661padstatus of the previous pedestal run in the OCDB are taken for half
1662chambers, which were not On. Finally the database entries
1663{\tt DetNoise}, {\tt PadNoise} and {\tt PadStatus} are populated in
1664the OCDB. More informations can be found in the function
1665\\{\tt AliTRDPreprocessor::ExtractPedestals}.
1666\item The STANDALONE runs are used to check the data integrity or the
1667correlated noise. The data are taken with the TRD alone and a random
1668trigger. Only the DCS data are retrieved.
1669\item The DAQ run are test runs for the DAQ people. Only the DCS data
1670are retrieved.
1671\item The PHYSICS run are global runs including more than one detector
1672and different trigger clusters. They are used for the calibration of
1673the gain, driftvelocity and timeoffset, and width of the PRF. Therefore
1674the output of the calibration algorihms running on HLT are retrieved.
1675If the procedure is not successful the output of the
1676driftvelocity$/$timeoffset algorithm on DAQ is also retrieved. The
1677reference data, the histograms, are fitted using an
1678{\tt ALiTRDCalibraFit} instance:
1679\begin{itemize}
1680\item {\tt AliTRDCalibraFit::AnalyseCH(const TH2I *ch)} determines
1681the MPVs of the $dE/dx$ distributions and compares them to a reference
1682value.
1683\item {\tt AliTRDCalibraFit::AnalysePH(const TProfile2D *ph)} fits
1684the average pulse height and determines the position of the amplification
1685region peak and the end of the drift region for each chamber. Knowing
1686the length of the drift region one can deduce the drift velocity. The
1687amplification peak gives also information on the timeoffset.
1688\item {\tt AliTRDCalibraFit::AnalysePRFMarianFit(const TProfile2D *prf)}
1689determines the spread of the clusters as function of azimuthal angle of
1690the track. The minimum gives the width of the PRF.
1691\end{itemize}
1692The results of each fit procedure are stored in a {\tt TObjArray} of
1693\\{\tt AliTRDCalibraFit::AliTRDFitInfo} objects, one per chamber, which
1694is a member of the {\tt AliTRDCalibraFit} instance. The functions
1695{\tt AliTRDCalibratFit::CreateDetObject*} and {\tt ::CreatePadObject*}
1696allow to create from the {\tt TObjArray} the final calibration objects,
1697that have to be put in the OCDB.
1698\end{itemize}
1699Tab.\ref{taskruntype} summarizes the tasks executed by the prepocessor
1700for each run type.
1701\begin{table}[h]
1702\begin{center}
1703\begin{tabular} {|c|c|c|c|c|}
1704\hline run type & DCS data points & DCS FXS & DAQ FXS & HLT FXS \\
1705 & temperatures & electronic & calibration DA & calibration DA \\
1706 & voltages, etc $\cdots$ & configuration & noise/($v_{dE}$$/$$t_{0}$)
1707& $g$/($v_{dE}$$/$$t_{0}$)/$\sigma_{PRF}$ \\
1708\hline DAQ & yes & yes & no & no \\\hline
1709\hline PEDESTAL & no & no & yes (noise) & no \\\hline
1710\hline STANDALONE & yes & yes & no & no \\\hline
1711\hline PHYSICS & yes & yes & yes ($v_{dE}$$/$$t_{0}$) & yes \\\hline
1712\end{tabular}
1713\caption{\label{taskruntype} Tasks performed by the TRD preprocessor
1714for every run type.}
1715\end{center}
1716\end{table}
1717The DCS data points are measurements of the currents, voltages,
1718temperatures and other variables of the chambers as function of time.
1719They are saved in the DCS Archive DB during the run and made available
1720at the SHUTTLE by AMANDA.
1721%
1722\section{Offline Calibration}
1723The offline calibration of the gain, driftvelocity$/$timeoffset and
1724width of the PRF is meant to improve the first calibration online.
1725It follows the following steps:
1726\begin{itemize}
1727\item Fill reference data (the $dE/dx$ distributions, the average
1728pulse heights $\cdots$) during the reconstruction of the events offline.
1729\item Store the reference data in root files in AliEn.
1730\item Merge the reference data of different runs and$/$or calibration groups.
1731\item Fit the reference data to extract the calibration constants and
1732create the calibration objects.
1733\item Store the calibration objects according to their run validity in
1734the OCDB.
1735\end{itemize}
1736The calibration procedure is not performed per detector anymore but per
1737pad, at least for the first step, the filling of the reference data.
1738Depending on the available statics the reference data of different pads
1739(calibration groups) can be merged together to determine a mean
1740calibration coefficient over these pads.
1741\subsection{AliTRDCalibraVector container}
1742The high granularity of the calibration, with a total number of 1181952
1743pads, implies that the size of the reference data has to be reduced to
1744the strict minimum needed.
1745\begin{table}[h]
1746\begin{center}
1747\begin{tabular} {|c|c|c|}
1748\hline reference data & Number of & size \\
1749 for & calibration groups & in MB \\\hline
1750 gain & 1181952 & 225 \\\hline
1751 driftvelocity$/$timeoffset & 1181952 & 271 \\\hline
1752 PRF & 131328 & 200 \\\hline
1753 All together & & 696 \\\hline
1754\end{tabular}
1755\caption{\label{sizeofAliTRDCalibraVector} Size of the
1756{\tt AliTRDCalibraVector} object for a given granularity.}
1757\end{center}
1758\end{table}
1759
1760The {\tt TH2I} and {\tt TProfile2D} objects are not a good option
1761anymore. Therefore a container class, {\tt AliTRDCalibraVector}, was
1762developped. The {\tt TH2I} corresponds to an array of UShort (2 Bytes)
1763for the number of entries in each bin, the {\tt TProfile2D} to an array
1764of UShort for the number of entries in each bin and two arrays of Float
1765for the sum of the weights and the sum of the squared weights in each
1766bin. The mean value and its error are computed per hand in the functions
1767{\tt AliTRDCalibraVector::UpdateVector*}, where the object is filled
1768with new data. The size of the {\tt AliTRDCalibraVector} object is
1769summarized in Tab.\ref{sizeofAliTRDCalibraVector}.\\
1770%
1771\subsection{Additional method to calibrate the drift velocity}
1772In addition an other method is available for the calibration of the
1773drift velocity. It is based on the comparison of the slope of the TRD
1774tracklet in the azimuthal plane $xy$ with the $\phi$ angle of the
1775global track. It can be shown that the slope $dy/dt$ of a TRD tracklet
1776depends linearly on its global track parameters,
1777$\tan(\phi)+(dz/dx)\tan(\beta_{tilt})$ \cite{THESISR}. The slope
1778parameter is the drift velocity in the electric field direction,
1779whereas the constant gives the tangent of the Lorentz angle. If the
1780TRD tracklet crosses two different pads in the $z$ direction (the
1781beam direction), the relation is not true anymore. Therefore such
1782tracklets are rejected in the calibration procedure. The reference
1783data are a {\tt TObjArray} of one {\tt TH2F} histogram for each
1784detector.\\
1785\begin{figure}[hbt]
1786 \centering\mbox{\epsfig{file=plots/crossrow.eps,width=0.5\textwidth,height=0.45\textwidth}}
1787 \caption{\label{crossrow}The correlation between $dy/dt$ and
1788$\tan(\phi)+(dz/dx)\tan(\beta_{tilt})$ for the reconstructed track
1789in one chamber. The tracks crossing at least two pad rows are in
1790red crosses and those crossing one pad row in blue points.}
1791\end{figure}
1792
1793Fig.\ref{crossrow} shows one example of such a histogram. They are
1794filled in the function
1795\\{\tt AliTRDCalibraFillHisto: :UpdateHistogramsV1(AliTRDtrackV1 *t)},
1796like the reference data for other calibration constants, if the
1797flag {\tt fLinearFitterDebugOn} is true.\\
1798The histograms are stored in the container class,
1799\\{\tt AliTRDCalibraVdriftLinearFit}, for which a {\tt Merge} and
1800{\tt Add} function have been implemented. In a second step, the
1801{\tt AliTRDCalibraVdriftLinearFit} objects can be merged together
1802for different runs. In a third step, the {\tt TH2F} histograms are
1803fitted in the function \\{\tt AliTRDCalibraVdriftLinearFit::FillPEArray}.
1804The result parameters are members of the
1805{\tt AliTRDCalibraVdriftLinearFit} object, as well as their error
1806coming from the fit procedures. Finally the
1807{\tt AliTRDCalibraVdriftLinearFit} object is passed to an
1808{\tt AliTRDCalibraFit} instance through the function
1809{\tt AliTRDCalibraFit::AnalyseLinearFitters}, in which the Lorentz
1810angle is computed from the fit parameters and stored together with
1811the drift velocity in a {\tt TObjArray}, member of the
1812{\tt AliTRDCalibraFit} instance. As for the other calibration
1813constants the functions {\tt AliTRDCalibratFit::CreateDetObject*}
1814and {\tt ::CreatePadObject*} allows to create the final calibration
1815objects, that have to be put in the OCDB. Since the Lorentz angle
1816is not a OCDB entries, it is only used for debugging.
1817%
1818\subsection{The calibration AliAnalysisTask}
1819The reference data of the calibration are filled in an AliAnalysisTask
1820during the reconstruction or after the reconstruction. Since it needs
1821some informations only stored in the AliESDfriends, they have to be
1822written if one wants to run the calibration. This will be the case
1823only for TRD track above a given $p_{T}$ since the size of the events
1824is otherwise to big.
1825%
1826%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1827\newpage
1828\setcounter{chapter}{4}
1829\setcounter{section}{0}
1830\Chapter{Alignment}
1831\thispagestyle{empty}
1832%
1833\section{???}
1834%
1835%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1836\newpage
1837\setcounter{chapter}{5}
1838\setcounter{section}{0}
1839\Chapter{Quality Assurance (QA)}
1840\thispagestyle{empty}
1841%
1842\section{???}
1843%
1844%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1845\newpage
1846\setcounter{chapter}{6}
1847\setcounter{section}{0}
1848\Chapter{High Level Trigger (HLT)}
1849\thispagestyle{empty}
1850%
1851\section{???}
1852%
1853%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1854\newpage
1855\setcounter{chapter}{7}
1856\setcounter{section}{0}
1857\Chapter{References}
1858\thispagestyle{empty}
1859%
1860\begin{thebibliography}{99}
1861%
1862\bibitem{ALIROOT} {\it The ALICE Offline Bible}\\
1863 http://aliceinfo.cern.ch/export/sites/AlicePortal/Offline/galleries/Download/OfflineDownload/ \\
1864 OfflineBible.pdf.
1865%
1866\bibitem{CLEMENS} C.~Adler,
1867 {\it Radiation length of the ALICE TRD}
1868%
1869\bibitem{DAVID} D.~Emschermann,
1870 {\it Numbering Convention for the ALICE TRD Detector.},
1871 http://www.physi.uni-heidelberg.de/\~demscher/alice/numbering/more/TRD\_numbering\_v04.pdf.
1872%
1873\bibitem{TRPHOT} M.~Castellano et al.,
1874 Comp. Phys. Comm. {\bf 55}, 431 (1988),
1875 Comp. Phys. Comm. {\bf 61}, 395 (1990),
1876%
1877\bibitem{DATE} K.~Schossmaier et al.,
1878 {\it The Alice Data Acquisition and Test Environment DATE V5},
1879 CHEP06.
1880%
1881\bibitem{THESISR} R.~Bailhache,
1882 {\it Calibration of the ALICE Transition Radiation Detector
1883 and a study of $Z^{0}$ and heavy quark production in $pp$
1884 collisions at the LHC},
1885 PhD thesis, University of Darmstadt (Germany), 2009.
1886%
1887\end{thebibliography}
1888%
1889%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1890%
1891\end{document}
1892%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%