]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITStrackV2.h
Obsolete.
[u/mrichter/AliRoot.git] / ITS / AliITStrackV2.h
CommitLineData
006b5f7f 1#ifndef ALIITSTRACKV2_H
2#define ALIITSTRACKV2_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6//-------------------------------------------------------------------------
7// ITS Track Class
8//
9// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
a9a2d814 10// dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
006b5f7f 11//-------------------------------------------------------------------------
12
006b5f7f 13#include <AliKalmanTrack.h>
44347160 14#include "AliITSRecoParam.h"
e50912db 15#include "AliITSgeomTGeo.h"
006b5f7f 16
ae00569a 17/* $Id$ */
18
83d73500 19class AliESDtrack;
58e536c5 20class AliESDVertex;
006b5f7f 21
22//_____________________________________________________________________________
8676d691 23class AliITStrackV2 : public AliKalmanTrack {
006b5f7f 24public:
22b13da0 25 AliITStrackV2();
67c3dcbe 26 AliITStrackV2(AliESDtrack& t,Bool_t c=kFALSE) throw (const Char_t *);
006b5f7f 27 AliITStrackV2(const AliITStrackV2& t);
43d2197f 28 ~AliITStrackV2(){fESDtrack=0;}
6c94f330 29
e50912db 30 Bool_t CorrectForMeanMaterial(Double_t xOverX0, Double_t xTimesRho,
31 Bool_t anglecorr=kFALSE) {
32 return AliExternalTrackParam::CorrectForMeanMaterial(xOverX0,xTimesRho,GetMass(),anglecorr);
33 }
34 Bool_t CorrectForMaterial(Double_t d, Double_t x0=AliITSRecoParam::GetX0Air()) {
35 // deprecated: use CorrectForMeanMaterial instead
6c94f330 36 return AliExternalTrackParam::CorrectForMaterial(d,x0,GetMass());
37 }
e50912db 38 Bool_t PropagateTo(Double_t xr, Double_t d, Double_t x0=AliITSRecoParam::GetX0Air());
39 Bool_t PropagateToTGeo(Double_t xToGo, Int_t nstep, Double_t &xOverX0, Double_t &xTimesRho);
40 Bool_t PropagateToTGeo(Double_t xToGo, Int_t nstep=1) {
41 Double_t dummy1,dummy2; return PropagateToTGeo(xToGo,nstep,dummy1,dummy2);
afd25725 42 }
6c94f330 43 Double_t GetPredictedChi2(const AliCluster *cluster) const;
44 Bool_t Update(const AliCluster *cl, Double_t chi2, Int_t i);
45
e50912db 46 Bool_t PropagateToVertex(const AliESDVertex *v,Double_t d=0.,Double_t x0=0.);
6c94f330 47 Bool_t Propagate(Double_t alpha, Double_t xr);
afd25725 48 Bool_t MeanBudgetToPrimVertex(Double_t xyz[3], Double_t step, Double_t &d) const;
6c94f330 49 Bool_t Improve(Double_t x0,Double_t xyz[3],Double_t ers[3]);
50
7f6ddf58 51 void SetdEdx(Double_t dedx) {fdEdx=dedx;}
a9a2d814 52 void SetSampledEdx(Float_t q, Int_t i);
b9671574 53 Float_t GetSampledEdx(Int_t i) const {return fdEdxSample[i];}
a9a2d814 54 void CookdEdx(Double_t low=0., Double_t up=0.51);
006b5f7f 55 void SetDetectorIndex(Int_t i) {SetLabel(i);}
7ac23097 56 void ResetClusters();
15dd636f 57 void UpdateESDtrack(ULong_t flags) const;
e43c066c 58
1aedd96e 59 AliESDtrack *GetESDtrack() const {return fESDtrack;}
e43c066c 60
006b5f7f 61 Int_t GetDetectorIndex() const {return GetLabel();}
7f6ddf58 62 Double_t GetdEdx() const {return fdEdx;}
83d73500 63 Double_t GetPIDsignal() const {return GetdEdx();}
6c94f330 64 Double_t GetC() const {return AliExternalTrackParam::GetC(GetBz());}
65 Double_t GetD(Double_t x, Double_t y) const {
66 return AliExternalTrackParam::GetD(x,y,GetBz());
67 }
68 void GetDZ(Double_t xv, Double_t yv, Double_t zv, Float_t dz[2]) const {
69 return AliExternalTrackParam::GetDZ(xv,yv,zv,GetBz(),dz);
70 }
71
e50912db 72 Bool_t GetGlobalXYZat(Double_t xloc,Double_t &x,Double_t &y,Double_t &z) const;
8602c008 73 Bool_t GetPhiZat(Double_t r,Double_t &phi,Double_t &z) const;
e50912db 74 Bool_t GetLocalXat(Double_t r,Double_t &xloc) const;
6c94f330 75
006b5f7f 76 Int_t Compare(const TObject *o) const;
006b5f7f 77 Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
ae00569a 78 void SetModuleIndex(Int_t ilayer,Int_t idx) {fModule[ilayer]=idx;}
79 Int_t GetModuleIndex(Int_t ilayer) const {return fModule[ilayer];}
80 void SetModuleIndexInfo(Int_t ilayer,Int_t idet,Int_t status=1,Float_t xloc=0,Float_t zloc=0);
81 Bool_t GetModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,Float_t &xloc,Float_t &zloc) const;
6c94f330 82 Bool_t Invariant() const;
ef7253ac 83
ae00569a 84 void SetExtraCluster(Int_t ilayer, Int_t idx) {fIndex[AliITSgeomTGeo::kNLayers+ilayer]=idx;}
85 Int_t GetExtraCluster(Int_t ilayer) const {return fIndex[AliITSgeomTGeo::kNLayers+ilayer];}
86
87 void SetExtraModule(Int_t ilayer, Int_t idx) {fModule[AliITSgeomTGeo::kNLayers+ilayer]=idx;}
88 Int_t GetExtraModule(Int_t ilayer) const {return fModule[AliITSgeomTGeo::kNLayers+ilayer];}
c84a5e9e 89
6c94f330 90protected:
91 Double_t GetBz() const ;
92 Double_t fdEdx; // dE/dx
8602c008 93
94 static const Int_t fgkWARN; //! used for debugging purposes
6c94f330 95 Float_t fdEdxSample[4]; // array of dE/dx samples b.b.
15dd636f 96
e50912db 97 Int_t fIndex[2*AliITSgeomTGeo::kNLayers]; // indices of associated clusters
15dd636f 98
ae00569a 99 Int_t fModule[2*AliITSgeomTGeo::kNLayers]; // indices of crossed modules:
100 // see SetModuleIndexInfo()
ef7253ac 101 AliESDtrack *fESDtrack; //! pointer to the connected ESD track
006b5f7f 102
6c94f330 103private:
104 AliITStrackV2 &operator=(const AliITStrackV2 &tr);
8602c008 105 ClassDef(AliITStrackV2,7) //ITS reconstructed track
6c94f330 106};
a9a2d814 107
ae00569a 108inline void AliITStrackV2::SetSampledEdx(Float_t q, Int_t i) {
23efe5f1 109 //----------------------------------------------------------------------
a9a2d814 110 // This function stores dEdx sample corrected for the track segment length
111 // Origin: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
23efe5f1 112 //----------------------------------------------------------------------
a9a2d814 113 if (i<0) return;
114 if (i>3) return;
23efe5f1 115 Double_t s=GetSnp(), t=GetTgl();
23efe5f1 116 q *= TMath::Sqrt((1-s*s)/(1+t*t));
117 fdEdxSample[i]=q;
ae00569a 118 return;
23efe5f1 119}
c84a5e9e 120
ae00569a 121inline void AliITStrackV2::SetModuleIndexInfo(Int_t ilayer,Int_t idet,Int_t status,
122 Float_t xloc,Float_t zloc) {
123 //----------------------------------------------------------------------
124 // This function encodes in the module number also the status of cluster association
125 // "status" can have the following values:
126 // 1 "found" (cluster is associated),
127 // 2 "dead" (module is dead from OCDB),
128 // 3 "skipped" (module or layer forced to be skipped),
129 // 4 "outinz" (track out of z acceptance),
130 // 5 "nocls" (no clusters in the road),
131 // 6 "norefit" (cluster rejected during refit)
132 // 7 "deadzspd" (holes in z in SPD)
133 // WARNING: THIS METHOD HAS TO BE SYNCHRONIZED WITH AliESDtrack::GetITSModuleIndexInfo()!
134 //----------------------------------------------------------------------
135
136 if(idet<0) {
137 idet=0;
138 } else {
139 // same detector numbering as in AliITSCalib classes
140 if(ilayer==1) idet+=AliITSgeomTGeo::GetNLadders(1)*AliITSgeomTGeo::GetNDetectors(1);
141 if(ilayer==3) idet+=AliITSgeomTGeo::GetNLadders(3)*AliITSgeomTGeo::GetNDetectors(3);
142 if(ilayer==5) idet+=AliITSgeomTGeo::GetNLadders(5)*AliITSgeomTGeo::GetNDetectors(5);
143 }
144
145 Int_t xInt = Int_t(xloc*10.);
146 Int_t zInt = Int_t(zloc*10.);
147
5af4a2d0 148 if(TMath::Abs(xloc*10.-(Float_t)xInt)>0.5){
149 if(zloc>0) {
150 xInt++;
151 }
152 else {
153 xInt--;
154 }
155 }
156 if(TMath::Abs(zloc*10.-(Float_t)zInt)>0.5){
157 if(zloc>0) {
158 zInt++;
159 }
160 else {
161 zInt--;
162 }
163 }
ae00569a 164 Int_t signs=0;
165 if(xInt>=0 && zInt>=0) signs=10000;
166 if(xInt>=0 && zInt<0) signs=20000;
167 if(xInt<0 && zInt>=0) signs=30000;
168 if(xInt<0 && zInt<0) signs=40000;
169
170 Int_t modindex = signs;
171
172 modindex += TMath::Abs(zInt);
173 modindex += TMath::Abs(xInt)*100;
174
175 modindex += status*100000;
176
177 modindex += idet*1000000;
178
179 SetModuleIndex(ilayer,modindex);
180 return;
181}
182
183inline Bool_t AliITStrackV2::GetModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,
184 Float_t &xloc,Float_t &zloc) const {
185 //----------------------------------------------------------------------
186 // This function encodes in the module number also the status of cluster association
187 // "status" can have the following values:
188 // 1 "found" (cluster is associated),
189 // 2 "dead" (module is dead from OCDB),
190 // 3 "skipped" (module or layer forced to be skipped),
191 // 4 "outinz" (track out of z acceptance),
192 // 5 "nocls" (no clusters in the road),
193 // 6 "norefit" (cluster rejected during refit),
194 // 7 "deadzspd" (holes in z in SPD)
195 // Also given are the coordinates of the crossing point of track and module
196 // (in the local module ref. system)
197 // WARNING: THIS METHOD HAS TO BE SYNCHRONIZED WITH AliESDtrack::GetITSModuleIndexInfo()!
198 //----------------------------------------------------------------------
199
200
201 if(fModule[ilayer]==-1) {
202 AliError("fModule was not set !");
203 idet = -1;
204 status=0;
205 xloc=-99.; zloc=-99.;
206 return kFALSE;
207 }
208
209 Int_t module = fModule[ilayer];
210
211 idet = Int_t(module/1000000);
212
213 module -= idet*1000000;
214
215 status = Int_t(module/100000);
216
217 module -= status*100000;
218
219 Int_t signs = Int_t(module/10000);
220
221 module-=signs*10000;
222
223 Int_t xInt = Int_t(module/100);
224 module -= xInt*100;
225
226 Int_t zInt = module;
227
228 if(signs==1) { xInt*=1; zInt*=1; }
229 if(signs==2) { xInt*=1; zInt*=-1; }
230 if(signs==3) { xInt*=-1; zInt*=1; }
231 if(signs==4) { xInt*=-1; zInt*=-1; }
232
233 xloc = 0.1*(Float_t)xInt;
234 zloc = 0.1*(Float_t)zInt;
235
236 if(status==4) idet = -1;
237
238 return kTRUE;
239}
240
241
006b5f7f 242#endif
243
244