]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITStrackSA.cxx
Various fixes in order to compile the DA source code
[u/mrichter/AliRoot.git] / ITS / AliITStrackSA.cxx
CommitLineData
13918578 1/**************************************************************************
2 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
bf6adc12 15
16/* $Id$ */
17
13918578 18////////////////////////////////////////////////////
19// Stand alone track class //
20// Origin: Elisabetta Crescio //
21// e-mail: crescio@to.infn.it //
22// it is a V2 track with a possible number //
23// of cluster equal to fgkMaxNumberOfClusters //
24////////////////////////////////////////////////////
25
cc088660 26#include "AliITSgeomTGeo.h"
13918578 27#include "AliITStrackSA.h"
28
29
30ClassImp(AliITStrackSA)
31
32//_____________________________________
e399f961 33AliITStrackSA:: AliITStrackSA() : AliITStrackMI(),
34fNSA(0)
35{
13918578 36// Default constructor
37 SetNumberOfClusters(0);
38 SetNumberOfClustersSA(0);
39 ResetIndexSA();
7e5bf5af 40 for(Int_t nlay=0;nlay<fgkLayers;nlay++){
41 SetNumberOfMarked(nlay,0);
42 }
43 ResetMarked();
13918578 44}
45
46
47//___________________________________________________
15dd636f 48AliITStrackSA::AliITStrackSA(const AliITStrackMI& t) :
e399f961 49AliITStrackMI(t),
50fNSA(0){
13918578 51// Copy a V2 track into a SA track
52 SetNumberOfClustersSA(0);
53 ResetIndexSA();
7e5bf5af 54 for(Int_t nlay=0;nlay<fgkLayers;nlay++){
55 SetNumberOfMarked(nlay,0);
56 }
57 ResetMarked();
58
13918578 59}
60//___________________________________________________
61AliITStrackSA::AliITStrackSA(const AliITStrackSA& t) :
e399f961 62AliITStrackMI(t),
63fNSA(t.fNSA){
13918578 64// Copy constructor
65
7d62fb64 66
13918578 67 ResetIndexSA();
7e5bf5af 68 ResetMarked();
13918578 69 Int_t number = t.GetNumberOfClustersSA();
70 SetNumberOfClustersSA(number);
7e5bf5af 71 for(Int_t nlay=0;nlay<fgkLayers;nlay++){
72 SetNumberOfMarked(nlay,t.GetNumberOfMarked(nlay));
73 }
13918578 74 for(Int_t i=0;i<number;i++){
75 fSain[i]=t.fSain[i];
76 }
7e5bf5af 77 for(Int_t nlay=0;nlay<fgkLayers;nlay++){
78 for(Int_t i=0;i<t.GetNumberOfMarked(nlay);i++){
79 fCluMark[nlay][i]=t.fCluMark[nlay][i];
80 }
81 }
13918578 82}
83//____________________________________________________
cc088660 84AliITStrackSA::AliITStrackSA(Int_t layer, Int_t ladder, Int_t detector, Double_t Ycoor, Double_t Zcoor, Double_t phi, Double_t tanlambda, Double_t curv, Int_t lab ):
e399f961 85fNSA(0)
86{
13918578 87 // standard constructor. Used for ITS standalone tracking
7d62fb64 88
13918578 89 // get the azimuthal angle of the detector containing the innermost
90 // cluster of this track (data member fAlpha)
cc088660 91 Double_t rotmatr[9];
92 AliITSgeomTGeo::GetRotation(layer,ladder,detector,rotmatr);
6c94f330 93 Double_t sAlpha=TMath::ATan2(rotmatr[1],rotmatr[0])+TMath::Pi();
94 sAlpha+=TMath::Pi()/2.;
95 if(layer==1) sAlpha+=TMath::Pi();
13918578 96
97
98 // get the radius of this detector. Procedure taken from the
99 // AliITStrackerV2 constructor
100 Float_t x=0,y=0,z=0;
cc088660 101 Double_t xyz[3];
102 AliITSgeomTGeo::GetTranslation(layer,ladder,detector,xyz);
103 x=xyz[0];
104 y=xyz[1];
105 z=xyz[2];
13918578 106
107 Double_t fi=TMath::ATan2(rotmatr[1],rotmatr[0])+TMath::Pi();
108 fi+=TMath::Pi()/2;
109 if (layer==1) fi+=TMath::Pi();
110 Double_t cp=TMath::Cos(fi), sp=TMath::Sin(fi);
6c94f330 111 Double_t sX=x*cp+y*sp;
13918578 112
113
114 fdEdx = 0;
115
6c94f330 116 Double_t conv=GetBz()*kB2C;
117 Double_t sC[] = {0.000009, // 0.000009
118 0.,
119 0.000003, //0.000030
120 0.,
121 0.,
122 0.000001, //0.000001
123 0.,
124 0.,
125 0.,
126 0.000002, //0.000002
127 0.,
128 0.,
129 0.,
130 0.,
131 0.000001/(conv*conv)}; //0.0000001
132
133 Double_t sP[] = {Ycoor,
134 Zcoor,
135 TMath::Sin(phi-sAlpha),
136 tanlambda,
137 curv/conv};
138
1966f03c 139
140 // dealing with the case B=0 (taken from AliTPCtrack.cxx)
141 Double_t p0=TMath::Sign(1/kMostProbablePt,sP[4]);
142 Double_t w0=sC[14]/(sC[14] + p0*p0), w1=p0*p0/(sC[14] + p0*p0);
143 sP[4] = w0*p0 + w1*sP[4];
144 sC[14]*=w1;
145
6c94f330 146 Set(sX,sAlpha,sP,sC);
147
13918578 148 for(Int_t i=0; i<kMaxLayer; i++) fIndex[i] = 0; // to be set explicitely
149
150 for(Int_t i=0; i<4; i++) fdEdxSample[i] = 0;
151
152 SetNumberOfClusters(0);
153 SetNumberOfClustersSA(0);
7e5bf5af 154 for(Int_t nlay=0;nlay<fgkLayers;nlay++) SetNumberOfMarked(nlay,0);
13918578 155 ResetIndexSA();
7e5bf5af 156 ResetMarked();
13918578 157 SetChi2(0);
158 SetMass(0.139); // pion mass
159 SetLabel(lab);
160
161}
162
163//____________________________________________________________
164void AliITStrackSA::AddClusterSA(Int_t layer, Int_t clnumb) {
165 // add one clusters to the list (maximum number=fgkMaxNumberOfClusters)
166 Int_t presnum = GetNumberOfClustersSA();
167 if(presnum>=fgkMaxNumberOfClusters){
168 Warning("AddClusterSA","Maximum number of clusters already reached. Nothing is done\n");
169 return;
170 }
171
172 fSain[presnum] = (layer<<28)+clnumb;
173 presnum++;
174 SetNumberOfClustersSA(presnum);
175}
176
7e5bf5af 177//____________________________________________________________
178void AliITStrackSA::AddClusterMark(Int_t layer, Int_t clnumb) {
179 // add one clusters to the list (maximum number=fgkMaxNumberOfClusters)
180 Int_t presnum = GetNumberOfMarked(layer);
181 // printf("presnum=%d\n",presnum);
182 if(presnum>=fgkMaxNumberOfClustersL){
183 Warning("AddClusterMark","Maximum number of clusters already reached. Nothing is done\n");
184 return;
185 }
186
187 fCluMark[layer][presnum] = clnumb;
188 presnum++;
189 SetNumberOfMarked(layer,presnum);
190}
191
13918578 192//____________________________________________________________
193void AliITStrackSA::AddClusterV2(Int_t layer,Int_t clnumb) {
194 // add one clusters to the list (maximum number=6)
195 Int_t presnum = GetNumberOfClusters();
196 if(presnum>=kMaxLayer){
197 Warning("AddClusterV2","Maximum number of clusters already reached. Nothing is done\n");
198 return;
199 }
200
201 fIndex[presnum] = (layer<<28)+clnumb;
202 presnum++;
203 SetNumberOfClusters(presnum);
204}
205
7e5bf5af 206//_____________________________________________________________
207void AliITStrackSA::ResetMarked(){
13918578 208
7e5bf5af 209 //Reset array of marked clusters
210 for(Int_t nlay=0;nlay<fgkLayers;nlay++){
211 for(Int_t k=0; k<fgkMaxNumberOfClustersL; k++) fCluMark[nlay][k]=0;
212 }
213}
13918578 214
215
216
217
218
219
220
221
222
223
224
225
226
227