]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrack.cxx
Added a prototection to prevent deleting the run loader in case the getter is inoked...
[u/mrichter/AliRoot.git] / TRD / AliTRDtrack.cxx
index 11c52b1766546c4b725d2a34833e8c43a8c45e2a..5f3371561f783a948306421c9e898ad5364472ea 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.8.8.4  2003/07/10 17:09:52  hristov
-Merging to v3-10-00
-
-Revision 1.20  2003/05/27 17:46:13  hristov
-TRD PID included in the ESD schema (T.Kuhr)
-
-Revision 1.19  2003/05/22 10:46:46  hristov
-Using access methods instead of data members
-
-Revision 1.18  2003/04/10 10:36:54  hristov
-Code for unified TPC/TRD tracking (S.Radomski)
-
-Revision 1.17  2003/02/19 09:02:28  hristov
-Track time measurement (S.Radomski)
-
-Revision 1.16  2003/02/10 14:06:10  cblume
-Add tracking without tilted pads as option
-
-Revision 1.15  2003/01/27 16:34:49  cblume
-Update of tracking by Sergei and Chuncheng
-
-Revision 1.14  2002/11/07 15:52:09  cblume
-Update of tracking code for tilted pads
-
-Revision 1.13  2002/10/22 15:53:08  alibrary
-Introducing Riostream.h
-
-Revision 1.12  2002/10/14 14:57:44  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.8.10.2  2002/07/24 10:09:31  alibrary
-Updating VirtualMC
-
-RRevision 1.11  2002/06/13 12:09:58  hristov
-Minor corrections
-
-Revision 1.10  2002/06/12 09:54:35  cblume
-Update of tracking code provided by Sergei
-
-Revision 1.8  2001/05/30 12:17:47  hristov
-Loop variables declared once
-
-Revision 1.7  2001/05/28 17:07:58  hristov
-Last minute changes; ExB correction in AliTRDclusterizerV1; taking into account of material in G10 TEC frames and material between TEC planes (C.Blume,S.Sedykh)
-
-Revision 1.4  2000/12/08 16:07:02  cblume
-Update of the tracking by Sergei
-
-Revision 1.3  2000/10/15 23:40:01  cblume
-Remove AliTRDconst
-
-Revision 1.2  2000/10/06 16:49:46  cblume
-Made Getters const
-
-Revision 1.1.2.1  2000/09/22 14:47:52  cblume
-Add the tracking code
-
-*/                                                        
+/* $Id$ */
 
 #include <Riostream.h>
 #include <TObject.h>   
@@ -82,11 +23,10 @@ Add the tracking code
 #include "AliTRDtrack.h"
 #include "../TPC/AliTPCtrack.h" 
 #include "AliESDtrack.h" 
-
+#include "AliTRDclusterCorrection.h"
 
 ClassImp(AliTRDtrack)
 
-
 //_____________________________________________________________________________
 
 AliTRDtrack::AliTRDtrack(const AliTRDcluster *c, UInt_t index, 
@@ -120,7 +60,7 @@ AliTRDtrack::AliTRDtrack(const AliTRDcluster *c, UInt_t index,
   fLhElectron = 0.0;
   fNWrong = 0;
   fNRotate = 0;
-
+  fStopped = 0;
   Double_t q = TMath::Abs(c->GetQ());
   Double_t s = fX*fC - fE, t=fT;
   if(s*s < 1) q *= TMath::Sqrt((1-s*s)/(1+t*t));
@@ -128,9 +68,10 @@ AliTRDtrack::AliTRDtrack(const AliTRDcluster *c, UInt_t index,
   fdQdl[0] = q;
   
   // initialisation [SR, GSI 18.02.2003] (i startd for 1)
-  for(Int_t i=1; i<kMAX_CLUSTERS_PER_TRACK; i++) {
+  for(UInt_t i=1; i<kMAX_CLUSTERS_PER_TRACK; i++) {
     fdQdl[i] = 0;
     fIndex[i] = 0;
+    fIndexBackup[i] = 0;  //bacup indexes MI    
   }
 }                              
            
@@ -149,7 +90,7 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack& t) : AliKalmanTrack(t) {
   fLhElectron = 0.0;
   fNWrong = t.fNWrong;
   fNRotate = t.fNRotate;
-
+  fStopped = t.fStopped;
   fAlpha=t.fAlpha;
   fX=t.fX;
 
@@ -165,13 +106,15 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack& t) : AliKalmanTrack(t) {
   SetNumberOfClusters(n);
   for (Int_t i=0; i<n; i++) {
     fIndex[i]=t.fIndex[i];
+    fIndexBackup[i]=t.fIndex[i];  // MI - backup indexes
     fdQdl[i]=t.fdQdl[i];
   }
 
   // initialisation (i starts from n) [SR, GSI, 18.02.2003]
-  for(Int_t i=n; i<kMAX_CLUSTERS_PER_TRACK; i++) {
+  for(UInt_t i=n; i<kMAX_CLUSTERS_PER_TRACK; i++) {
     fdQdl[i] = 0;
     fIndex[i] = 0;
+    fIndexBackup[i] = 0;  //MI backup indexes
   }
 }                                
 
@@ -192,6 +135,7 @@ AliTRDtrack::AliTRDtrack(const AliKalmanTrack& t, Double_t alpha)
   fLhElectron = 0.0;
   fNWrong = 0;
   fNRotate = 0;
+  fStopped = 0;
 
   fAlpha = alpha;
   if      (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
@@ -225,9 +169,10 @@ AliTRDtrack::AliTRDtrack(const AliKalmanTrack& t, Double_t alpha)
   fCcy=c[10];   fCcz=c[11];   fCce=c42;   fCct=c[13]; fCcc=c[14];  
 
   // Initialization [SR, GSI, 18.02.2003]
-  for(Int_t i=0; i<kMAX_CLUSTERS_PER_TRACK; i++) {
+  for(UInt_t i=0; i<kMAX_CLUSTERS_PER_TRACK; i++) {
     fdQdl[i] = 0;
     fIndex[i] = 0;
+    fIndexBackup[i] = 0;  // MI backup indexes    
   }
 }              
 //_____________________________________________________________________________
@@ -240,13 +185,17 @@ AliTRDtrack::AliTRDtrack(const AliESDtrack& t)
   SetLabel(t.GetLabel());
   SetChi2(0.);
   SetMass(t.GetMass());
-  SetNumberOfClusters(0); 
-  // WARNING: cluster indices are NOT copied !!!
-
+  SetNumberOfClusters(t.GetTRDclusters(fIndex)); 
+  Int_t ncl = t.GetTRDclusters(fIndexBackup);
+  for (UInt_t i=ncl;i<kMAX_CLUSTERS_PER_TRACK;i++) {
+    fIndexBackup[i]=0;
+    fIndex[i] = 0; //MI store indexes
+  }
   fdEdx=0;
 
   fLhElectron = 0.0;
   fNWrong = 0;
+  fStopped = 0;
   fNRotate = 0;
 
   fAlpha = t.GetAlpha();
@@ -281,10 +230,16 @@ AliTRDtrack::AliTRDtrack(const AliESDtrack& t)
   fCcy=c[10];   fCcz=c[11];   fCce=c42;   fCct=c[13]; fCcc=c[14];  
 
   // Initialization [SR, GSI, 18.02.2003]
-  for(Int_t i=0; i<kMAX_CLUSTERS_PER_TRACK; i++) {
+  for(UInt_t i=0; i<kMAX_CLUSTERS_PER_TRACK; i++) {
     fdQdl[i] = 0;
-    fIndex[i] = 0;
+    //    fIndex[i] = 0; //MI store indexes
   }
+
+  if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
+  StartTimeIntegral();
+  Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
+  SetIntegratedLength(t.GetIntegratedLength());
+
 }              
 //_____________________________________________________________________________
 
@@ -418,10 +373,10 @@ Int_t AliTRDtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
 
   if (xk == fX) return 1;
 
-  if (TMath::Abs(fC*xk - fE) >= 0.99999) {
-    Int_t n=GetNumberOfClusters();
-    if (n>4) cerr << n << " AliTRDtrack: Propagation failed, \tPt = " 
-                  << GetPt() << "\t" << GetLabel() << "\t" << GetMass() << endl;
+  if (TMath::Abs(fC*xk - fE) >= 0.90000) {
+    //    Int_t n=GetNumberOfClusters();
+    //if (n>4) cerr << n << " AliTRDtrack: Propagation failed, \tPt = " 
+    //              << GetPt() << "\t" << GetLabel() << "\t" << GetMass() << endl;
     return 0;
   }
 
@@ -479,14 +434,27 @@ Int_t AliTRDtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
 
   Double_t ey=fC*fX - fE, ez=fT;
   Double_t xz=fC*ez, zz1=ez*ez+1, xy=fE+ey;
-
+  
   fCee += (2*ey*ez*ez*fE+1-ey*ey+ez*ez+fE*fE*ez*ez)*theta2;
   fCte += ez*zz1*xy*theta2;
   fCtt += zz1*zz1*theta2;
   fCce += xz*ez*xy*theta2;
   fCct += xz*zz1*theta2;
   fCcc += xz*xz*theta2;
-
+  /*
+  Double_t dc22 = (1-ey*ey+xz*xz*fX*fX)*theta2;
+  Double_t dc32 = (xz*fX*zz1)*theta2;
+  Double_t dc33 = (zz1*zz1)*theta2;
+  Double_t dc42 = (xz*fX*xz)*theta2;
+  Double_t dc43 = (zz1*xz)*theta2;
+  Double_t dc44 = (xz*xz)*theta2; 
+  fCee += dc22;
+  fCte += dc32;
+  fCtt += dc33;
+  fCce += dc42;
+  fCct += dc43;
+  fCcc += dc44;
+  */
   //Energy losses************************
   if((5940*beta2/(1-beta2+1e-10) - beta2) < 0) return 0;
 
@@ -497,6 +465,7 @@ Int_t AliTRDtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
   fE+=fX*(fC-cc);    
 
   // track time measurement [SR, GSI 17.02.2002]
+  if (x1 < x2)
   if (IsStartedTimeIntegral()) {
     Double_t l2 = (fX-oldX)*(fX-oldX) + (fY-oldY)*(fY-oldY) + (fZ-oldZ)*(fZ-oldZ);
     AddTimeStep(TMath::Sqrt(l2));
@@ -513,8 +482,15 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
 
   Bool_t fNoTilt = kTRUE;
   if(TMath::Abs(h01) > 0.003) fNoTilt = kFALSE;
+  // add angular effect to the error contribution -  MI
+  Float_t tangent2 = (fC*fX-fE)*(fC*fX-fE);
+  if (tangent2 < 0.90000){
+    tangent2 = tangent2/(1.-tangent2);
+  }
+  Float_t errang = tangent2*0.04; //
+  Float_t padlength = TMath::Sqrt(c->GetSigmaZ2()*12.);
 
-  Double_t r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2();
+  Double_t r00=c->GetSigmaY2() +errang, r01=0., r11=c->GetSigmaZ2()*100.;
   r00+=fCyy; r01+=fCzy; r11+=fCzz;
   Double_t det=r00*r11 - r01*r01;
   Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det;
@@ -528,13 +504,11 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
   Double_t dy=c->GetY() - fY, dz=c->GetZ() - fZ;
   Double_t cur=fC + k40*dy + k41*dz, eta=fE + k20*dy + k21*dz;
 
-  Double_t c01=fCzy, c02=fCey, c03=fCty, c04=fCcy;
-  Double_t c12=fCez, c13=fCtz, c14=fCcz;
 
   if(fNoTilt) {
-    if (TMath::Abs(cur*fX-eta) >= 0.99999) {
-      Int_t n=GetNumberOfClusters();
-      if (n>4) cerr<<n<<" AliTRDtrack warning: Filtering failed !\n";
+    if (TMath::Abs(cur*fX-eta) >= 0.90000) {
+      //      Int_t n=GetNumberOfClusters();
+      //if (n>4) cerr<<n<<" AliTRDtrack warning: Filtering failed !\n";
       return 0;
     }
     fY += k00*dy + k01*dz;
@@ -546,8 +520,22 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
   else {
     Double_t xu_factor = 100.;  // empirical factor set by C.Xu
                                 // in the first tilt version      
-    r00=c->GetSigmaY2(), r01=0., r11=c->GetSigmaZ2()*xu_factor; 
+    dy=c->GetY() - fY; dz=c->GetZ() - fZ;     
+    dy=dy+h01*dz;
+    Float_t add=0;
+    if (TMath::Abs(dz)>padlength/2.){
+      Float_t dy2 = c->GetY() - fY;
+      Float_t sign = (dz>0) ? -1.: 1.;
+      dy2+=h01*sign*padlength/2.;      
+      dy  = dy2;
+      add = 0;
+    }
+   
+
+
+    r00=c->GetSigmaY2()+errang+add, r01=0., r11=c->GetSigmaZ2()*xu_factor; 
     r00+=(fCyy+2.0*h01*fCzy+h01*h01*fCzz);
+
     r01+=(fCzy+h01*fCzz);  
     det=r00*r11 - r01*r01;
     tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det;
@@ -558,19 +546,17 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
     k30=fCty*r00+fCtz*(r01+h01*r00),k31=fCty*r01+fCtz*(r11+h01*r01);
     k40=fCcy*r00+fCcz*(r01+h01*r00),k41=fCcy*r01+fCcz*(r11+h01*r01);  
 
-    dy=c->GetY() - fY; dz=c->GetZ() - fZ; 
-    dy=dy+h01*dz;
 
     cur=fC + k40*dy + k41*dz; eta=fE + k20*dy + k21*dz;
-    if (TMath::Abs(cur*fX-eta) >= 0.99999) {
-      Int_t n=GetNumberOfClusters();
-      if (n>4) cerr<<n<<" AliTRDtrack warning: Filtering failed !\n";
+    if (TMath::Abs(cur*fX-eta) >= 0.90000) {
+      //      Int_t n=GetNumberOfClusters();
+      //if (n>4) cerr<<n<<" AliTRDtrack warning: Filtering failed !\n";
       return 0;
     }                           
     fY += k00*dy + k01*dz;
     fZ += k10*dy + k11*dz;
     fE  = eta;
-    //fT += k30*dy + k31*dz;
+    fT += k30*dy + k31*dz;
     fC  = cur;
     
     k01+=h01*k00;
@@ -578,7 +564,11 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
     k21+=h01*k20;
     k31+=h01*k30;
     k41+=h01*k40;  
+    
   }
+  Double_t c01=fCzy, c02=fCey, c03=fCty, c04=fCcy;
+  Double_t c12=fCez, c13=fCtz, c14=fCcz;
+
 
   fCyy-=k00*fCyy+k01*fCzy; fCzy-=k00*c01+k01*fCzz;
   fCey-=k00*c02+k01*c12;   fCty-=k00*c03+k01*c13;
@@ -592,7 +582,8 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
   fCce-=k20*c04+k21*c14;
   
   fCtt-=k30*c03+k31*c13;
-  fCct-=k40*c03+k41*c13;
+  fCct-=k40*c03+k41*c13;  
+  //fCct-=k30*c04+k31*c14;  // symmetric formula MI  
   
   fCcc-=k40*c04+k41*c14;                 
 
@@ -605,6 +596,155 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index,
 
   return 1;     
 }                     
+//_____________________________________________________________________________
+Int_t AliTRDtrack::UpdateMI(const AliTRDcluster *c, Double_t chisq, UInt_t index, Double_t h01, 
+                           Int_t plane)
+{
+  // Assignes found cluster to the track and updates track information
+
+  Bool_t fNoTilt = kTRUE;
+  if(TMath::Abs(h01) > 0.003) fNoTilt = kFALSE;
+  // add angular effect to the error contribution and make correction  -  MI
+  AliTRDclusterCorrection *corrector = AliTRDclusterCorrection::GetCorrection();
+  // 
+  Double_t tangent2 = (fC*fX-fE)*(fC*fX-fE);
+  if (tangent2 < 0.90000){
+    tangent2 = tangent2/(1.-tangent2);
+  }
+  Double_t tangent = TMath::Sqrt(tangent2);
+  if ((fC*fX-fE)<0) tangent*=-1;
+  Double_t correction = 0;
+  Double_t errang = tangent2*0.04; //
+  if (corrector!=0){
+  //if (0){
+    correction = corrector->GetCorrection(plane,c->GetLocalTimeBin(),tangent);
+    if (TMath::Abs(correction)>0){
+      //if we have info 
+      errang     = corrector->GetSigma(plane,c->GetLocalTimeBin(),tangent);
+      errang    *= errang;      
+      errang    += tangent2*0.04;
+    }
+  }
+
+  //
+  Double_t padlength = TMath::Sqrt(c->GetSigmaZ2()*12.);
+
+  Double_t r00=c->GetSigmaY2() +errang, r01=0., r11=c->GetSigmaZ2()*10000.;
+  r00+=fCyy; r01+=fCzy; r11+=fCzz;
+  Double_t det=r00*r11 - r01*r01;
+  Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det;
+
+  Double_t k00=fCyy*r00+fCzy*r01, k01=fCyy*r01+fCzy*r11;
+  Double_t k10=fCzy*r00+fCzz*r01, k11=fCzy*r01+fCzz*r11;
+  Double_t k20=fCey*r00+fCez*r01, k21=fCey*r01+fCez*r11;
+  Double_t k30=fCty*r00+fCtz*r01, k31=fCty*r01+fCtz*r11;
+  Double_t k40=fCcy*r00+fCcz*r01, k41=fCcy*r01+fCcz*r11;
+
+  Double_t dy=c->GetY() - fY, dz=c->GetZ() - fZ;
+  Double_t cur=fC + k40*dy + k41*dz, eta=fE + k20*dy + k21*dz;
+
+
+  if(fNoTilt) {
+    if (TMath::Abs(cur*fX-eta) >= 0.90000) {
+      //      Int_t n=GetNumberOfClusters();
+      //if (n>4) cerr<<n<<" AliTRDtrack warning: Filtering failed !\n";
+      return 0;
+    }
+    fY += k00*dy + k01*dz;
+    fZ += k10*dy + k11*dz;
+    fE  = eta;
+    //fT += k30*dy + k31*dz;
+    fC  = cur;
+  }
+  else {
+    Double_t xu_factor = 1000.;  // empirical factor set by C.Xu
+                                // in the first tilt version      
+    dy=c->GetY() - fY; dz=c->GetZ() - fZ;     
+    dy=dy+h01*dz+correction;
+    Double_t add=0;
+    if (TMath::Abs(dz)>padlength/2.){
+      //Double_t dy2 = c->GetY() - fY;
+      //Double_t sign = (dz>0) ? -1.: 1.;
+      //dy2-=h01*sign*padlength/2.;    
+      //dy = dy2;
+      add =1.;
+    }
+    Double_t s00 = c->GetSigmaY2()+errang+add;  // error pad
+    Double_t s11 = c->GetSigmaZ2()*xu_factor;   // error pad-row
+    //
+    r00 = fCyy + 2*fCzy*h01 + fCzz*h01*h01+s00;
+    r01 = fCzy + fCzz*h01;
+    r11 = fCzz + s11;
+    det = r00*r11 - r01*r01;
+    // inverse matrix
+    tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det;
+
+    // K matrix
+    k00=fCyy*r00+fCzy*(r01+h01*r00),k01=fCyy*r01+fCzy*(r11+h01*r01);
+    k10=fCzy*r00+fCzz*(r01+h01*r00),k11=fCzy*r01+fCzz*(r11+h01*r01);
+    k20=fCey*r00+fCez*(r01+h01*r00),k21=fCey*r01+fCez*(r11+h01*r01);
+    k30=fCty*r00+fCtz*(r01+h01*r00),k31=fCty*r01+fCtz*(r11+h01*r01);
+    k40=fCcy*r00+fCcz*(r01+h01*r00),k41=fCcy*r01+fCcz*(r11+h01*r01);  
+    //
+    //Update measurement
+    cur=fC + k40*dy + k41*dz; eta=fE + k20*dy + k21*dz;
+    if (TMath::Abs(cur*fX-eta) >= 0.90000) {
+      //Int_t n=GetNumberOfClusters();
+      //      if (n>4) cerr<<n<<" AliTRDtrack warning: Filtering failed !\n";
+      return 0;
+    }                           
+    fY += k00*dy + k01*dz;
+    fZ += k10*dy + k11*dz;
+    fE  = eta;
+    fT += k30*dy + k31*dz;
+    fC  = cur;
+    
+    k01+=h01*k00;
+    k11+=h01*k10;
+    k21+=h01*k20;
+    k31+=h01*k30;
+    k41+=h01*k40;  
+    
+  }
+  //Update covariance
+  //
+  //
+  Double_t oldyy = fCyy, oldzz = fCzz; //, oldee=fCee, oldcc =fCcc;
+  Double_t oldzy = fCzy, oldey = fCey, oldty=fCty, oldcy =fCcy;
+  Double_t oldez = fCez, oldtz = fCtz, oldcz=fCcz;
+  //Double_t oldte = fCte, oldce = fCce;
+  //Double_t oldct = fCct;
+
+  fCyy-=k00*oldyy+k01*oldzy;   
+  fCzy-=k10*oldyy+k11*oldzy;
+  fCey-=k20*oldyy+k21*oldzy;   
+  fCty-=k30*oldyy+k31*oldzy;
+  fCcy-=k40*oldyy+k41*oldzy;  
+  //
+  fCzz-=k10*oldzy+k11*oldzz;
+  fCez-=k20*oldzy+k21*oldzz;   
+  fCtz-=k30*oldzy+k31*oldzz;
+  fCcz-=k40*oldzy+k41*oldzz;
+  //
+  fCee-=k20*oldey+k21*oldez;   
+  fCte-=k30*oldey+k31*oldez;
+  fCce-=k40*oldey+k41*oldez;
+  //
+  fCtt-=k30*oldty+k31*oldtz;
+  fCct-=k40*oldty+k41*oldtz;
+  //
+  fCcc-=k40*oldcy+k41*oldcz;                 
+  //
+
+  Int_t n=GetNumberOfClusters();
+  fIndex[n]=index;
+  SetNumberOfClusters(n+1);
+
+  SetChi2(GetChi2()+chisq);
+  //  cerr<<"in update: fIndex["<<fN<<"] = "<<index<<endl;
+
+  return 1;      
+}                     
 
 
 //_____________________________________________________________________________
@@ -628,7 +768,7 @@ Int_t AliTRDtrack::Rotate(Double_t alpha)
   fE=fE*ca + (fC*y1 + sqrt(1.- r1*r1))*sa;
 
   Double_t r2=fC*fX - fE;
-  if (TMath::Abs(r2) >= 0.99999) {
+  if (TMath::Abs(r2) >= 0.90000) {
     Int_t n=GetNumberOfClusters();
     if (n>4) cerr<<n<<" AliTRDtrack warning: Rotation failed !\n";
     return 0;
@@ -752,3 +892,14 @@ void AliTRDtrack::ResetCovariance() {
   fCcy=0.;  fCcz=0.;  fCce=0.;  fCct=0.;  fCcc*=10.;  
 }                                                         
 
+void AliTRDtrack::ResetCovariance(Float_t mult) {
+  //
+  // Resets covariance matrix
+  //
+
+  fCyy*=mult;
+  fCzy*=0.;  fCzz*=mult;
+  fCey*=0.;  fCez*=0.;  fCee*=mult;
+  fCty*=0.;  fCtz*=0.;  fCte*=0.;  fCtt*=mult;
+  fCcy*=0.;  fCcz*=0.;  fCce*=0.;  fCct*=0.;  fCcc*=mult;  
+}