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 */
6 //-------------------------------------------------------------------------
9 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
10 // dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
11 //-------------------------------------------------------------------------
13 #include <AliKalmanTrack.h>
14 #include "AliITSRecoParam.h"
15 #include "AliITSgeomTGeo.h"
22 //_____________________________________________________________________________
23 class AliITStrackV2 : public AliKalmanTrack {
26 AliITStrackV2(AliESDtrack& t,Bool_t c=kFALSE) throw (const Char_t *);
27 AliITStrackV2(const AliITStrackV2& t);
28 ~AliITStrackV2(){fESDtrack=0;}
30 Bool_t CorrectForMeanMaterial(Double_t xOverX0, Double_t xTimesRho,
31 Bool_t anglecorr=kFALSE) {
32 return AliExternalTrackParam::CorrectForMeanMaterial(xOverX0,xTimesRho,GetMass(),anglecorr);
34 Bool_t CorrectForMaterial(Double_t d, Double_t x0=AliITSRecoParam::GetX0Air()) {
35 // deprecated: use CorrectForMeanMaterial instead
36 return AliExternalTrackParam::CorrectForMaterial(d,x0,GetMass());
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);
43 Double_t GetPredictedChi2(const AliCluster *cluster) const;
44 Bool_t Update(const AliCluster *cl, Double_t chi2, Int_t i);
46 Bool_t PropagateToVertex(const AliESDVertex *v,Double_t d=0.,Double_t x0=0.);
47 Bool_t Propagate(Double_t alpha, Double_t xr);
48 Bool_t MeanBudgetToPrimVertex(Double_t xyz[3], Double_t step, Double_t &d) const;
49 Bool_t Improve(Double_t x0,Double_t xyz[3],Double_t ers[3]);
51 void SetdEdx(Double_t dedx) {fdEdx=dedx;}
52 void SetSampledEdx(Float_t q, Int_t i);
53 Float_t GetSampledEdx(Int_t i) const {return fdEdxSample[i];}
54 void CookdEdx(Double_t low=0., Double_t up=0.51);
55 void SetDetectorIndex(Int_t i) {SetLabel(i);}
57 void UpdateESDtrack(ULong_t flags) const;
59 AliESDtrack *GetESDtrack() const {return fESDtrack;}
61 Int_t GetDetectorIndex() const {return GetLabel();}
62 Double_t GetdEdx() const {return fdEdx;}
63 Double_t GetPIDsignal() const {return GetdEdx();}
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());
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);
72 Bool_t GetGlobalXYZat(Double_t xloc,Double_t &x,Double_t &y,Double_t &z) const;
73 Bool_t GetPhiZat(Double_t r,Double_t &phi,Double_t &z) const;
74 Bool_t GetLocalXat(Double_t r,Double_t &xloc) const;
76 Int_t Compare(const TObject *o) const;
77 Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
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;
82 Bool_t Invariant() const;
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];}
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];}
91 Double_t GetBz() const ;
92 Double_t fdEdx; // dE/dx
94 static const Int_t fgkWARN; //! used for debugging purposes
95 Float_t fdEdxSample[4]; // array of dE/dx samples b.b.
97 Int_t fIndex[2*AliITSgeomTGeo::kNLayers]; // indices of associated clusters
99 Int_t fModule[2*AliITSgeomTGeo::kNLayers]; // indices of crossed modules:
100 // see SetModuleIndexInfo()
101 AliESDtrack *fESDtrack; //! pointer to the connected ESD track
104 AliITStrackV2 &operator=(const AliITStrackV2 &tr);
105 ClassDef(AliITStrackV2,7) //ITS reconstructed track
108 inline void AliITStrackV2::SetSampledEdx(Float_t q, Int_t i) {
109 //----------------------------------------------------------------------
110 // This function stores dEdx sample corrected for the track segment length
111 // Origin: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
112 //----------------------------------------------------------------------
115 Double_t s=GetSnp(), t=GetTgl();
116 q *= TMath::Sqrt((1-s*s)/(1+t*t));
121 inline 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 //----------------------------------------------------------------------
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);
145 Int_t xInt = Int_t(xloc*10.);
146 Int_t zInt = Int_t(zloc*10.);
148 if(TMath::Abs(xloc*10.-(Float_t)xInt)>0.5)
149 if(zloc>0) { xInt++; } else { xInt--; }
150 if(TMath::Abs(zloc*10.-(Float_t)zInt)>0.5)
151 if(zloc>0) { zInt++; } else { zInt--; }
154 if(xInt>=0 && zInt>=0) signs=10000;
155 if(xInt>=0 && zInt<0) signs=20000;
156 if(xInt<0 && zInt>=0) signs=30000;
157 if(xInt<0 && zInt<0) signs=40000;
159 Int_t modindex = signs;
161 modindex += TMath::Abs(zInt);
162 modindex += TMath::Abs(xInt)*100;
164 modindex += status*100000;
166 modindex += idet*1000000;
168 SetModuleIndex(ilayer,modindex);
172 inline Bool_t AliITStrackV2::GetModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,
173 Float_t &xloc,Float_t &zloc) const {
174 //----------------------------------------------------------------------
175 // This function encodes in the module number also the status of cluster association
176 // "status" can have the following values:
177 // 1 "found" (cluster is associated),
178 // 2 "dead" (module is dead from OCDB),
179 // 3 "skipped" (module or layer forced to be skipped),
180 // 4 "outinz" (track out of z acceptance),
181 // 5 "nocls" (no clusters in the road),
182 // 6 "norefit" (cluster rejected during refit),
183 // 7 "deadzspd" (holes in z in SPD)
184 // Also given are the coordinates of the crossing point of track and module
185 // (in the local module ref. system)
186 // WARNING: THIS METHOD HAS TO BE SYNCHRONIZED WITH AliESDtrack::GetITSModuleIndexInfo()!
187 //----------------------------------------------------------------------
190 if(fModule[ilayer]==-1) {
191 AliError("fModule was not set !");
194 xloc=-99.; zloc=-99.;
198 Int_t module = fModule[ilayer];
200 idet = Int_t(module/1000000);
202 module -= idet*1000000;
204 status = Int_t(module/100000);
206 module -= status*100000;
208 Int_t signs = Int_t(module/10000);
212 Int_t xInt = Int_t(module/100);
217 if(signs==1) { xInt*=1; zInt*=1; }
218 if(signs==2) { xInt*=1; zInt*=-1; }
219 if(signs==3) { xInt*=-1; zInt*=1; }
220 if(signs==4) { xInt*=-1; zInt*=-1; }
222 xloc = 0.1*(Float_t)xInt;
223 zloc = 0.1*(Float_t)zInt;
225 if(status==4) idet = -1;