]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackV2.h
New version of the ITS tracking, presented by M.Ivanov during the off-line week in...
[u/mrichter/AliRoot.git] / ITS / AliITStrackV2.h
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 
10 //     dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
11 //-------------------------------------------------------------------------
12
13
14 /*****************************************************************************
15  *                          December 18, 2000                                *
16  *  Internal view of the ITS track parametrisation as well as the order of   *
17  *           track parameters are subject for possible changes !             *
18  *  Use GetExternalParameters() and GetExternalCovariance() to access ITS    *
19  *      track information regardless of its internal representation.         *
20  * This formation is now fixed in the following way:                         *
21  *      external param0:   local Y-coordinate of a track (cm)                *
22  *      external param1:   local Z-coordinate of a track (cm)                *
23  *      external param2:   local sine of the track momentum azimuthal angle  *
24  *      external param3:   tangent of the track momentum dip angle           *
25  *      external param4:   1/pt (1/(GeV/c))                                  *
26  *****************************************************************************/
27
28 #include <AliKalmanTrack.h>
29
30 #include "AliITSrecoV2.h"
31
32 class AliESDtrack;
33 class AliTPCtrack;
34
35 //_____________________________________________________________________________
36 class AliITStrackV2 : public AliKalmanTrack {
37   friend class AliITStrackerV2;
38   friend class AliITStrackerMI;
39 public:
40   AliITStrackV2();
41   AliITStrackV2(const AliTPCtrack& t) throw (const Char_t *);
42   AliITStrackV2(AliESDtrack& t,Bool_t c=kFALSE) throw (const Char_t *);
43   AliITStrackV2(const AliITStrackV2& t);
44   Int_t PropagateToVertex(Double_t d=0., Double_t x0=0.);
45   Int_t Propagate(Double_t alpha, Double_t xr);
46   Int_t GetProlongationFast(Double_t alpha, Double_t xr,Double_t &y, Double_t &z);
47   Int_t CorrectForMaterial(Double_t d, Double_t x0=21.82);
48   Int_t PropagateTo(Double_t xr, Double_t d, Double_t x0=21.82);
49   Int_t Update(const AliCluster* cl,Double_t chi2,UInt_t i);
50   Int_t UpdateMI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz, Double_t chi2,UInt_t i);  
51   Int_t Improve(Double_t x0,Double_t xyz[3],Double_t ers[3]);
52   void SetdEdx(Double_t dedx) {fdEdx=dedx;}
53   void SetSampledEdx(Float_t q, Int_t i);
54   void CookdEdx(Double_t low=0., Double_t up=0.51);
55   void SetDetectorIndex(Int_t i) {SetLabel(i);}
56   void ResetCovariance();
57   void ResetClusters() { SetChi2(0.); SetNumberOfClusters(0); }
58   void UpdateESDtrack(ULong_t flags);
59   void SetConstrainedESDtrack(Double_t chi2); 
60   void SetReconstructed(Bool_t sr=kTRUE){fReconstructed = sr;}
61   
62   Bool_t GetReconstructed() const {return fReconstructed;}
63   void SetChi2MIP(Int_t i,Float_t val){fChi2MIP[i]=val;}
64   Float_t GetChi2MIP(Int_t i) const {return fChi2MIP[i];}  
65   void IncrementNSkipped(){fNSkipped++;} // increment by 1 the # of skipped cls
66   Float_t GetNSkipped() const {return fNSkipped;}
67   void IncrementNUsed(){fNUsed++;} // increment by 1 the # of shared clusters
68   Float_t GetNUsed() const {return fNUsed;}
69   AliESDtrack *GetESDtrack() const {return fESDtrack;}
70   Double_t GetCov33() const {return fC33;} // cov. matrix el. 3,3
71   Double_t GetCov44() const {return fC44;} // cov. matrix el. 4,4
72   Float_t GetDy(Int_t i) const {return fDy[i];}
73   Float_t GetDz(Int_t i) const {return fDz[i];}
74   Float_t GetSigmaY(Int_t i) const {return fSigmaY[i];}
75   Float_t GetSigmaZ(Int_t i) const {return fSigmaZ[i];}
76
77
78
79   Int_t GetDetectorIndex() const {return GetLabel();}
80   Double_t GetX()    const {return fX;}
81   Double_t GetAlpha()const {return fAlpha;}
82   Double_t GetdEdx() const {return fdEdx;}
83   Double_t GetPIDsignal() const {return GetdEdx();}
84   Double_t GetY()    const {return fP0;}
85   Double_t GetZ()    const {return fP1;}
86   Double_t GetSnp()  const {return fP2;}
87   Double_t GetTgl()  const {return fP3;}
88   Double_t GetC()    const {return fP4;}
89   Double_t
90     Get1Pt() const { return (1e-9*TMath::Abs(fP4)/fP4 + fP4)*GetConvConst(); }
91   Double_t GetD(Double_t x=0, Double_t y=0) const;
92   Double_t GetZat(Double_t x=0) const;
93
94   Double_t GetSigmaY2() const {return fC00;}
95   Double_t GetSigmaZ2() const {return fC11;}
96   Int_t Compare(const TObject *o) const;
97   void GetExternalParameters(Double_t& xr, Double_t x[5]) const ;
98   void GetExternalCovariance(Double_t cov[15]) const ;
99   Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
100   Int_t GetGlobalXYZat(Double_t r,Double_t &x,Double_t &y,Double_t &z) const;
101   Double_t GetPredictedChi2(const AliCluster *cluster) const;
102   Double_t GetPredictedChi2MI(Double_t cy, Double_t cz, Double_t cerry, Double_t cerrz) const;
103   Int_t Invariant() const;
104  
105 protected:
106   Double_t fX;              // X-coordinate of this track (reference plane)
107   Double_t fAlpha;          // rotation angle
108
109   Double_t fdEdx;           // dE/dx
110
111   Double_t fP0;             // Y-coordinate of a track 
112   Double_t fP1;             // Z-coordinate of a track
113   Double_t fP2;             // sine of the track momentum azimuthal angle
114   Double_t fP3;             // tangent of the track momentum dip angle
115   Double_t fP4;             // track curvature
116
117   Double_t fC00;                         // covariance
118   Double_t fC10, fC11;                   // matrix
119   Double_t fC20, fC21, fC22;             // of the
120   Double_t fC30, fC31, fC32, fC33;       // track
121   Double_t fC40, fC41, fC42, fC43, fC44; // parameters 
122   Float_t fNUsed;                          // number of shared clusters
123   Float_t fNSkipped;                       // number of skipped clusters
124   Float_t fNDeadZone;                     // number of clusters in dead zone
125   Float_t fDeadZoneProbability;          // probability to cross dead zone
126   Bool_t fReconstructed;                 // reconstructed - accepted flag
127   Float_t fChi2MIP[12];                   // MIP chi squres 
128   UInt_t fIndex[kMaxLayer]; // indices of associated clusters 
129   Float_t fdEdxSample[4];   // array of dE/dx samples b.b.
130   Float_t fDy[12];           //dy in layer
131   Float_t fDz[12];           //dz in layer
132   Float_t fSigmaY[12];       //sigma y 
133   Float_t fSigmaZ[12];       //sigma z
134   Float_t fNy[6];              //expected size of cluster
135   Float_t fNz[6];              //expected size of cluster
136   Float_t fD[2];            //distance to the vertex
137   Float_t fNormQ[6];        // normalized Q
138   Float_t fExpQ;            // expected Q
139   Float_t fNormChi2[6];     // normalized chi2 
140   Float_t fChi22;           // chi22
141   Float_t fdEdxMismatch;    
142   Bool_t fConstrain;        //indication of the vertex constrain
143   Int_t  fClIndex[6];       //cluster Index
144   AliESDtrack *fESDtrack;   //! pointer to the connected ESD track
145   ClassDef(AliITStrackV2,3)   //ITS reconstructed track
146 };
147
148 inline 
149 void AliITStrackV2::GetExternalParameters(Double_t& xr, Double_t x[5]) const {
150   //---------------------------------------------------------------------
151   // This function return external ITS track representation
152   //---------------------------------------------------------------------
153      xr=fX;          
154      x[0]=GetY(); x[1]=GetZ(); x[2]=GetSnp(); x[3]=GetTgl(); x[4]=Get1Pt();
155 }
156
157 inline
158 void AliITStrackV2::SetSampledEdx(Float_t q, Int_t i) {
159   //----------------------------------------------------------------------
160   // This function stores dEdx sample corrected for the track segment length 
161   // Origin: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
162   //----------------------------------------------------------------------
163   if (i<0) return;
164   if (i>3) return;
165   Double_t s=GetSnp(), t=GetTgl();
166   q *= TMath::Sqrt((1-s*s)/(1+t*t));
167   fdEdxSample[i]=q;
168 }
169 #endif
170
171