]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/doc/trd_software_writeup.tex
new round of documentation
[u/mrichter/AliRoot.git] / TRD / doc / trd_software_writeup.tex
index 25de3368ebe6e4ed147fb2053a91e306330d4ff6..27cf3bc0e0bf4a2239b9d8de7f3bf1f99e87e39e 100644 (file)
@@ -901,12 +901,218 @@ use of the TRD inputs has to be defined in the trigger configuration.
 %
 \section{Cluster Finding}\label{REC:CL:}
 %
-\subsection{Cluster position reconstruction in the xy plane}\label{REC:CL:rphi}
+\subsection[Cluster position reconstruction]{Cluster position reconstruction\footnote{The procedures described in this section are implemented in the functions 
+{\tt AliTRDcluster::GetXloc()}, {\tt AliTRDcluster::GetYloc()},
+{\tt AliTRDcluster::GetSX()} and {\tt AliTRDcluster::GetSY()}.}}\label{REC:CL:rphi}
 {\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
-%
-The procedures described in this section are implemented in the functions 
-{\tt AliTRDcluster::GetXloc()}, {\tt AliTRDcluster::GetYloc()}, \\
-{\tt AliTRDcluster::GetSX()} and {\tt AliTRDcluster::GetSY()}.
+
+{\bf Calculation of cluster position in the radial direction} in local chamber coordinates (with respect to the anode wire 
+position) is using the following parameters:\\
+  $t_0$ - calibration aware trigger delay $[\mu s]$\\
+  $v_d$ - drift velocity in the detector region of the cluster $[cm/\mu s]$\\
+  z  - distance to the anode wire [cm]. By default average over the drift cell width\\
+  q \& $x_q$ - array of charges and cluster positions from previous clusters in the tracklet [a.u.]
+
+The estimation of the radial position is based on calculating the drift time and the drift velocity at the point of 
+estimation. The drift time can be estimated according to the expression:
+\begin{equation}
+t_{drift} = t_{bin} - t_{0} - t_{cause}(x) - t_{TC}(q_{i-1}, q_{i-2}, ...)
+\end{equation}
+where $t_0$ is the delay of the trigger signal. $t_{cause}$ is the causality delay between ionisation electrons hitting 
+the anode and the registration of mean signal by the electronics - due to the rising time of the TRF 
+A second order correction here comes from the fact that the time spreading of charge at anode is the convolution of
+TRF with the diffusion and thus cross-talk between clusters before and after local clusters changes with drift length. 
+$t_{TC}$ is the residual charge from previous (in time) clusters due to residual tails after tail cancellation. 
+This tends to push cluster forward and depends on the magnitude of their charge.
+
+The drift velocity varies with the drift length (and distance to anode wire) as described by cell structure simulation. 
+Thus one, in principle, can calculate iteratively the drift length from the expression:
+\begin{equation}
+x = t_{drift}(x)*v_{drift}(x)
+\end{equation}
+In practice we use a numerical approach (see AliTRDcluster::GetXcorr() and Figure \ref{FIG_CLUSTER:Xcorr} left) to correct for anisochronity obtained from MC 
+comparison (see AliTRDclusterResolution::ProcessSigma() for the implementation). Also the calibration of the 0 approximation (no x dependence)
+for $t_{cause}$ is obtained from MC comparisons and impossible to disentangle in real life from trigger delay.
+\begin{figure}[htb]
+\begin{center}
+\includegraphics[width=0.48\textwidth]{plots/clusterXcorr.eps}
+\includegraphics[width=0.48\textwidth]{plots/clusterYcorr.eps}
+\end{center}
+\caption{
+Correction of the radial and $r-\phi$ position of the TRD cluster.}
+\label{FIG_CLUSTER:Xcorr}
+\end{figure}
+
+For {\bf the calculation of the $r-\phi$ offset} of the cluster from the middle of the center pad three methods are implemented:
+  - Center of Gravity (COG) see AliTRDcluster::GetDYcog()
+  - Look-up Table (LUT) see AliTRDcluster::GetDYlut()
+  - Gauss shape (GAUS) see AliTRDcluster::GetDYgauss()
+In addition for the case of LUT method position corrections are also applied (see AliTRDcluster::GetYcorr() and Figure \ref{FIG_CLUSTER:Xcorr} right).
+
+One 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:
+\begin{equation}
+y = \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}}}})]
+\end{equation}
+where W is the pad width, $y_0$ is the position of the middle of the center pad and $s^2$ is given by
+\begin{equation}
+s^{2} = s^{2}_{0} + s^{2}_{diff} (x,B) + \frac{tg^{2}(\phi-\alpha_{L})*l^{2}}{12}
+\end{equation}
+with $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:
+\begin{equation}
+s_{diff} (x,B) = \frac{D_{L}\sqrt{x}}{1+({\omega\tau}^{2}})
+\end{equation}
+with 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.
+
+{\bf Determination of shifts by comparing with MC}\\
+
+The resolution of the cluster corrected for pad tilt with respect to MC in the $r-\phi$ (measuring) plane can be 
+expressed by:
+\begin{eqnarray}
+\Delta y&=&w - y_{MC}(x_{cl})\\
+w &=& y_{cl}^{'} + h*(z_{MC}(x_{cl})-z_{cl})\\
+y_{MC}(x_{cl}) &=& y_{0} - dy/dx*x_{cl}\\
+z_{MC}(x_{cl}) &=& z_{0} - dz/dx*x_{cl}\\
+y_{cl}^{'} &=& y_{cl}-x_{cl}*tg(\alpha_{L})
+\end{eqnarray}
+where $x_{cl}$ is the drift length attached to a cluster, $y_{cl}$ is the $r-\phi$ coordinate of the cluster measured by
+charge sharing on adjacent pads and $y_0$ and $z_0$ are MC reference points (as example the track references at 
+entrance/exit of a chamber). If we suppose that both $r-\phi$ (y) and radial (x) coordinate of the clusters are 
+affected by errors we can write
+\begin{eqnarray}
+x_{cl} &=& x_{cl}^{*} + \delta x\\ 
+y_{cl} &=& y_{cl}^{*} + \delta y 
+\end{eqnarray} 
+where the starred components are the corrected values. Thus by definition the following quantity
+\begin{equation}
+\Delta y^{*}= w^{*} - y_{MC}(x_{cl}^{*})
+\end{equation}
+has 0 average over all dependency. Using this decomposition we can write:
+\begin{equation}
+<\Delta y>=<\Delta y^{*}> + <\delta x * (dy/dx-h*dz/dx) + \delta y - \delta x * tg(\alpha_{L})>
+\end{equation}
+which can be transformed to the following linear dependence:
+\begin{equation}
+<\Delta y>= <\delta x> * (dy/dx-h*dz/dx) + <\delta y - \delta x * tg(\alpha_{L})>
+\end{equation}
+if expressed as function of dy/dx-h*dz/dx. Furtheremore this expression can be plotted for various clusters
+i.e. we can explicitely introduce the diffusion ($x_{cl}$) and drift cell - anisochronity ($z_{cl}$) dependences. From 
+plotting this dependence and linear fitting it with:
+\begin{equation}
+<\Delta y>= a(x_{cl}, z_{cl}) * (dy/dx-h*dz/dx) + b(x_{cl}, z_{cl})
+\end{equation}
+the systematic shifts will be given by:
+\begin{eqnarray}
+\delta x (x_{cl}, z_{cl}) &=& a(x_{cl}, z_{cl})\\
+\delta y (x_{cl}, z_{cl}) &=& b(x_{cl}, z_{cl}) + a(x_{cl}, z_{cl}) * tg(\alpha_{L})
+\end{eqnarray}
+In Figure \ref{FIG_CLUSTER:shift} left there is an example of such dependency. 
+\begin{figure}[htb]
+\begin{center}
+\includegraphics[width=0.48\textwidth]{plots/clusterShiftMethod.eps}
+\includegraphics[width=0.48\textwidth]{plots/clusterSigmaMethod.eps}
+\end{center}
+\caption{
+Linear relation to estimate radial and $r-\phi$ cluster shifts and error.}
+\label{FIG_CLUSTER:shift}
+\end{figure}
+
+The occurance of the radial shift is due to the following conditions \\
+- the approximation of a constant drift velocity over the drift length (larger drift velocities close to 
+  cathode wire plane)\\
+- the superposition of charge tails in the amplification region (first clusters appear to be located at the 
+  anode wire)\\
+- the superposition of charge tails in the drift region (shift towards anode wire)\\
+- diffusion effects which convolute with the TRF thus enlarging it\\
+- approximate knowledge of the TRF (approximate measuring in test beam conditions) \\
+The numerical results for ideal simulations for the radial are displayed in Figure \ref{FIG_CLUSTER:Xcorr}.
+
+
+The occurance of the $r-\phi$ shift is due to the following conditions:\\ 
+  - approximate model for cluster shape (LUT)\\
+  - rounding-up problems
+
+
+\subsection[Cluster error parameterization]{Cluster error parametrization\footnote{The procedures described in this section are implemented in the functions 
+{\tt AliTRDcluster::SetSigmaY2()}, {\tt AliTRDclusterResolution::ProcessCharge()}, {\tt AliTRDclusterResolution::ProcessCenterPad()}, {\tt AliTRDclusterResolution::ProcessSigma()} and {\tt AliTRDclusterResolution::ProcessMean()}.}}\label{REC:CL:error}
+{\it Author: A.~Bercuci (A.Bercuci@gsi.de)}
+
+The 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:
+\begin{equation}
+\sigma^2_z=L^2_{pad}/12
+\end{equation}
+
+The parameters on which the {\bf $r-\phi$ error parameterization} depends are:\\ 
+  - $s^2$  - variance due to PRF width for the case of Gauss model. Replaced by parameterization in case of LUT.\\
+  - dt  - transversal diffusion coeficient\\ 
+  - exb - tg of lorentz angle\\
+  - x   - drift length - with respect to the anode wire\\
+  - z   - offset from the anode wire\\
+  - tgp - local tangent of the track momentum azimuthal angle\\
+
+The ingredients from which the error is computed are:\\
+  - PRF (charge sharing on adjacent pads)  - see AliTRDcluster::GetSYprf()
+  - diffusion (dependence with drift length and [2nd order] distance to anode wire) - see AliTRDcluster::GetSYdrift()\\
+  - charge of the cluster (complex dependence on gain and tail cancellation) - see AliTRDcluster::GetSYcharge()\\
+  - lorentz angle (dependence on the drift length and [2nd order] distance to anode wire) - see AliTRDcluster::GetSX()\\
+  - track angle (superposition of charges on the anode wire) - see AliTRDseedV1::Fit()\\
+  - projection of radial(x) error on $r-\phi$ due to fixed value assumed in tracking for x - see AliTRDseedV1::Fit()\\
+
+The last 2 contributions to cluster error can be estimated only during tracking when the track angle 
+is known (tgp). For this reason the errors (and optional position) of TRD clusters are recalculated during 
+tracking and thus clusters attached to tracks might differ from bare clusters.
+
+Taking into account all contributions one can write the the TRD cluster error parameterization as:
+\begin{equation}\label{EQ_CLUSTER:error}
+\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
+\end{equation}
+From this formula one can deduce that the simplest calibration method for PRF and diffusion contributions is 
+by measuring resolution at B=0T and phi=0. To disentangle further the two remaining contributions one has 
+to represent $s^2$ as a function of drift length. 
+
+In the gaussian model the diffusion contribution can be expressed as:
+\begin{equation}
+\sigma^{2}_{y} = \sigma^{2}_{PRF} + \frac{x\delta_{t}^{2}}{(1+tg(\alpha_{L}))^{2}}
+\end{equation}
+thus resulting the PRF contribution. For the case of the LUT model both contributions have to be determined from 
+the fit (see AliTRDclusterResolution::ProcessCenter() for details).
+
+{\bf Parameterization with respect to the distance to the middle of the center pad}\\
+
+If $\phi = \alpha_L$ in Eq. \ref{EQ_CLUSTER:error}  one gets the following expression:
+\begin{equation}\label{EQ_CLUSTER:errorPhiAlpha}
+\sigma_{y}^{2} = \sigma_{y}^{2}|_{B=0} + tg^{2}(\alpha_{L})*\sigma_{x}^{2}
+\end{equation}
+where we have explicitely marked the remaining term in case of absence of magnetic field. Thus one can use the 
+previous equation to estimate $s_y$ for B=0 and than by comparing in magnetic field conditions one can get the $s_x$.
+This is a simplified method to determine the error parameterization for $s_x$ and $s_y$ as compared to the one 
+implemented in ProcessSigma(). For more details on cluster error parameterization please see also 
+AliTRDcluster::SetSigmaY2()
+
+{\bf Parameterization with respect to drift length and distance to the anode wire}\\
+
+{\bf Parameterization with respect to cluster charge}\\
+
+In Eq. \ref{EQ_CLUSTER:errorPhiAlpha} one can explicitely write:
+\begin{equation}
+\sigma_{y}|_{B=0} = \sigma_{diff}*Gauss(0, s_{ly}) + \delta_{\sigma}(q)
+\end{equation}
+which further can be simplified to:
+\begin{eqnarray}
+<\sigma_{y}|_{B=0}>(q) &=& <\sigma_{y}> + \delta_{\sigma}(q)\\
+<\sigma_{y}> &=& \int{f(q)\sigma_{y}dq}
+\end{eqnarray}
+The results for $s_y$ and $f(q)$ are displayed in Figure \ref{FIG_CLUSTER:errorCharge}:
+\begin{figure}[htb]
+\begin{center}
+\includegraphics[width=0.48\textwidth]{plots/clusterQerror.eps}
+\includegraphics[width=0.48\textwidth]{plots/clusterQerror.eps}
+\end{center}
+\caption{
+Cluster error parameterization for different components.}
+\label{FIG_CLUSTER:errorCharge}
+\end{figure}
+The function has to extended to accomodate gain calibration scalling and errors.
+
 %
 \setcounter{footnote}{0}
 \section{Tracking}\label{REC:Tracking:}
@@ -940,11 +1146,27 @@ of the framework in which they are living (tracking) in the sections
 barrel (section \ref{REC:Tracking:Propagate}) and stand alone tracking (section 
 \ref{REC:Tracking:Clusters2TracksStack}).
 
-\subsection[title]{Tracklet building - Attaching clusters to tracklet\footnote{The 
+\subsection[Tracklet building]{Tracklet building - Attaching clusters to tracklet\footnote{The 
 procedures described in this section are implemented in the function 
 {\tt AliTRDseedV1::AttachClusters()}.}}\label{REC:Tracking:TrackletAttach}
 
-\subsection[title]{Tracklet fitting\footnote{The procedures described in this 
+Projective algorithm to attach clusters to seeding tracks. The following steps are performed :\\
+1. Collapse x coordinate for the full detector along track direction dydx.\\
+2. truncated mean on y (r-phi) direction\\
+3. purge clusters\\
+4. truncated mean on z direction\\
+5. purge clusters\\
+Optionally one can use the z, dz/dx information from the sseding track to correct for tilting.
+       
+We start up by defining the track direction in the xy plane and roads. The roads are calculated based
+on tracking information (variance in the $r-\phi$ direction) and estimated variance of the standard 
+clusters (see AliTRDcluster::SetSigmaY2()) corrected for tilt (see GetCovAt()). From this the road is.
+\begin{eqnarray}
+r_{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})})}\\
+r_{z} &= &1.5*L_{pad}
+\end{eqnarray}
+
+\subsection[Tracklet fitting]{Tracklet fitting\footnote{The procedures described in this 
 section are implemented in the function {\tt AliTRDseedV1::Fit()}.}}\label{REC:Tracking:TrackletFit}
 
 {\bf Fit in the xy plane}\\
@@ -1025,7 +1247,7 @@ In case of no tilt correction (default in the barrel tracking) the tilt is
 taken into account by the rotation of the covariance matrix. See 
 {\tt AliTRDseedV1::GetCovAt()} or \ref{REC:Tracking:TrackletErrors} for details.
 
-\subsection[title]{Tracklet errors\footnote{The procedures described in this 
+\subsection[Tracklet errors]{Tracklet errors\footnote{The procedures described in this 
 section are implemented in the function {\tt AliTRDseedV1::GetCovAt()}.}}\label{REC:Tracking:TrackletErrors}
 
 Computes covariance in the $y$-$z$ plane at radial point $x$ (in tracking coordinates) 
@@ -1090,7 +1312,7 @@ to the tracklet position which can be tuned from outside via the
 {\tt AliTRDrecoParam::SetSysCovMatrix()}. They might account for extra 
 misalignment/miscalibration uncertainties. 
 
-\subsection[title]{Track propagation in barrel tracking\footnote{The 
+\subsection[Track propagation barrel]{Track propagation in barrel tracking\footnote{The 
 procedures described in this section are implemented in the function 
 {\tt AliTRDtrackerV1::PropagateBack()}.}}\label{REC:Tracking:Propagate}
 
@@ -1098,7 +1320,7 @@ procedures described in this section are implemented in the function
 described in this section are implemented in the function 
 {\tt AliTRDtrackerV1::FollowBackProlongation()}.}\\
 
-\subsection[title]{Track finding stack wise \footnote{The procedures 
+\subsection[Stand alone track finding]{Stand alone track finding\footnote{The procedures 
 described in this section are implemented in the function 
 {\tt AliTRDtrackerV1::Clusters2TracksStack()}.}}\label{REC:Tracking:Clusters2TracksStack}