1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //-------------------------------------------------------------------------
17 // Implementation of the ITS track class
19 // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
20 // dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
21 //-------------------------------------------------------------------------
26 #include <Riostream.h>
28 #include "AliCluster.h"
29 #include "AliTPCtrack.h"
30 #include "AliITStrackV2.h"
32 ClassImp(AliITStrackV2)
36 //____________________________________________________________________________
37 AliITStrackV2::AliITStrackV2():AliKalmanTrack(),
62 for(Int_t i=0; i<kMaxLayer; i++) fIndex[i]=0;
63 for(Int_t i=0; i<4; i++) fdEdxSample[i]=0;
65 //____________________________________________________________________________
66 AliITStrackV2::AliITStrackV2(const AliTPCtrack& t) throw (const Char_t *) :
68 //------------------------------------------------------------------
69 //Conversion TPC track -> ITS track
70 //------------------------------------------------------------------
72 SetNumberOfClusters(0);
77 fAlpha = t.GetAlpha();
78 if (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
79 else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
81 //Conversion of the track parameters
82 Double_t x,p[5]; t.GetExternalParameters(x,p);
83 fX=x; x=GetConvConst();
90 //Conversion of the covariance matrix
91 Double_t c[15]; t.GetExternalCovariance(c);
94 fC10=c[1 ]; fC11=c[2 ];
95 fC20=c[3 ]; fC21=c[4 ]; fC22=c[5 ];
96 fC30=c[6 ]; fC31=c[7 ]; fC32=c[8 ]; fC33=c[9 ];
97 fC40=c[10]/x; fC41=c[11]/x; fC42=c[12]/x; fC43=c[13]/x; fC44=c[14]/x/x;
99 if (!Invariant()) throw "AliITStrackV2: conversion failed !\n";
103 //____________________________________________________________________________
104 AliITStrackV2::AliITStrackV2(const AliITStrackV2& t) : AliKalmanTrack(t) {
105 //------------------------------------------------------------------
107 //------------------------------------------------------------------
112 fP0=t.fP0; fP1=t.fP1; fP2=t.fP2; fP3=t.fP3; fP4=t.fP4;
115 fC10=t.fC10; fC11=t.fC11;
116 fC20=t.fC20; fC21=t.fC21; fC22=t.fC22;
117 fC30=t.fC30; fC31=t.fC31; fC32=t.fC32; fC33=t.fC33;
118 fC40=t.fC40; fC41=t.fC41; fC42=t.fC42; fC43=t.fC43; fC44=t.fC44;
120 Int_t n=GetNumberOfClusters();
121 for (Int_t i=0; i<n; i++) {
122 fIndex[i]=t.fIndex[i];
123 if (i<4) fdEdxSample[i]=t.fdEdxSample[i];
127 //_____________________________________________________________________________
128 Int_t AliITStrackV2::Compare(const TObject *o) const {
129 //-----------------------------------------------------------------
130 // This function compares tracks according to the their curvature
131 //-----------------------------------------------------------------
132 AliITStrackV2 *t=(AliITStrackV2*)o;
133 //Double_t co=TMath::Abs(t->Get1Pt());
134 //Double_t c =TMath::Abs(Get1Pt());
135 Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
136 Double_t c =GetSigmaY2()*GetSigmaZ2();
138 else if (c<co) return -1;
142 //_____________________________________________________________________________
143 void AliITStrackV2::GetExternalCovariance(Double_t cc[15]) const {
144 //-------------------------------------------------------------------------
145 // This function returns an external representation of the covriance matrix.
146 // (See comments in AliTPCtrack.h about external track representation)
147 //-------------------------------------------------------------------------
148 Double_t a=GetConvConst();
151 cc[1 ]=fC10; cc[2 ]=fC11;
152 cc[3 ]=fC20; cc[4 ]=fC21; cc[5 ]=fC22;
153 cc[6 ]=fC30; cc[7 ]=fC31; cc[8 ]=fC32; cc[9 ]=fC33;
154 cc[10]=fC40*a; cc[11]=fC41*a; cc[12]=fC42*a; cc[13]=fC43*a; cc[14]=fC44*a*a;
157 //____________________________________________________________________________
158 Int_t AliITStrackV2::PropagateToVertex(Double_t d,Double_t x0) {
159 //------------------------------------------------------------------
160 //This function propagates a track to the minimal distance from the origin
161 //------------------------------------------------------------------
162 Double_t xv=fP2*(fX*fP2 - fP0*TMath::Sqrt(1.- fP2*fP2)); //linear approxim.
163 PropagateTo(xv,d,x0);
167 //____________________________________________________________________________
168 Int_t AliITStrackV2::
169 GetGlobalXYZat(Double_t xk, Double_t &x, Double_t &y, Double_t &z) const {
170 //------------------------------------------------------------------
171 //This function returns a track position in the global system
172 //------------------------------------------------------------------
174 Double_t f1=fP2, f2=f1 + fP4*dx;
175 if (TMath::Abs(f2) >= 0.9999) {
176 Int_t n=GetNumberOfClusters();
178 cerr<<n<<" AliITStrackV2::GetGlobalXYZat: Propagation failed !\n";
182 Double_t r1=sqrt(1.- f1*f1), r2=sqrt(1.- f2*f2);
184 Double_t yk = fP0 + dx*(f1+f2)/(r1+r2);
185 Double_t zk = fP1 + dx*(f1+f2)/(f1*r2 + f2*r1)*fP3;
187 Double_t cs=TMath::Cos(fAlpha), sn=TMath::Sin(fAlpha);
195 //_____________________________________________________________________________
196 Double_t AliITStrackV2::GetPredictedChi2(const AliCluster *c) const
198 //-----------------------------------------------------------------
199 // This function calculates a predicted chi2 increment.
200 //-----------------------------------------------------------------
201 Double_t r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2();
202 r00+=fC00; r01+=fC10; r11+=fC11;
204 Double_t det=r00*r11 - r01*r01;
205 if (TMath::Abs(det) < 1.e-30) {
206 Int_t n=GetNumberOfClusters();
208 cerr<<n<<" AliKalmanTrack::GetPredictedChi2: Singular matrix !\n";
211 Double_t tmp=r00; r00=r11; r11=tmp; r01=-r01;
213 Double_t dy=c->GetY() - fP0, dz=c->GetZ() - fP1;
215 return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det;
218 //_____________________________________________________________________________
219 Double_t AliITStrackV2::GetPredictedChi2(const AliCluster *c,Double_t *m,
221 //-----------------------------------------------------------------
222 // This function calculates a chi2 increment with a vertex contraint
223 //-----------------------------------------------------------------
224 TVectorD x(5); x(0)=fP0; x(1)=fP1; x(2)=fP2; x(3)=fP3; x(4)=fP4;
227 C(1,0)=fC10; C(1,1)=fC11;
228 C(2,0)=fC20; C(2,1)=fC21; C(2,2)=fC22;
229 C(3,0)=fC30; C(3,1)=fC31; C(3,2)=fC32; C(3,3)=fC33;
230 C(4,0)=fC40; C(4,1)=fC41; C(4,2)=fC42; C(4,3)=fC43; C(4,4)=fC44;
233 C(0,2)=C(2,0); C(1,2)=C(2,1);
234 C(0,3)=C(3,0); C(1,3)=C(3,1); C(2,3)=C(3,2);
235 C(0,4)=C(4,0); C(1,4)=C(4,1); C(2,4)=C(4,2); C(3,4)=C(4,3);
237 TMatrixD H(4,5); H.UnitMatrix();
238 Double_t dy=(c->GetY() - m[0]), dz=(c->GetZ() - m[1]);
240 Double_t dr=TMath::Sqrt(fX*fX + dy*dy);
241 Double_t r =TMath::Sqrt(4/dr/dr - fP4*fP4);
242 Double_t sn=0.5*(fP4*fX + dy*r);
243 Double_t tg=0.5*fP4*dz/TMath::ASin(0.5*fP4*dr);
245 mm(0)=m[0]=c->GetY(); mm(1)=m[1]=c->GetZ(); mm(2)=m[2]=sn; mm(3)=m[3]=tg;
247 Double_t v22=0.,v33=0.;
250 Double_t pp2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
251 Double_t beta2=pp2/(pp2 + GetMass()*GetMass());
252 x0*=TMath::Sqrt((1.+ GetTgl()*GetTgl())/(1.- GetSnp()*GetSnp()));
253 Double_t theta2=14.1*14.1/(beta2*pp2*1e6)*x0;
254 v22 = theta2*(1.- GetSnp()*GetSnp())*(1. + GetTgl()*GetTgl());
255 v33 = theta2*(1.+ GetTgl()*GetTgl())*(1. + GetTgl()*GetTgl());
257 Double_t sy2=c->GetSigmaY2(), sz2=c->GetSigmaZ2();
258 v22+=kSigmaYV*kSigmaYV/dr/dr;
262 v33+=kSigmaZV*kSigmaZV/dr/dr;
267 V(0,0)=m[4 ]=sy2; V(0,1)=m[5 ]=0.; V(0,2)=m[6 ]=v20; V(0,3)=m[7 ]=0.;
268 V(1,0)=m[8 ]=0.; V(1,1)=m[9 ]=sz2; V(1,2)=m[10]=0.; V(1,3)=m[11]=v31;
269 V(2,0)=m[12]=v20; V(2,1)=m[13]=0.; V(2,2)=m[14]=v22; V(2,3)=m[15]=0.;
270 V(3,0)=m[16]=0.; V(3,1)=m[17]=v31; V(3,2)=m[18]=0.; V(3,3)=m[19]=v33;
272 TVectorD res=x; res*=H; res-=mm; //res*=-1;
273 TMatrixD tmp(H,TMatrixD::kMult,C);
274 TMatrixD R(tmp,TMatrixD::kMult,TMatrixD(TMatrixD::kTransposed,H)); R+=V;
276 Double_t det=R.Determinant();
277 if (TMath::Abs(det) < 1.e-30) {
278 Int_t n=GetNumberOfClusters();
280 cerr<<n<<" AliITStrackV2::GetPredictedChi2: Singular matrix !\n";
291 //____________________________________________________________________________
292 Int_t AliITStrackV2::CorrectForMaterial(Double_t d, Double_t x0) {
293 //------------------------------------------------------------------
294 //This function corrects the track parameters for crossed material
295 //------------------------------------------------------------------
296 Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
297 Double_t beta2=p2/(p2 + GetMass()*GetMass());
298 d*=TMath::Sqrt((1.+ fP3*fP3)/(1.- fP2*fP2));
300 //Multiple scattering******************
302 Double_t theta2=14.1*14.1/(beta2*p2*1e6)*TMath::Abs(d);
303 //Double_t theta2=1.0259e-6*14*14/28/(beta2*p2)*TMath::Abs(d)*9.36*2.33;
304 fC22 += theta2*(1.- fP2*fP2)*(1. + fP3*fP3);
305 fC33 += theta2*(1. + fP3*fP3)*(1. + fP3*fP3);
306 fC43 += theta2*fP3*fP4*(1. + fP3*fP3);
307 fC44 += theta2*fP3*fP4*fP3*fP4;
310 //Energy losses************************
313 Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2)*d;
314 fP4*=(1.- sqrt(p2+GetMass()*GetMass())/p2*dE);
317 if (!Invariant()) return 0;
322 //____________________________________________________________________________
323 Int_t AliITStrackV2::PropagateTo(Double_t xk, Double_t d, Double_t x0) {
324 //------------------------------------------------------------------
325 //This function propagates a track
326 //------------------------------------------------------------------
327 Double_t x1=fX, x2=xk, dx=x2-x1;
328 Double_t f1=fP2, f2=f1 + fP4*dx;
329 if (TMath::Abs(f2) >= 0.9999) {
330 Int_t n=GetNumberOfClusters();
332 cerr<<n<<" AliITStrackV2::PropagateTo: Propagation failed !\n";
336 // old position [SR, GSI, 17.02.2003]
337 Double_t oldX = fX, oldY = fP0, oldZ = fP1;
339 Double_t r1=sqrt(1.- f1*f1), r2=sqrt(1.- f2*f2);
341 fP0 += dx*(f1+f2)/(r1+r2);
342 fP1 += dx*(f1+f2)/(f1*r2 + f2*r1)*fP3;
347 Double_t f02= dx/(r1*r1*r1);
348 Double_t f04=0.5*dx*dx/(r1*r1*r1);
349 Double_t f12= dx*fP3*f1/(r1*r1*r1);
350 Double_t f14=0.5*dx*dx*fP3*f1/(r1*r1*r1);
355 Double_t b00=f02*fC20 + f04*fC40, b01=f12*fC20 + f14*fC40 + f13*fC30;
356 Double_t b02=f24*fC40;
357 Double_t b10=f02*fC21 + f04*fC41, b11=f12*fC21 + f14*fC41 + f13*fC31;
358 Double_t b12=f24*fC41;
359 Double_t b20=f02*fC22 + f04*fC42, b21=f12*fC22 + f14*fC42 + f13*fC32;
360 Double_t b22=f24*fC42;
361 Double_t b40=f02*fC42 + f04*fC44, b41=f12*fC42 + f14*fC44 + f13*fC43;
362 Double_t b42=f24*fC44;
363 Double_t b30=f02*fC32 + f04*fC43, b31=f12*fC32 + f14*fC43 + f13*fC33;
364 Double_t b32=f24*fC43;
367 Double_t a00=f02*b20+f04*b40,a01=f02*b21+f04*b41,a02=f02*b22+f04*b42;
368 Double_t a11=f12*b21+f14*b41+f13*b31,a12=f12*b22+f14*b42+f13*b32;
369 Double_t a22=f24*b42;
371 //F*C*Ft = C + (b + bt + a)
372 fC00 += b00 + b00 + a00;
373 fC10 += b10 + b01 + a01;
374 fC20 += b20 + b02 + a02;
377 fC11 += b11 + b11 + a11;
378 fC21 += b21 + b12 + a12;
381 fC22 += b22 + b22 + a22;
387 if (!CorrectForMaterial(d,x0)) return 0;
389 // Integrated Time [SR, GSI, 17.02.2003]
390 if (IsStartedTimeIntegral()) {
391 Double_t l2 = (fX-oldX)*(fX-oldX)+(fP0-oldY)*(fP0-oldY)+(fP1-oldZ)*(fP1-oldZ);
392 AddTimeStep(TMath::Sqrt(l2));
399 //____________________________________________________________________________
400 Int_t AliITStrackV2::Update(const AliCluster* c, Double_t chi2, UInt_t index) {
401 //------------------------------------------------------------------
402 //This function updates track parameters
403 //------------------------------------------------------------------
404 Double_t p0=fP0,p1=fP1,p2=fP2,p3=fP3,p4=fP4;
406 Double_t c10=fC10, c11=fC11;
407 Double_t c20=fC20, c21=fC21, c22=fC22;
408 Double_t c30=fC30, c31=fC31, c32=fC32, c33=fC33;
409 Double_t c40=fC40, c41=fC41, c42=fC42, c43=fC43, c44=fC44;
412 Double_t r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2();
413 r00+=fC00; r01+=fC10; r11+=fC11;
414 Double_t det=r00*r11 - r01*r01;
415 Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det;
417 Double_t k00=fC00*r00+fC10*r01, k01=fC00*r01+fC10*r11;
418 Double_t k10=fC10*r00+fC11*r01, k11=fC10*r01+fC11*r11;
419 Double_t k20=fC20*r00+fC21*r01, k21=fC20*r01+fC21*r11;
420 Double_t k30=fC30*r00+fC31*r01, k31=fC30*r01+fC31*r11;
421 Double_t k40=fC40*r00+fC41*r01, k41=fC40*r01+fC41*r11;
423 Double_t dy=c->GetY() - fP0, dz=c->GetZ() - fP1;
424 Double_t sf=fP2 + k20*dy + k21*dz;
426 fP0 += k00*dy + k01*dz;
427 fP1 += k10*dy + k11*dz;
429 fP3 += k30*dy + k31*dz;
430 fP4 += k40*dy + k41*dz;
432 Double_t c01=fC10, c02=fC20, c03=fC30, c04=fC40;
433 Double_t c12=fC21, c13=fC31, c14=fC41;
435 fC00-=k00*fC00+k01*fC10; fC10-=k00*c01+k01*fC11;
436 fC20-=k00*c02+k01*c12; fC30-=k00*c03+k01*c13;
437 fC40-=k00*c04+k01*c14;
439 fC11-=k10*c01+k11*fC11;
440 fC21-=k10*c02+k11*c12; fC31-=k10*c03+k11*c13;
441 fC41-=k10*c04+k11*c14;
443 fC22-=k20*c02+k21*c12; fC32-=k20*c03+k21*c13;
444 fC42-=k20*c04+k21*c14;
446 fC33-=k30*c03+k31*c13;
447 fC43-=k30*c04+k31*c14;
449 fC44-=k40*c04+k41*c14;
452 fP0=p0; fP1=p1; fP2=p2; fP3=p3; fP4=p4;
455 fC20=c20; fC21=c21; fC22=c22;
456 fC30=c30; fC31=c31; fC32=c32; fC33=c33;
457 fC40=c40; fC41=c41; fC42=c42; fC43=c43; fC44=c44;
461 Int_t n=GetNumberOfClusters();
463 SetNumberOfClusters(n+1);
464 SetChi2(GetChi2()+chi2);
469 Int_t AliITStrackV2::Invariant() const {
470 //------------------------------------------------------------------
471 // This function is for debugging purpose only
472 //------------------------------------------------------------------
473 Int_t n=GetNumberOfClusters();
475 if (TMath::Abs(fP2)>=0.9999){
476 if (n>kWARN) cout<<"AliITStrackV2::Invariant : fP2="<<fP2<<endl;
479 if (fC00<=0 || fC00>9.) {
480 if (n>kWARN) cout<<"AliITStrackV2::Invariant : fC00="<<fC00<<endl;
483 if (fC11<=0 || fC11>9.) {
484 if (n>kWARN) cout<<"AliITStrackV2::Invariant : fC11="<<fC11<<endl;
487 if (fC22<=0 || fC22>1.) {
488 if (n>kWARN) cout<<"AliITStrackV2::Invariant : fC22="<<fC22<<endl;
491 if (fC33<=0 || fC33>1.) {
492 if (n>kWARN) cout<<"AliITStrackV2::Invariant : fC33="<<fC33<<endl;
495 if (fC44<=0 || fC44>6e-5) {
496 if (n>kWARN) cout<<"AliITStrackV2::Invariant : fC44="<<fC44<<endl;
502 //____________________________________________________________________________
503 Int_t AliITStrackV2::Propagate(Double_t alp,Double_t xk) {
504 //------------------------------------------------------------------
505 //This function propagates a track
506 //------------------------------------------------------------------
507 Double_t alpha=fAlpha, x=fX;
508 Double_t p0=fP0,p1=fP1,p2=fP2,p3=fP3,p4=fP4;
510 Double_t c10=fC10, c11=fC11;
511 Double_t c20=fC20, c21=fC21, c22=fC22;
512 Double_t c30=fC30, c31=fC31, c32=fC32, c33=fC33;
513 Double_t c40=fC40, c41=fC41, c42=fC42, c43=fC43, c44=fC44;
515 if (alp < -TMath::Pi()) alp += 2*TMath::Pi();
516 else if (alp >= TMath::Pi()) alp -= 2*TMath::Pi();
517 Double_t ca=TMath::Cos(alp-fAlpha), sa=TMath::Sin(alp-fAlpha);
518 Double_t sf=fP2, cf=TMath::Sqrt(1.- fP2*fP2);
521 // **** rotation **********************
530 C(1,0)=c10; C(1,1)=c11;
531 C(2,0)=c20; C(2,1)=c21; C(2,2)=c22;
532 C(3,0)=c30; C(3,1)=c31; C(3,2)=c32; C(3,3)=c33;
533 C(4,0)=c40; C(4,1)=c41; C(4,2)=c42; C(4,3)=c43; C(4,4)=c44;
535 C(0,2)=C(2,0); C(1,2)=C(2,1);
536 C(0,3)=C(3,0); C(1,3)=C(3,1); C(2,3)=C(3,2);
537 C(0,4)=C(4,0); C(1,4)=C(4,1); C(2,4)=C(4,2); C(3,4)=C(4,3);
542 F(2,1)=F(4,3)=F(5,4)=1;
543 F(3,2)=ca + sf/cf*sa;
545 TMatrixD tmp(C,TMatrixD::kMult,TMatrixD(TMatrixD::kTransposed, F));
546 T=new TMatrixD(F,TMatrixD::kMult,tmp);
549 // **** translation ******************
552 Double_t f1=fP2, f2=f1 + fP4*dx;
553 if (TMath::Abs(f2) >= 0.9999) {
554 Int_t n=GetNumberOfClusters();
556 cerr<<n<<" AliITStrackV2::Propagate: Propagation failed !\n";
559 Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
562 fP0 += dx*(f1+f2)/(r1+r2);
563 fP1 += dx*(f1+f2)/(f1*r2 + f2*r1)*fP3;
567 F(0,1)=F(1,2)=F(2,3)=F(3,4)=F(4,5)=1;
568 F(0,3)=dx/(r1+r2)*(2+(f1+f2)*(f2/r2+f1/r1)/(r1+r2));
569 F(0,5)=dx*dx/(r1+r2)*(1+(f1+f2)*f2/(r1+r2));
570 F(1,3)=dx*fP3/(f1*r2 + f2*r1)*(2-(f1+f2)*(r2-f1*f2/r2+r1-f2*f1/r1)/(f1*r2 + f2*r1));
571 F(1,4)=dx*(f1+f2)/(f1*r2 + f2*r1);
572 F(1,5)=dx*dx*fP3/(f1*r2 + f2*r1)*(1-(f1+f2)*(-f1*f2/r2+r1)/(f1*r2 + f2*r1));
574 F(0,0)=-1/(r1+r2)*((f1+f2)+dx*fP4*(1+(f1+f2)/(r1+r2)*f2/r2));
575 F(1,0)=-fP3/(f1*r2 + f2*r1)*((f1+f2)+dx*fP4*(1+(f1+f2)/(f1*r2 + f2*r1)*(f1*f2/r2-r1)));
578 TMatrixD tmp(*T,TMatrixD::kMult,TMatrixD(TMatrixD::kTransposed, F));
580 TMatrixD C(F,TMatrixD::kMult,tmp);
583 fC10=C(1,0); fC11=C(1,1);
584 fC20=C(2,0); fC21=C(2,1); fC22=C(2,2);
585 fC30=C(3,0); fC31=C(3,1); fC32=C(3,2); fC33=C(3,3);
586 fC40=C(4,0); fC41=C(4,1); fC42=C(4,2); fC43=C(4,3); fC44=C(4,4);
591 fP0=p0; fP1=p1; fP2=p2; fP3=p3; fP4=p4;
594 fC20=c20; fC21=c21; fC22=c22;
595 fC30=c30; fC31=c31; fC32=c32; fC33=c33;
596 fC40=c40; fC41=c41; fC42=c42; fC43=c43; fC44=c44;
604 Double_t AliITStrackV2::GetD(Double_t x, Double_t y) const {
605 //------------------------------------------------------------------
606 // This function calculates the transverse impact parameter
607 // with respect to a point with global coordinates (x,y)
608 //------------------------------------------------------------------
609 Double_t xt=fX, yt=fP0;
611 Double_t sn=TMath::Sin(fAlpha), cs=TMath::Cos(fAlpha);
612 Double_t a = x*cs + y*sn;
613 y = -x*sn + y*cs; x=a;
616 sn=fP4*xt - fP2; cs=fP4*yt + TMath::Sqrt(1.- fP2*fP2);
617 a=2*(xt*fP2 - yt*TMath::Sqrt(1.- fP2*fP2))-fP4*(xt*xt + yt*yt);
619 return a/(1 + TMath::Sqrt(sn*sn + cs*cs));
622 Int_t AliITStrackV2::Improve(Double_t x0,Double_t yv,Double_t zv) {
623 //------------------------------------------------------------------
624 //This function improves angular track parameters
625 //------------------------------------------------------------------
626 Double_t dy=fP0-yv, dz=fP1-zv;
627 Double_t r2=fX*fX+dy*dy;
628 Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
629 Double_t beta2=p2/(p2 + GetMass()*GetMass());
630 x0*=TMath::Sqrt((1.+ GetTgl()*GetTgl())/(1.- GetSnp()*GetSnp()));
631 //Double_t theta2=14.1*14.1/(beta2*p2*1e6)*x0;
632 Double_t theta2=1.0259e-6*14*14/28/(beta2*p2)*x0*9.36*2.33;
634 Double_t parp=0.5*(fP4*fX + dy*TMath::Sqrt(4/r2-fP4*fP4));
635 Double_t sigma2p = theta2*(1.- GetSnp()*GetSnp())*(1. + GetTgl()*GetTgl());
636 sigma2p += fC00/r2*(1.- dy*dy/r2)*(1.- dy*dy/r2);
637 sigma2p += kSigmaYV*kSigmaYV/r2;
638 sigma2p += 0.25*fC44*fX*fX;
639 Double_t eps2p=sigma2p/(fC22+sigma2p);
640 fP0 += fC20/(fC22+sigma2p)*(parp-fP2);
641 fP2 = eps2p*fP2 + (1-eps2p)*parp;
646 Double_t parl=0.5*fP4*dz/TMath::ASin(0.5*fP4*TMath::Sqrt(r2));
647 Double_t sigma2l=theta2;
648 sigma2l += fC11/r2+fC00*dy*dy*dz*dz/(r2*r2*r2);
649 sigma2l += kSigmaZV*kSigmaZV/r2;
650 Double_t eps2l=sigma2l/(fC33+sigma2l);
651 fP1 += fC31/(fC33+sigma2l)*(parl-fP3);
652 fP4 += fC43/(fC33+sigma2l)*(parl-fP3);
653 fP3 = eps2l*fP3 + (1-eps2l)*parl;
654 fC33 *= eps2l; fC43 *= eps2l;
657 if (!Invariant()) return 0;
662 Int_t AliITStrackV2::Improve(Double_t x0,Double_t yv,Double_t zv) {
663 //------------------------------------------------------------------
664 //This function improves angular track parameters
665 //------------------------------------------------------------------
666 Double_t dy=fP0-yv, dz=fP1-zv;
667 Double_t r2=fX*fX+dy*dy;
668 Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
669 Double_t beta2=p2/(p2 + GetMass()*GetMass());
670 x0*=TMath::Sqrt((1.+ GetTgl()*GetTgl())/(1.- GetSnp()*GetSnp()));
671 //Double_t theta2=14.1*14.1/(beta2*p2*1e6)*x0;
672 Double_t theta2=1.0259e-6*14*14/28/(beta2*p2)*x0*9.36*2.33;
674 Double_t par=0.5*(fP4*fX + dy*TMath::Sqrt(4/r2-fP4*fP4));
675 Double_t sigma2 = theta2*(1.- GetSnp()*GetSnp())*(1. + GetTgl()*GetTgl());
676 sigma2 += fC00/r2*(1.- dy*dy/r2)*(1.- dy*dy/r2);
677 sigma2 += kSigmaYV*kSigmaYV/r2;
678 sigma2 += 0.25*fC44*fX*fX;
679 Double_t eps2=sigma2/(fC22+sigma2), eps=TMath::Sqrt(eps2);
680 if (10*r2*fC44<fC22) {
681 fP2 = eps2*fP2 + (1-eps2)*par;
682 fC22*=eps2; fC21*=eps; fC20*=eps; fC32*=eps; fC42*=eps;
685 par=0.5*fP4*dz/TMath::ASin(0.5*fP4*TMath::Sqrt(r2));
687 sigma2 += fC11/r2+fC00*dy*dy*dz*dz/(r2*r2*r2);
688 sigma2 += kSigmaZV*kSigmaZV/r2;
689 eps2=sigma2/(fC33+sigma2); eps=TMath::Sqrt(eps2);
691 fP3 = eps2*fP3 + (1-eps2)*par;
692 fC33*=eps2; fC32*=eps; fC31*=eps; fC30*=eps; fC43*=eps;
694 eps=TMath::Sqrt((1+fP3*fP3)/(1+tgl*tgl));
696 fC44*=eps*eps; fC43*=eps;fC42*=eps; fC41*=eps; fC40*=eps;
698 if (!Invariant()) return 0;
702 void AliITStrackV2::ResetCovariance() {
703 //------------------------------------------------------------------
704 //This function makes a track forget its history :)
705 //------------------------------------------------------------------
709 fC20=0.; fC21=0.; fC22*=10.;
710 fC30=0.; fC31=0.; fC32=0.; fC33*=10.;
711 fC40=0.; fC41=0.; fC42=0.; fC43=0.; fC44*=10.;
715 void AliITStrackV2::CookdEdx(Double_t low, Double_t up) {
716 //-----------------------------------------------------------------
717 // This function calculates dE/dX within the "low" and "up" cuts.
718 // Origin: Boris Batyunya, JINR, Boris.Batiounia@cern.ch
719 //-----------------------------------------------------------------
722 // The clusters order is: SSD-2, SSD-1, SDD-2, SDD-1, SPD-2, SPD-1
723 // Take only SSD and SDD
725 Int_t swap;//stupid sorting
728 for (i=0; i<nc-1; i++) {
729 if (fdEdxSample[i]<=fdEdxSample[i+1]) continue;
730 Float_t tmp=fdEdxSample[i];
731 fdEdxSample[i]=fdEdxSample[i+1]; fdEdxSample[i+1]=tmp;
736 Int_t nl=Int_t(low*nc), nu=Int_t(up*nc); //b.b. to take two lowest dEdX
737 // values from four ones choose
740 for (i=nl; i<nu; i++) dedx += fdEdxSample[i];