]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerV2.cxx
#100372: Request to port code to allow for event selection from ZDC timing info at...
[u/mrichter/AliRoot.git] / ITS / AliITStrackerV2.cxx
index 7777bc9d626e9cce1fa1dae98ac51c0cc1d909e3..d80e89f8f05dcfcdc408f0a37557d7918f230812 100644 (file)
@@ -367,7 +367,10 @@ Int_t AliITStrackerV2::PropagateBack(AliESDEvent *event) {
        if (fTrackToFollow.PropagateToVertex(event->GetVertex())) {
           fTrackToFollow.StartTimeIntegral();
        }
-       fTrackToFollow.PropagateTo(3.,-0.0028,65.19);
+       Bool_t okProp=fTrackToFollow.PropagateTo(3.,-0.0028,65.19);
+       if(!okProp){
+        AliWarning("Propagation to beam pipe radius failed");
+       }
      }
 
      fTrackToFollow.ResetCovariance(10.); fTrackToFollow.ResetClusters();
@@ -648,7 +651,10 @@ AliITStrackerV2::AliITSlayer::AliITSlayer():
   //--------------------------------------------------------------------
   
   for (Int_t i=0; i<kNsector; i++) fN[i]=0;
-
+  for (Int_t i=0; i<AliITSRecoParam::kMaxClusterPerLayer; i++){
+    fClusters[i]=0;
+    fIndex[i]=0;
+  }
 }
 
 AliITStrackerV2::AliITSlayer::
@@ -668,8 +674,10 @@ AliITSlayer(Double_t r,Double_t p,Double_t z,Int_t nl,Int_t nd):
 
   for (Int_t i=0; i<kNsector; i++) fN[i]=0;
 
-  for (Int_t i=0; i<AliITSRecoParam::fgkMaxClusterPerLayer; i++) fClusters[i]=0;
-
+  for (Int_t i=0; i<AliITSRecoParam::kMaxClusterPerLayer; i++){
+    fClusters[i]=0;
+    fIndex[i]=0;
+  }
 }
 
 AliITStrackerV2::AliITSlayer::~AliITSlayer() {
@@ -1005,13 +1013,21 @@ Bool_t AliITStrackerV2::RefitAt(Double_t xx,AliITStrackV2 *t,
  
      {
      Double_t hI=i-0.5*step; 
-     if (TMath::Abs(hI-1.5)<0.01 || TMath::Abs(hI-3.5)<0.01) {             
-        Double_t rs=0.5*(fgLayers[i-step].GetR() + r);
-        Double_t d=0.0034, x0=38.6; 
-        if (TMath::Abs(hI-1.5)<0.01) {rs=9.; d=0.0097; x0=42;}
-        if (!t->PropagateTo(rs,-step*d,x0)) {
-          return kFALSE;
-        }
+     if (TMath::Abs(hI-1.5)<0.01 || TMath::Abs(hI-3.5)<0.01) {  
+       Int_t iLay = i-step;
+       Double_t rs = 0.;
+       if(iLay<0 || iLay>= AliITSgeomTGeo::kNLayers){
+        AliError(Form("Invalid layer %d ",iLay));
+        return kFALSE;
+       }
+       else{
+        rs=0.5*(fgLayers[i-step].GetR() + r);
+       }
+       Double_t d=0.0034, x0=38.6; 
+       if (TMath::Abs(hI-1.5)<0.01) {rs=9.; d=0.0097; x0=42;}
+       if (!t->PropagateTo(rs,-step*d,x0)) {
+        return kFALSE;
+       }
      }
      }