Float_t clusdata[6] = {0.,0.,0.,0.,0.,0.};
Double_t cutoff, ave;
Double_t edepcell[kNMX];
- Double_t cellenergy[11424];
+ Double_t cellenergy[kNMX];
// ndimXr and ndimYr are different because of different module size
ndimYr = 96;
}
- for (i =0; i < 11424; i++)
+ for (i = 0; i < kNMX; i++)
{
cellenergy[i] = 0.;
}
edepcell[i] = cellenergy[i];
}
- Int_t iord1[kNMX];
- TMath::Sort((Int_t)kNMX,edepcell,iord1);// order the data
- cutoff = fCutoff; // cutoff to discard cells
+ Bool_t jsort = true;
+ // the dimension of iord1 is increased twice
+ Int_t iord1[2*kNMX];
+ TMath::Sort((Int_t)kNMX,edepcell,iord1,jsort);// order the data
+ cutoff = fCutoff; // cutoff to discard cells
ave = 0.;
nmx1 = -1;
for(i = 0;i < kNMX; i++)
for(i = 0; i<ndim; i++)
{
ncl[i] = -1;
- if (i < 6) clusdata[i] = 0.;
- if (i < kNmaxCell) clxy[i] = 0;
+ }
+ for(i = 0; i<6; i++)
+ {
+ clusdata[i] = 0.;
+ }
+ for(i = 0; i<19; i++)
+ {
+ clxy[i] = 0;
}
// clno counts the final clusters
{
nsupcl++;
}
- if (nsupcl > ndim)
+ if (nsupcl >= ndim)
{
AliWarning("RefClust: Too many superclusters!");
- nsupcl = ndim;
+ nsupcl = ndim - 1;
break;
}
ncl[nsupcl]++;
if (clno >= 4608)
{
AliWarning("RefClust: Too many clusters! more than 4608");
+ delete [] ncl;
+ delete [] clxy;
return;
}
clno++;
if (clno >= 4608)
{
AliWarning("RefClust: Too many clusters! more than 4608");
+ delete [] ncl;
+ delete [] clxy;
+
return;
}
clno++;
}
else
{
-
Int_t *iord, *tc, *t;
Double_t *x, *y, *z, *xc, *yc, *zc;
iord = new Int_t [ncl[i]+1];
tc = new Int_t [ncl[i]+1];
t = new Int_t [ncl[i]+1];
-
x = new Double_t [ncl[i]+1];
y = new Double_t [ncl[i]+1];
z = new Double_t [ncl[i]+1];
i1 = fInfcl[1][id];
i2 = fInfcl[2][id];
i12 = i1 + i2*kNDIMX;
-
iord[j] = j;
x[j] = fCoord[0][i1][i2];
y[j] = fCoord[1][i1][i2];
z[j] = edepcell[i12];
t[j] = i1*10000 + i2;
-
}
// arranging cells within supercluster in decreasing order
if (clno >= 4608)
{
AliWarning("RefClust: Too many clusters! more than 4608");
+
+ delete [] cellCount;
+ for(Int_t jj = 0; jj < ncl[i]+1; jj++) delete [] cellXY[jj];
+ delete [] cellXY;
+
+ delete [] status;
+ delete [] totaladc;
+ delete [] totaladc2;
+ delete [] ncell;
+ delete [] xclust;
+ delete [] yclust;
+ delete [] sigxclust;
+ delete [] sigyclust;
+ delete [] ax;
+ delete [] ay;
+ delete [] ax2;
+ delete [] ay2;
+ delete [] weight;
+
+ delete [] iord;
+ delete [] tc;
+ delete [] t;
+ delete [] x;
+ delete [] y;
+ delete [] z;
+ delete [] xc;
+ delete [] yc;
+ delete [] zc;
+
+
+ delete [] ncl;
+ delete [] clxy;
+
return;
}
clusdata[0] = xclust[kcl];
}
delete [] cellCount;
for(Int_t jj = 0; jj < ncl[i]+1; jj++) delete [] cellXY[jj];
-
+ delete [] cellXY;
+
delete [] status;
delete [] totaladc;
delete [] totaladc2;