]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/doc/trd_software_writeup.tex
Add text by Alexandru and Jochen
[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%
904\subsection{Cluster position reconstruction in the xy plane}\label{REC:CL:rphi}
905{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
883031eb 906%
757c05c1 907The procedures described in this section are implemented in the functions
908{\tt AliTRDcluster::GetXloc()}, {\tt AliTRDcluster::GetYloc()}, \\
909{\tt AliTRDcluster::GetSX()} and {\tt AliTRDcluster::GetSY()}.
910%
911\setcounter{footnote}{0}
912\section{Tracking}\label{REC:Tracking:}
913{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
914%
915The tracking procedures in TRD are responsible to attach clusters to tracks
916and to estimate/update the track parameters accordingly. The main class involved
917in this procedure is {\tt AliTRDtrackerV1} and the helper classes {\tt AliTRDcluster},
918{\tt AliTRDseedV1} and {\tt AliTRDtrackV1}. Additionally, information from
919{\tt AliTRDrecoParam} is mandatory to select the proper setup of the reconstruction.
920\\
921
922\noindent
923The tracking in TRD can be done in two major ways:
924\begin{itemize}
925\item Track prolongation from TPC.
926\item Stand alone track finding.
927\end{itemize}
928The first mode is the main tracking mode for all barrel tracks while the second
929is used to peak-up track segments fully contained in the TRD fiducial volume
930like conversions. Another feature of the TRD tracking besides the relative high
931thickness (conversions) is the spatial correlation of the signals in the radial
932direction due to residual tails in the cluster signals. This feature asked for
933an intermediate step between clusters and tracks, the tracklets. The TRD
934tracklets are linear fits of the clusters from one chamber. They are implemented
935in the class {\tt AliTRDseedV1} and they represent the core of the TRD offline
936reconstruction. In the following the tracklets will be described independently
937of the framework in which they are living (tracking) in the sections
938\ref{REC:Tracking:TrackletAttach}, \ref{REC:Tracking:TrackletFit} and
939\ref{REC:Tracking:TrackletErrors} and than their usage will be outlined in the
940barrel (section \ref{REC:Tracking:Propagate}) and stand alone tracking (section
941\ref{REC:Tracking:Clusters2TracksStack}).
942
943\subsection[title]{Tracklet building - Attaching clusters to tracklet\footnote{The
944procedures described in this section are implemented in the function
945{\tt AliTRDseedV1::AttachClusters()}.}}\label{REC:Tracking:TrackletAttach}
946
947\subsection[title]{Tracklet fitting\footnote{The procedures described in this
948section are implemented in the function {\tt AliTRDseedV1::Fit()}.}}\label{REC:Tracking:TrackletFit}
949
950{\bf Fit in the xy plane}\\
951
952The fit is performed to estimate the y position of the tracklet and the track
953angle in the bending plane. The clusters are represented in the chamber coordinate
954system (with respect to the anode wire - see {\tt AliTRDtrackerV1::FollowBackProlongation()}
955on how this is set). The $x$ and $y$ position of the cluster and also their variances
956are known from clusterizer level (see {\tt AliTRDcluster::GetXloc()},
957{\tt AliTRDcluster::GetYloc()}, {\tt AliTRDcluster::GetSX()} and \\
958{\tt AliTRDcluster::GetSY()}). If a Gaussian approximation is used to calculate
959$y$ coordinate of the cluster the position is recalculated taking into account the
960track angle.
961
962Since errors are calculated only in the $y$ directions, radial errors ($x$ direction)
963are mapped to $y$ by projection i.e.
964\begin{equation}
965\sigma_{x|y} = tg(\phi) \sigma_{x}
966\end{equation}
967and also by the Lorentz angle correction.\\
968
969{\bf Fit in the xz plane}\\
970
971The "fit" is performed to estimate the radial position ($x$ direction) where pad
972row cross happens. If no pad row crossing the $z$ position is taken from geometry
973and radial position is taken from the xy fit (see below).
974
975There are two methods to estimate the radial position of the pad row cross:\\
9761. leading cluster radial position : Here the lower part of the tracklet is
977considered and the last cluster registered (at radial $x_{0}$) on this segment
978is chosen to mark the pad row crossing. The error of the $z$ estimate is given by :
979\begin{equation}
980\sigma_{z} = tg(\theta) \Delta x_{x_{0}}/12
981\end{equation}
982The systematic errors for this estimation are generated by the following sources:
983 - no charge sharing between pad rows is considered (sharp cross)
984 - missing cluster at row cross (noise peak-up, under-threshold signal etc.).
985\\
9862. charge fit over the crossing point : Here the full energy deposit along
987the tracklet is considered to estimate the position of the crossing by a fit
988in the qx plane. The errors in the q directions are parameterized as
989$\sigma_q = q^2$. The systematic errors for this estimation are generated by the
990following sources:
991 - no general model for the qx dependence
992 - physical fluctuations of the charge deposit
993 - gain calibration dependence.\\
994
995{\bf Estimation of the radial position of the tracklet}\\
996
997For pad row cross the radial position is taken from the xz fit (see above).
998Otherwise it is taken as the interpolation point of the tracklet i.e. the
999point where the error in $y$ of the fit is minimum. The error in the $y$
1000direction of the tracklet is (see {\tt AliTRDseedV1::GetCovAt()}):
1001\begin{equation}
1002\sigma_{y} = \sigma^{2}_{y_{0}} + 2x\:cov(y_{0}, dy/dx) + \sigma^{2}_{dy/dx}
1003\end{equation}
1004and thus the radial position is:
1005\begin{equation}
1006x = - cov(y_{0}, dy/dx)/\sigma^{2}_{dy/dx}
1007\end{equation}
1008
1009{\bf Estimation of tracklet position error}\\
1010
1011The error in $y$ direction is the error of the linear fit at the radial
1012position of the tracklet while in the $z$ direction is given by the cluster
1013error or pad row cross error. In case of no pad row cross this is given by:
1014\begin{eqnarray}
1015\sigma_{y} = \sigma^{2}_{y_{0}} - 2cov^{2}(y_{0}, dy/dx)/\sigma^{2}_{dy/dx} + \sigma^{2}_{dy/dx}\\
1016\sigma_{z} = Pad_{length}/12
1017\end{eqnarray}
1018For pad row cross the full error is calculated at the radial position of the
1019crossing (see above) and the error in $z$ by the width of the crossing region -
1020being a matter of parameterization.
1021\begin{equation}
1022\sigma_{z} = tg(\theta) \Delta x_{x_{0}}/12
1023\end{equation}
1024In case of no tilt correction (default in the barrel tracking) the tilt is
1025taken into account by the rotation of the covariance matrix. See
1026{\tt AliTRDseedV1::GetCovAt()} or \ref{REC:Tracking:TrackletErrors} for details.
1027
1028\subsection[title]{Tracklet errors\footnote{The procedures described in this
1029section are implemented in the function {\tt AliTRDseedV1::GetCovAt()}.}}\label{REC:Tracking:TrackletErrors}
1030
1031Computes covariance in the $y$-$z$ plane at radial point $x$ (in tracking coordinates)
1032and returns the results as:\\
1033 cov[0] = Var($y$) \\
1034 cov[1] = Cov($yz$)\\
1035 cov[2] = Var($z$) \\
1036
1037{\bf Details}\\
1038
1039For the linear transformation
1040\begin{equation}
1041Y = T_{x} X^{T}
1042\end{equation}
1043The error propagation has the general form
1044\begin{equation}
1045C_{Y} = T_{x} C_{X} T_{x}^{T}
1046\end{equation}
1047We apply this formula 2 times. First to calculate the covariance of the tracklet
1048at point $x$ we consider:
1049\begin{eqnarray}
1050T_{x} &=& (1\; x)\\
1051X&=&(y0\; dy/dx)\\
1052C_{X}&=&
1053 \left( \begin{array}{cc}
1054 Var(y0) & Cov(y0, dy/dx)\\
1055 Cov(y0, dy/dx) & Var(dy/dx)
1056 \end{array} \right)
1057\end{eqnarray}
1058and secondly to take into account the tilt angle
1059\begin{eqnarray}
1060T_{\alpha}& = &
1061 \left( \begin{array}{cc}
1062 cos(\alpha)&sin(\alpha)\\
1063 -sin(\alpha)& cos(\alpha)
1064 \end{array} \right)\\
1065X&=&(y\; z)\\
1066C_{X}&=&
1067 \left( \begin{array}{cc}
1068 Var(y) &0\\
1069 0 &Var(z)
1070 \end{array} \right)
1071\end{eqnarray}
1072using simple trigonometrics one can write for this last case
1073\begin{equation}
1074C_{Y}=\frac{1}{1+tg^{2}\alpha}
1075 \left( \begin{array}{cc}
1076 \sigma_{y}^{2}+tg^{2}(\alpha)\sigma_{z}^{2} & tg(\alpha)(\sigma_{z}^{2}-\sigma_{y}^{2})\\
1077 tg(\alpha)(\sigma_{z}^{2}-\sigma_{y}^{2}) & \sigma_{z}^{2}+tg^{2}(\alpha)\sigma_{y}^{2}
1078 \end{array} \right)
1079\end{equation}
1080which can be aproximated for small alphas (2 deg) with
1081\begin{equation}
1082C_{Y}=
1083 \left( \begin{array}{cc}
1084 \sigma_{y}^{2} & (\sigma_{z}^{2}-\sigma_{y}^{2})tg(\alpha)\\
1085 ((\sigma_{z}^{2}-\sigma_{y}^{2})tg(\alpha) & \sigma_{z}^{2}
1086 \end{array} \right)
1087\end{equation}
1088before applying the tilt rotation we also apply systematic uncertainties
1089to the tracklet position which can be tuned from outside via the
1090{\tt AliTRDrecoParam::SetSysCovMatrix()}. They might account for extra
1091misalignment/miscalibration uncertainties.
1092
1093\subsection[title]{Track propagation in barrel tracking\footnote{The
1094procedures described in this section are implemented in the function
1095{\tt AliTRDtrackerV1::PropagateBack()}.}}\label{REC:Tracking:Propagate}
1096
1097{\bf TRD Tracklet initialization and Kalman fit}\footnote{The procedures
1098described in this section are implemented in the function
1099{\tt AliTRDtrackerV1::FollowBackProlongation()}.}\\
1100
1101\subsection[title]{Track finding stack wise \footnote{The procedures
1102described in this section are implemented in the function
1103{\tt AliTRDtrackerV1::Clusters2TracksStack()}.}}\label{REC:Tracking:Clusters2TracksStack}
1104
1105{\bf TRD track finding}\footnote{The procedures described in this section
1106are implemented in the function {\tt AliTRDtrackerV1::MakeSeeds()}.}
1107\\
883031eb 1108%
1109%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1110\newpage
1111\setcounter{chapter}{3}
1112\setcounter{section}{0}
1113\Chapter{Calibration}
1114%
1115{\it Author: R.~Bailhache (rbailhache@ikf.uni-frankfurt.de)}
1116\smallskip
1117\\
1118%
1119\section{Database Entries}
1120A local database with default parameters can be found in the AliRoot
1121installation directory. The official database is in Alien under the
1122directory
1123{\tt /alice/data/$\langle$year$\rangle$/$\langle$LHCPeriod$\rangle$/OCDB}.
1124The calibration objects are stored in root files named according to their
1125run validity range, their version and subversion number. For the TRD they
1126are in the subdirectory {\tt \$AliRoot/OCDB/TRD/Calib} and correspond to
1127a perfect TRD detector. The parameters are listed in Tab.\ref{entriesdatabase}.\\
1128\begin{table} [h]
1129 \begin{center}
1130 \begin{tabular}{|c|c|c|c|c|c|}
1131 \hline Parameter & Description & Number of & Data type & Unit & Default value \\
1132 & & channels & & & \\ \hline
1133 ChamberGainFactor & Mean gas gain & 540 & Float & $-$ & 1.0 \\
1134 $ $ & per chamber & & & & \\ \hline
1135 LocalGainFactor & Gas gain & 1181952 & UShort & $-$ & 1.0 \\
1136 & per pad & 1181952 & UShort & $-$ & 1.0 \\ \hline
1137 ChamberVdrift & Mean drift velocity & 540 & Float & cm$/$$\mu$s & 1.5 \\
1138 & per chamber & 540 & Float & cm$/$$\mu$s & 1.5 \\ \hline
1139 LocalVdrift & Drift velocity & 1181952 & UShort & $-$ & 1.0 \\
1140 & per pad & 1181952 & UShort & $-$ & 1.0 \\ \hline
1141 ChamberT0 & Minimum timeoffset & 540 & Float & timebin & 0.0 \\
1142 & in the chamber & 540 & Float & timebin & 0.0 \\ \hline
1143 LocalT0 & Timeoffset & 1181952 & UShort & timebin & 0.0 \\
1144 & per pad & & & & \\ \hline
1145 PRFWidth & Width of the PRF & 1181952 & UShort & pad width & 0.515 ( layer 0) \\
1146 $ $ & per pad & $ $ & $ $ & $ $ & 0.502 ( layer 1) \\
1147 $ $ & $ $ & $ $ & $ $ & $ $ & 0.491 ( layer 2) \\
1148 $ $ & $ $ & $ $ & $ $ & $ $ & 0.481 ( layer 3) \\
1149 $ $ & $ $ & $ $ & $ $ & $ $ & 0.471 ( layer 4) \\
1150 $ $ & $ $ & $ $ & $ $ & $ $ & 0.463 ( layer 5) \\ \hline
1151 DetNoise & Scale factor & 540 & Float & $-$ & 0.1 \\ \hline
1152 PadNoise & Noise & 1181952 & UShort & ADC & 12 \\
1153 & per pad & & & counts & \\ \hline
1154 PadStatus & Status & 1181952 & char & $-$ & $-$ \\
1155 & per pad & & & & \\ \hline
1156 \end{tabular}
1157 \end{center}
1158\caption{\label{entriesdatabase}Entries in the database}
1159\end{table}
1160%
1161They are related to the calibration of:
1162\begin{itemize}
1163\item the gas gain: {\tt ChamberGainFactor} and {\tt LocalGainFactor}
1164\item the electron drift velocity: {\tt ChamberVdrift} and {\tt LocalVdrift}
1165\item the timeoffset: {\tt ChamberT0} and {\tt LocalT0}
1166\item the width of the Pad Response Function: {\tt PRFWidth}
1167\item the noise per channel: {\tt DetNoise}, {\tt PadNoise} and {\tt PadStatus}.
1168\end{itemize}
1169To save disk space the values per pad are stored in UShort (2 Bytes)
1170format in AliTRDCalROC objects, one per chamber, that are members of
1171a general {\tt AliTRDCalPad} object. The final constants have a
1172numerical precision of 10$^{-4}$. They are computed by
1173multiplication (gain, drift velocity and noise) or addition (timeoffset)
1174of the detector and pad coefficients. From the pad noise level a status
1175is determined for each pad ( masked, bridgedleft, bridgedright, read by
1176the second MCM, not connected). One example macro ({\tt AliTRDCreate.C})
1177to produce a local database is given in the {\tt \$AliRoot/TRD/Macros}
1178directory.\\
1179During the simulation of the detector response and the reconstruction
1180of the events the parameters are used to compute the amplitude of the
1181signal and its position inside the detector. The database has to be
1182first choosen with the help of the {\tt AliCDBManager}. The parameters
1183are then called by an {\tt AliTRDcalibDB} instance. The macro
1184{\tt \$AliRoot/TRD/Macros/ReadCDD.C} shows how to read a local database
1185and plot the gas gain or drift velocity as function of the detector
1186number or pad number.
1187%
1188\section{DAQ Calibration}
1189Calibration procedures are performed online during data-taking on
1190different systems. The principal role of the Data AcQuisition System is
1191to build the events and archive the data to permanent storage tapes. In
1192addition it also provides an efficient access to the data. Nevertheless
1193the complete reconstruction of the events with tracks is not available.
1194Two algorithms are executed on DAQ for the TRD: a pedestal algorithm and
1195an algorithm for the drift velocity and timeoffset. They are implemented
1196as rpm packages, that can be easily built inside AliRoot compiled with
1197the DATE software \cite{DATE}. The outputs of the algorithms are stored
1198in root files and put on the DAQ File Exchange Server (FXS). At the end
1199of the run they are picked up by the so called SHUTTLE and further
1200processed in the Preprocessor to fill finally the OCDB.
1201\begin{figure}[h]
1202 \centering\mbox{\epsfig{file=plots/baselinenoisedet0run34510ex.eps,width=0.45\textwidth}}
1203 \caption{\label{baselinenoisedet0run34510ex}2D histogram of the
1204detector 0 (SM 0, S0, L0) with the ADC value distributions around
1205the baseline (10 ADC counts) for each pad (PEDESTAL run 34510).}
1206\end{figure}
1207\subsection{Pedestal algorithm}
1208During a pedestal run empty events without zero suppression are taken
1209with the TRD alone and a random trigger. They are used to determine
1210the noise in ADC counts of each pad. The algorithm can be found in the
1211{\tt TRDPEDESTALda.cxx} file of the AliRoot TRD directory. It is
1212executed on the Local Data Concentrators (LDCs), which are part of the
1213dataflow and gives access to sub-events. The TRD has three LDCs
1214corresponding to the following blocks of supermodules (SMs):
1215\begin{itemize}
1216\item 0-1-2-9-10-11
1217\item 3-4-5-12-13-14
1218\item 6-7-8-15-16-17
1219\end{itemize}
1220Three algorithms are therefore executed in parallel during a PEDESTAL
1221run for a full installed TRD. After about 100 events, the data-taking
1222stops automatically and a 2D histogram is filled for each chamber with
1223the ADC amplitude distributions around the baseline for each pad. Such
1224a histogram is shown in Fig.\ref{baselinenoisedet0run34510ex} for
1225chamber 0 (SM 0 Stack 0 Layer 0).
1226\begin{figure}[h]
1227 \centering\mbox{\epsfig{file=plots/run38125sm0nounfold.eps,width=0.88\textwidth,height=0.55\textwidth}}
1228 \caption{\label{run38125sm0nounfold}Noise in the six planes of
1229SM 0 (PEDESTAL run 38125). The five stacks in each layer are in
1230the {\it{z}} direction.}
1231\end{figure}
1232The chambers should be so configured that the data is without zero
1233suppression otherwise an error message appears on the DAQ online
1234Logbook. The container class is called {\tt AliTRDCalibPadStatus}
1235and allows to further fit the distributions with a Gaussian to
1236determine the baseline and noise of each pad. The function is called
1237{\tt AliTRDCalibPadStatus::AnalyseHisto()}. In
1238Fig.\ref{run38125sm0nounfold} the noise in SM 0 is plotted for the
1239PEDESTAL run 38125. It shows stripe patterns of higher noise in the
1240$z$-direction (beam direction) correlated to the static pad capacitance
1241of the pad plane. The noise distributions has to be first corrected
1242for the expected noise variations induced by the pad capacitance
1243before a status can be given to each pad. This is not done on the DAQ
1244but just before storing the parameters inside the Offline Condition
1245Database (OCDB) in the Preprocessor.
1246
1247\subsection{Drift velocity and timeoffset algorithm}
1248The drift velocity and timeoffset are calibrated with physics events,
1249$pp$ or $PbPb$ collisions. The algorithm is called
1250{\tt TRDVDRIFTda.cxx} and can be found in the AliRoot TRD directory.
1251It is executed on a dedicated monitoring server, which is not part
1252of the dataflow and gives access to full events of the TRD. The
1253physics events are used to fill continuously during data-taking an
1254average pulse height for each detector. They are stored in a
1255{\tt TProfile2D}, which is a member of a { \tt AliTRDCalibraFillHisto}
1256object. The {\tt TProfile2D} is written at the end of the run in a
1257root file put on the DAQ FXS.\\
1258\begin{figure}[h]
1259 \centering\mbox{\epsfig{file=plots/referenceph2d.eps,width=0.6\textwidth,,height=0.5\textwidth}}
1260 \caption{\label{referenceph2d}2D histogram containing the average
1261pulse height distributions of each calibration group (here detector),
1262produced with decalibrated simulated $pp$ events.}
1263\end{figure}
1264
1265Fig.\ref{referenceph2d} shows an output {\tt TProfile2D} obtained
1266from simulated decalibrated $pp$ collisions at 14\,TeV. The first
1267peak in time corresponds to the amplification region, where the
1268contributions of ionization electrons, which come from both sides
1269of the anode wire plane, are overlapping. The flat plateau results
1270from the electrons in the drift region. The tail is caused by the
1271Time Response Function. From this average signal as function of time
1272the drift velocity and timeoffset can be extracted by fit procedures.
1273This last step is performed in the Preprocessor.\\
1274Since no tracking is available on DAQ, a simple tracklet finder is
1275used. It was optimized for a low charged particle multiplicity
1276environment. The algorithm looks for a maximum of the signal
1277amplitudes in the chamber after integration over all timebins. The
1278average pulse height is then filled for a spot of two pad rows
1279($z$ direction) and four pad columns ($r\phi$ direction) around the
1280maximum. Further details can be found in the function
1281{\tt AliTRDCalibraFillHisto::ProcessEventDAQ}.
1282%
1283\section{HLT Calibration}
1284The High Level Trigger has the big advantage to provide an online
1285reconstruction of the events. The idea is then to run the calibration
1286procedures in a transparent way, independent whether online or
1287offline. The same function
1288\\{\tt AliTRDCalibraFillHisto::UpdateHistogramsV1(AliTRDtrackV1 *t)}
1289is used to fill the $dE/dx$ distributions (gain), the average pulse
1290height (drift velocity and timeoffset) and the Pad Response Function
1291for each detector in respectively one {\tt TH2I} and two
1292{\tt TProfile2Ds}. The calibration is nevertheless done per chamber,
1293whereas by integrating statistics it will be possible to get the gain,
1294drift velocity and timeoffset distributions inside the chambers offline.
1295Therefore the class {\tt AliTRDCalibraFillHisto} contains a flag
1296({\tt fIsHLT}) to avoid extra calculations not needed at the detector
1297level.\\
1298\begin{figure}[hbt]
1299 \centering\mbox{\epsfig{file=plots/referencech2d.eps,width=0.55\textwidth,,height=0.45\textwidth}}
1300 \caption{\label{referencech2d}A 2D histogram containing the
1301$dE$$/$$dx$ distributions of each detector. These were produced
1302with decalibrated simulated $pp$ events.}
1303\end{figure}
1304
1305Fig.\ref{referencech2d} shows one example of a {\tt TH2I} histogram,
1306where the $dE/dx$ distributions of each detector is stored for $pp$
1307collisions at 14\,TeV. No minimal $p_{T}$ cut was applied on the
1308TRD tracks. Assuming that the charged particles are uniformy
1309distributed over the TRD chambers, the position of the Most Probable
1310Value of the $dE/dx$ distribution is used to calibrate the gain.\\
1311At the beginning of each run, a local copy of the OCDB is updated
1312on the HLT cluster: the HCDB (HLT Condition Database). The last set
1313of calibration objects are used to reconstruct the events. The gain
1314correction preformed during the tracking has to be taken into account
1315when filling the $dE/dx$ distributions. That is why the calibration
1316algorithm has to know which database was used during the
1317reconstruction. The TRD HLT code can be found in the {\tt HLT/TRD}
1318subdirectory of the AliRoot installation. The calibration is
1319implemented as an {\tt AliHLTTRDCalibrationComponent}, whose members
1320are an {\tt AliCDBManager} together with the path for the current
1321database used, and an {\tt AliTRDCalibraFillHisto} object. The main
1322functions are:
1323\begin{itemize}
1324\item {\tt AliHLTCalibrationComponent::InitCalibration}, where the
1325{\tt TH2I} and {\tt TProfile2Ds} are created.
1326\item {\tt AliHLTCalibrationComponent::ProcessCalibration}, where
1327the function\\
1328{\tt AliTRDCalibraFillHisto::UpdateHistogramsV1(AliTRDtrackV1 *t)}
1329is called to fill the histograms.
1330\item {\tt AliHLTCalibrationComponent::FormOutput}, which returns
1331a {\tt TObjArray} with the histograms.
1332\end{itemize}
1333The histograms are shipped at the end of each run to the HLT File
1334Exchange Server to be picked up by the SHUTTLE and further processed
1335by the Preprocessor, exactly as the data from the calibration on DAQ.
1336%
1337\section{Preprocessor}
1338%
1339The online systems, like the Detector Control System (DCS), the DAQ
1340and the HLT, are protected from outside by a firewall. A special
1341framework, called the SHUTTLE, has been developped to retrieve offline
1342data in the online systems or store relevant information from the
1343online systems in the OCDB. The SHUTTLE has access to the DCS, DAQ
1344and HLT FXS. At the end of each run the reference data, outputs of
1345the calibration algorithms on DAQ and HLT, are retrieved and further
1346processed to determine the calibration constants (gain, drift velocity,
1347timeoffset and width of the Pad Response Function). The reference
1348data are finally stored in the Grid reference Data Base, whereas the
1349results of the fit procedures are stored in the OCDB.\\
1350The code is contained in the {\tt AliTRDPreprocessor} class. The
1351Process function is executed for the run types: PEDESTAL, STANDALONE,
1352DAQ and PHYSICS.
1353\begin{itemize}
1354\item The PEDESTAL run are dedicated to the calibration of the noise
1355on DAQ. Only the output of the DAQ pedestal algorithm is retrieved at
1356the SHUTTLE. From the noise and baseline of each pad, a pad status is
1357determined. Disconnected pads are recognizable by a small noise.
1358Bridged pads have the same noise and baseline. The noise and
1359padstatus of the previous pedestal run in the OCDB are taken for half
1360chambers, which were not On. Finally the database entries
1361{\tt DetNoise}, {\tt PadNoise} and {\tt PadStatus} are populated in
1362the OCDB. More informations can be found in the function
1363\\{\tt AliTRDPreprocessor::ExtractPedestals}.
1364\item The STANDALONE runs are used to check the data integrity or the
1365correlated noise. The data are taken with the TRD alone and a random
1366trigger. Only the DCS data are retrieved.
1367\item The DAQ run are test runs for the DAQ people. Only the DCS data
1368are retrieved.
1369\item The PHYSICS run are global runs including more than one detector
1370and different trigger clusters. They are used for the calibration of
1371the gain, driftvelocity and timeoffset, and width of the PRF. Therefore
1372the output of the calibration algorihms running on HLT are retrieved.
1373If the procedure is not successful the output of the
1374driftvelocity$/$timeoffset algorithm on DAQ is also retrieved. The
1375reference data, the histograms, are fitted using an
1376{\tt ALiTRDCalibraFit} instance:
1377\begin{itemize}
1378\item {\tt AliTRDCalibraFit::AnalyseCH(const TH2I *ch)} determines
1379the MPVs of the $dE/dx$ distributions and compares them to a reference
1380value.
1381\item {\tt AliTRDCalibraFit::AnalysePH(const TProfile2D *ph)} fits
1382the average pulse height and determines the position of the amplification
1383region peak and the end of the drift region for each chamber. Knowing
1384the length of the drift region one can deduce the drift velocity. The
1385amplification peak gives also information on the timeoffset.
1386\item {\tt AliTRDCalibraFit::AnalysePRFMarianFit(const TProfile2D *prf)}
1387determines the spread of the clusters as function of azimuthal angle of
1388the track. The minimum gives the width of the PRF.
1389\end{itemize}
1390The results of each fit procedure are stored in a {\tt TObjArray} of
1391\\{\tt AliTRDCalibraFit::AliTRDFitInfo} objects, one per chamber, which
1392is a member of the {\tt AliTRDCalibraFit} instance. The functions
1393{\tt AliTRDCalibratFit::CreateDetObject*} and {\tt ::CreatePadObject*}
1394allow to create from the {\tt TObjArray} the final calibration objects,
1395that have to be put in the OCDB.
1396\end{itemize}
1397Tab.\ref{taskruntype} summarizes the tasks executed by the prepocessor
1398for each run type.
1399\begin{table}[h]
1400\begin{center}
1401\begin{tabular} {|c|c|c|c|c|}
1402\hline run type & DCS data points & DCS FXS & DAQ FXS & HLT FXS \\
1403 & temperatures & electronic & calibration DA & calibration DA \\
1404 & voltages, etc $\cdots$ & configuration & noise/($v_{dE}$$/$$t_{0}$)
1405& $g$/($v_{dE}$$/$$t_{0}$)/$\sigma_{PRF}$ \\
1406\hline DAQ & yes & yes & no & no \\\hline
1407\hline PEDESTAL & no & no & yes (noise) & no \\\hline
1408\hline STANDALONE & yes & yes & no & no \\\hline
1409\hline PHYSICS & yes & yes & yes ($v_{dE}$$/$$t_{0}$) & yes \\\hline
1410\end{tabular}
1411\caption{\label{taskruntype} Tasks performed by the TRD preprocessor
1412for every run type.}
1413\end{center}
1414\end{table}
1415The DCS data points are measurements of the currents, voltages,
1416temperatures and other variables of the chambers as function of time.
1417They are saved in the DCS Archive DB during the run and made available
1418at the SHUTTLE by AMANDA.
1419%
1420\section{Offline Calibration}
1421The offline calibration of the gain, driftvelocity$/$timeoffset and
1422width of the PRF is meant to improve the first calibration online.
1423It follows the following steps:
1424\begin{itemize}
1425\item Fill reference data (the $dE/dx$ distributions, the average
1426pulse heights $\cdots$) during the reconstruction of the events offline.
1427\item Store the reference data in root files in AliEn.
1428\item Merge the reference data of different runs and$/$or calibration groups.
1429\item Fit the reference data to extract the calibration constants and
1430create the calibration objects.
1431\item Store the calibration objects according to their run validity in
1432the OCDB.
1433\end{itemize}
1434The calibration procedure is not performed per detector anymore but per
1435pad, at least for the first step, the filling of the reference data.
1436Depending on the available statics the reference data of different pads
1437(calibration groups) can be merged together to determine a mean
1438calibration coefficient over these pads.
1439\subsection{AliTRDCalibraVector container}
1440The high granularity of the calibration, with a total number of 1181952
1441pads, implies that the size of the reference data has to be reduced to
1442the strict minimum needed.
1443\begin{table}[h]
1444\begin{center}
1445\begin{tabular} {|c|c|c|}
1446\hline reference data & Number of & size \\
1447 for & calibration groups & in MB \\\hline
1448 gain & 1181952 & 225 \\\hline
1449 driftvelocity$/$timeoffset & 1181952 & 271 \\\hline
1450 PRF & 131328 & 200 \\\hline
1451 All together & & 696 \\\hline
1452\end{tabular}
1453\caption{\label{sizeofAliTRDCalibraVector} Size of the
1454{\tt AliTRDCalibraVector} object for a given granularity.}
1455\end{center}
1456\end{table}
1457
1458The {\tt TH2I} and {\tt TProfile2D} objects are not a good option
1459anymore. Therefore a container class, {\tt AliTRDCalibraVector}, was
1460developped. The {\tt TH2I} corresponds to an array of UShort (2 Bytes)
1461for the number of entries in each bin, the {\tt TProfile2D} to an array
1462of UShort for the number of entries in each bin and two arrays of Float
1463for the sum of the weights and the sum of the squared weights in each
1464bin. The mean value and its error are computed per hand in the functions
1465{\tt AliTRDCalibraVector::UpdateVector*}, where the object is filled
1466with new data. The size of the {\tt AliTRDCalibraVector} object is
1467summarized in Tab.\ref{sizeofAliTRDCalibraVector}.\\
1468%
1469\subsection{Additional method to calibrate the drift velocity}
1470In addition an other method is available for the calibration of the
1471drift velocity. It is based on the comparison of the slope of the TRD
1472tracklet in the azimuthal plane $xy$ with the $\phi$ angle of the
1473global track. It can be shown that the slope $dy/dt$ of a TRD tracklet
1474depends linearly on its global track parameters,
1475$\tan(\phi)+(dz/dx)\tan(\beta_{tilt})$ \cite{THESISR}. The slope
1476parameter is the drift velocity in the electric field direction,
1477whereas the constant gives the tangent of the Lorentz angle. If the
1478TRD tracklet crosses two different pads in the $z$ direction (the
1479beam direction), the relation is not true anymore. Therefore such
1480tracklets are rejected in the calibration procedure. The reference
1481data are a {\tt TObjArray} of one {\tt TH2F} histogram for each
1482detector.\\
1483\begin{figure}[hbt]
1484 \centering\mbox{\epsfig{file=plots/crossrow.eps,width=0.5\textwidth,height=0.45\textwidth}}
1485 \caption{\label{crossrow}The correlation between $dy/dt$ and
1486$\tan(\phi)+(dz/dx)\tan(\beta_{tilt})$ for the reconstructed track
1487in one chamber. The tracks crossing at least two pad rows are in
1488red crosses and those crossing one pad row in blue points.}
1489\end{figure}
1490
1491Fig.\ref{crossrow} shows one example of such a histogram. They are
1492filled in the function
1493\\{\tt AliTRDCalibraFillHisto: :UpdateHistogramsV1(AliTRDtrackV1 *t)},
1494like the reference data for other calibration constants, if the
1495flag {\tt fLinearFitterDebugOn} is true.\\
1496The histograms are stored in the container class,
1497\\{\tt AliTRDCalibraVdriftLinearFit}, for which a {\tt Merge} and
1498{\tt Add} function have been implemented. In a second step, the
1499{\tt AliTRDCalibraVdriftLinearFit} objects can be merged together
1500for different runs. In a third step, the {\tt TH2F} histograms are
1501fitted in the function \\{\tt AliTRDCalibraVdriftLinearFit::FillPEArray}.
1502The result parameters are members of the
1503{\tt AliTRDCalibraVdriftLinearFit} object, as well as their error
1504coming from the fit procedures. Finally the
1505{\tt AliTRDCalibraVdriftLinearFit} object is passed to an
1506{\tt AliTRDCalibraFit} instance through the function
1507{\tt AliTRDCalibraFit::AnalyseLinearFitters}, in which the Lorentz
1508angle is computed from the fit parameters and stored together with
1509the drift velocity in a {\tt TObjArray}, member of the
1510{\tt AliTRDCalibraFit} instance. As for the other calibration
1511constants the functions {\tt AliTRDCalibratFit::CreateDetObject*}
1512and {\tt ::CreatePadObject*} allows to create the final calibration
1513objects, that have to be put in the OCDB. Since the Lorentz angle
1514is not a OCDB entries, it is only used for debugging.
1515%
1516\subsection{The calibration AliAnalysisTask}
1517The reference data of the calibration are filled in an AliAnalysisTask
1518during the reconstruction or after the reconstruction. Since it needs
1519some informations only stored in the AliESDfriends, they have to be
1520written if one wants to run the calibration. This will be the case
1521only for TRD track above a given $p_{T}$ since the size of the events
1522is otherwise to big.
1523%
1524%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1525\newpage
1526\setcounter{chapter}{4}
1527\setcounter{section}{0}
1528\Chapter{Alignment}
1529\thispagestyle{empty}
1530%
1531\section{???}
1532%
1533%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1534\newpage
1535\setcounter{chapter}{5}
1536\setcounter{section}{0}
1537\Chapter{Quality Assurance (QA)}
1538\thispagestyle{empty}
1539%
1540\section{???}
1541%
1542%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1543\newpage
1544\setcounter{chapter}{6}
1545\setcounter{section}{0}
1546\Chapter{High Level Trigger (HLT)}
1547\thispagestyle{empty}
1548%
1549\section{???}
1550%
1551%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1552\newpage
1553\setcounter{chapter}{7}
1554\setcounter{section}{0}
1555\Chapter{References}
1556\thispagestyle{empty}
1557%
1558\begin{thebibliography}{99}
1559%
1560\bibitem{ALIROOT} {\it The ALICE Offline Bible}\\
1561 http://aliceinfo.cern.ch/export/sites/AlicePortal/Offline/galleries/Download/OfflineDownload/ \\
1562 OfflineBible.pdf.
1563%
1564\bibitem{CLEMENS} C.~Adler,
1565 {\it Radiation length of the ALICE TRD}
1566%
1567\bibitem{DAVID} D.~Emschermann,
1568 {\it Numbering Convention for the ALICE TRD Detector.},
1569 http://www.physi.uni-heidelberg.de/\~demscher/alice/numbering/more/TRD\_numbering\_v04.pdf.
1570%
1571\bibitem{TRPHOT} M.~Castellano et al.,
1572 Comp. Phys. Comm. {\bf 55}, 431 (1988),
1573 Comp. Phys. Comm. {\bf 61}, 395 (1990),
1574%
1575\bibitem{DATE} K.~Schossmaier et al.,
1576 {\it The Alice Data Acquisition and Test Environment DATE V5},
1577 CHEP06.
1578%
1579\bibitem{THESISR} R.~Bailhache,
1580 {\it Calibration of the ALICE Transition Radiation Detector
1581 and a study of $Z^{0}$ and heavy quark production in $pp$
1582 collisions at the LHC},
1583 PhD thesis, University of Darmstadt (Germany), 2009.
1584%
1585\end{thebibliography}
1586%
1587%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1588%
1589\end{document}
1590%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%