From 35d629fbd12d49e473600b126175a8add9d707a8 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 28 Apr 2004 17:10:55 +0000 Subject: [PATCH] Better sorting algorithm --- PMD/AliPMDClustering.cxx | 42 ++++++++++++++++++++++-------------------- 1 files changed, 22 insertions(+), 20 deletions(-) diff --git a/PMD/AliPMDClustering.cxx b/PMD/AliPMDClustering.cxx index dd05326..0823265 100644 --- a/PMD/AliPMDClustering.cxx +++ b/PMD/AliPMDClustering.cxx @@ -176,26 +176,28 @@ void AliPMDClustering::Order() } } // sort and store sorting information in iord1 - for(j=1; j < kNMX; j++) - { - itst = 0; - adum = dd[j]; - idum = iord1[j]; - for(i1=0; i1 < j ; i1++) - { - if(adum > dd[i1] && itst == 0) - { - itst = 1; - for(i2=j-1; i2 >= i1 ; i2=i2--) - { - dd[i2+1] = dd[i2]; - iord1[i2+1] = iord1[i2]; - } - dd[i1] = adum; - iord1[i1] = idum; - } - } - } +// for(j=1; j < kNMX; j++) +// { +// itst = 0; +// adum = dd[j]; +// idum = iord1[j]; +// for(i1=0; i1 < j ; i1++) +// { +// if(adum > dd[i1] && itst == 0) +// { +// itst = 1; +// for(i2=j-1; i2 >= i1 ; i2=i2--) +// { +// dd[i2+1] = dd[i2]; +// iord1[i2+1] = iord1[i2]; +// } +// dd[i1] = adum; +// iord1[i1] = idum; +// } +// } +// } + + TMath::Sort(kNMX,dd,iord1); //PH Using much better algorithm... // store the sorted information in fIord for later use for(i=0; i