]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackV2.cxx
Example macro for the creation of tags (P.Christakoglou)
[u/mrichter/AliRoot.git] / ITS / AliITStrackV2.cxx
index 86df5a7da4c45e1c522ff718f9982e1823dcc114..5b2ba581368e00b098f5e4b3640d61966749929e 100644 (file)
@@ -83,11 +83,11 @@ AliKalmanTrack() {
   Double_t x,p[5]; 
   if (c) t.GetConstrainedExternalParameters(x,p);
   else t.GetExternalParameters(x,p);
-  fX=x;    x=GetConvConst();
+  fX=x;   
   fP0=p[0]; 
-  fP1=p[1]; 
+  fP1=p[1];   SaveLocalConvConst(); 
   fP2=p[2];
-  fP3=p[3];
+  fP3=p[3];   x=GetLocalConvConst();
   fP4=p[4]/x; 
 
   //Conversion of the covariance matrix
@@ -107,7 +107,8 @@ AliKalmanTrack() {
   }
   fESDtrack=&t;
 
-  if (!Invariant()) throw "AliITStrackV2: conversion failed !\n";
+  //  if (!Invariant()) throw "AliITStrackV2: conversion failed !\n";
+  for(Int_t i=0; i<4; i++) fdEdxSample[i]=0;
 }
 
 void AliITStrackV2::UpdateESDtrack(ULong_t flags) const {
@@ -163,7 +164,7 @@ void AliITStrackV2::GetExternalCovariance(Double_t cc[15]) const {
   // This function returns an external representation of the covriance matrix.
   //   (See comments in AliTPCtrack.h about external track representation)
   //-------------------------------------------------------------------------
-  Double_t a=GetConvConst();
+  Double_t a=GetLocalConvConst();
 
   cc[0 ]=fC00;
   cc[1 ]=fC10;   cc[2 ]=fC11;
@@ -276,12 +277,15 @@ Int_t AliITStrackV2::PropagateTo(Double_t xk, Double_t d, Double_t x0) {
   //------------------------------------------------------------------
   Double_t x1=fX, x2=xk, dx=x2-x1;
   Double_t f1=fP2, f2=f1 + fP4*dx;
-  if (TMath::Abs(f2) >= 0.9999) {
-    Int_t n=GetNumberOfClusters();
-    if (n>kWARN) 
-       Warning("PropagateTo","Propagation failed !\n",n);
+  if (TMath::Abs(f2) >= 0.98) {
+    // MI change  - don't propagate highly inclined tracks
+    //              covariance matrix distorted
+    //Int_t n=GetNumberOfClusters();
+    //if (n>kWARN) 
+    //   Warning("PropagateTo","Propagation failed !\n",n);
     return 0;
   }
+  Double_t lcc=GetLocalConvConst();  
 
   // old position [SR, GSI, 17.02.2003]
   Double_t oldX = fX, oldY = fP0, oldZ = fP1;
@@ -334,6 +338,10 @@ Int_t AliITStrackV2::PropagateTo(Double_t xk, Double_t d, Double_t x0) {
 
   fX=x2;
 
+  //Change of the magnetic field *************
+  SaveLocalConvConst();
+  fP4*=lcc/GetLocalConvConst();
+
   if (!CorrectForMaterial(d,x0)) return 0;
 
   // Integrated Time [SR, GSI, 17.02.2003]
@@ -502,19 +510,28 @@ Int_t AliITStrackV2::Propagate(Double_t alp,Double_t xk) {
   {
   Double_t dx=xk-fX;
   Double_t f1=fP2, f2=f1 + fP4*dx;
-  if (TMath::Abs(f2) >= 0.9999) {
-    Int_t n=GetNumberOfClusters();
-    if (n>kWARN) 
-       Warning("Propagate","Propagation failed (%d) !\n",n);
+  if (TMath::Abs(f2) >= 0.98) {
+    // don't propagate highly inclined tracks MI
     return 0;
   }
+  //    Int_t n=GetNumberOfClusters();
+  //  if (n>kWARN) 
+  //     Warning("Propagate","Propagation failed (%d) !\n",n);
+  //  return 0;
+  //}
+  Double_t lcc=GetLocalConvConst();  
+
   Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
-  
+
   fX=xk;
   fP0 += dx*(f1+f2)/(r1+r2);
   fP1 += dx*(f1+f2)/(f1*r2 + f2*r1)*fP3;
   fP2 += dx*fP4;
 
+  //Change of the magnetic field *************
+  SaveLocalConvConst();
+  fP4*=lcc/GetLocalConvConst();
+
   //f = F - 1
   
   Double_t f02=    dx/(r1*r1*r1);
@@ -624,7 +641,9 @@ Int_t AliITStrackV2::Improve(Double_t x0,Double_t xyz[3],Double_t ers[3]) {
   Double_t theta2=14.1*14.1/(beta2*p2*1e6)*x0;
   //Double_t theta2=1.0259e-6*14*14/28/(beta2*p2)*x0*9.36*2.33;
   {
-  Double_t parp=0.5*(fP4*fX + dy*TMath::Sqrt(4/r2-fP4*fP4));
+  Double_t dummy=4/r2-fP4*fP4;
+  if (dummy < 0) return 0;
+  Double_t parp=0.5*(fP4*fX + dy*TMath::Sqrt(dummy));
   Double_t sigma2p = theta2*(1.- GetSnp()*GetSnp())*(1. + GetTgl()*GetTgl());
   sigma2p += fC00/r2*(1.- dy*dy/r2)*(1.- dy*dy/r2);
   sigma2p += ers[1]*ers[1]/r2;