]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtrackletOflHelper.cxx
Remove a run from LHC10e wo AODs; added run list for the new PbPb MC LHC11a10b_bis
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletOflHelper.cxx
index 7bef0af51d4314b9124745e976c487dd640f6339..c3e5c4112189c8d1bf34063484ab0579df98a84f 100644 (file)
@@ -246,12 +246,13 @@ void AliTRDtrackletOflHelper::FindSolidCls(Bool_t *mark, Int_t *q)
 //  Find clusters produced by large fluctuations of energy deposits
 //  Largest charge and well separation from neighbors
 
-  Int_t idx[AliTRDseedV1::kNtb];
-  TMath::Sort(Int_t(AliTRDseedV1::kNtb), q, idx, kTRUE);
+  Int_t ntb(AliTRDseedV1::kNtb);
+  Int_t idx[ntb+1];
+  TMath::Sort(ntb, q, idx, kTRUE);
   Int_t qmax = Int_t(0.3*q[idx[0]]);
   mark[0] = kFALSE;
-  for(Int_t icl(AliTRDseedV1::kNtb-5); icl<AliTRDseedV1::kNtb; icl++) mark[icl] = kFALSE;
-  for(Int_t icl(0); icl<AliTRDseedV1::kNtb; icl++){
+  for(Int_t icl(ntb-5); icl<ntb; icl++) mark[icl] = kFALSE;
+  for(Int_t icl(0); icl<ntb; icl++){
     Int_t jcl(idx[icl]);
     if(!mark[jcl]) continue;
     if(q[jcl-1]>q[jcl] || q[jcl+1]>q[jcl]){
@@ -471,13 +472,16 @@ Int_t AliTRDtrackletOflHelper::Segmentation(Int_t n, Double_t *x, Double_t *y, I
     AliErrorGeneral("AliTRDtrackletOflHelper::Segmentation()", "One of the input arrays non initialized.");
     return 0;
   }
-
+  const Int_t kBuffer = 200;
+  if(n>kBuffer){
+    AliWarningGeneral("AliTRDtrackletOflHelper::Segmentation()", Form("Input array size %d exceed buffer %d. Truncate.", n, kBuffer));
+    n = kBuffer;
+  }
   const Double_t kGapSize(0.2); // cm
   Int_t ng(0),
         nc(0);
-  Double_t xx[100], dy;
-  Int_t idx[200], jdx[100], kdx[100]; 
-  
+  Double_t xx[kBuffer], dy;
+  Int_t idx[kBuffer+1], jdx[kBuffer], kdx[kBuffer];
   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.;