]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix for bug 79155
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Mar 2011 10:52:01 +0000 (10:52 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Mar 2011 10:52:01 +0000 (10:52 +0000)
TRD/AliTRDtrackletOflHelper.cxx

index 7bef0af51d4314b9124745e976c487dd640f6339..0e52e8cf7b612ab4e89bcc10dfa68d6b40ccb62d 100644 (file)
@@ -477,7 +477,7 @@ Int_t AliTRDtrackletOflHelper::Segmentation(Int_t n, Double_t *x, Double_t *y, I
         nc(0);
   Double_t xx[100], dy;
   Int_t idx[200], jdx[100], kdx[100]; 
-  
+  for(Int_t i(100); i--;) kdx[i] = -1;
   TMath::Sort(n, y, idx);
   for(Int_t iy(0); iy<n; iy++){
     dy = iy>0?(TMath::Abs(y[idx[iy-1]]-y[idx[iy]])):0.;
@@ -486,6 +486,7 @@ Int_t AliTRDtrackletOflHelper::Segmentation(Int_t n, Double_t *x, Double_t *y, I
       for(Int_t ic(0), jc0, jc1; ic<nc; ic++){
         jc0 = ic>0?kdx[jdx[ic-1]]:0;
         jc1 = kdx[jdx[ic]];
+        if(jc0<0 || jc1<0) continue;
         dy = TMath::Abs(y[jc0] - y[jc1]);
         if(ic && dy>kGapSize) ng++;
         Index[jc1] = ng;