AliPMDClusteringV2::AliPMDClusteringV2():
fPMDclucont(new TObjArray()),
- fCutoff(0.0)
+ fCutoff(0.0),
+ fClusParam(0)
{
for(int i = 0; i < kNDIMX; i++)
{
AliPMDClusteringV2::AliPMDClusteringV2(const AliPMDClusteringV2& pmdclv2):
AliPMDClustering(pmdclv2),
fPMDclucont(0),
- fCutoff(0)
+ fCutoff(0),
+ fClusParam(0)
{
// copy constructor
AliError("Copy constructor not allowed ");
// ------------------------------------------------------------------------ //
void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
- Double_t celladc[48][96], TObjArray *pmdcont)
+ Int_t celltrack[48][96],
+ Int_t cellpid[48][96],
+ Double_t celladc[48][96],
+ TObjArray *pmdcont)
{
// main function to call other necessary functions to do clustering
//
AliPMDcluster *pmdcl = 0;
- const float ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
-
- Int_t i, j, nmx1, incr, id, jd;
+ const Float_t ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
+ const Int_t kNmaxCell = 19; // # of cells surrounding a cluster center
+ Int_t i = 0, j = 0, nmx1 = 0;
+ Int_t incr = 0, id = 0, jd = 0;
Int_t ndimXr = 0;
Int_t ndimYr = 0;
- Int_t celldataX[15], celldataY[15];
- Float_t clusdata[6];
- Double_t cutoff, ave;
+ Int_t celldataX[kNmaxCell], celldataY[kNmaxCell];
+ Int_t celldataTr[kNmaxCell], celldataPid[kNmaxCell];
+ Float_t celldataAdc[kNmaxCell];
+ Float_t clusdata[6] = {0.,0.,0.,0.,0.,0.};
+ Double_t cutoff = 0., ave = 0.;
Double_t edepcell[kNMX];
}
}
- Int_t iord1[kNMX];
+ // the dimension of iord1 is increased twice
+ Int_t iord1[2*kNMX];
TMath::Sort((Int_t)kNMX,edepcell,iord1);// order the data
cutoff = fCutoff; // cutoff used to discard cells having ener. dep.
ave = 0.;
//
// Cells associated with a cluster
//
- for (Int_t ihit = 0; ihit < 15; ihit++)
+ for (Int_t ihit = 0; ihit < kNmaxCell; ihit++)
{
Int_t dummyXY = pmdcludata->GetCellXY(ihit);
Int_t celldumY = dummyXY%10000;
Int_t celldumX = dummyXY/10000;
- //Float_t cellY = (Float_t) (ktwobysqrt3*celldumY/10);
- //Float_t cellX = (Float_t) (celldumX/10 - (celldumY/2.)/10);
-
Float_t cellY = (Float_t) celldumY/10;
Float_t cellX = (Float_t) celldumX/10;
-
//
// Cell X centroid is back transformed
//
{
celldataX[ihit] = (Int_t) ((cellX - (48-1) + cellY/2.) + 0.5 );
}
- celldataY[ihit] = (Int_t) (cellY + 0.5);
+ celldataY[ihit] = (Int_t) (cellY + 0.5);
+
+ Int_t irow = celldataX[ihit];
+ Int_t icol = celldataY[ihit];
+
+ if ((irow >= 0 && irow < 48) && (icol >= 0 && icol < 96))
+ {
+ celldataTr[ihit] = celltrack[irow][icol];
+ celldataPid[ihit] = cellpid[irow][icol];
+ celldataAdc[ihit] = (Float_t) celladc[irow][icol];
+ }
+ else
+ {
+ celldataTr[ihit] = -1;
+ celldataPid[ihit] = -1;
+ celldataAdc[ihit] = -1;
+ }
+
}
- pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY);
+ pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY,
+ celldataTr, celldataPid, celldataAdc);
pmdcont->Add(pmdcl);
}
- fPMDclucont->Clear();
+ fPMDclucont->Delete();
}
// ------------------------------------------------------------------------ //
Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
// connected cells
//
- Int_t i,j,k,id1,id2,icl, numcell;
- Int_t jd1,jd2, icell, cellcount;
+ Int_t i = 0, j = 0, k = 0, id1 =0, id2 = 0, icl = 0, numcell = 0;
+ Int_t jd1 = 0, jd2 = 0, icell = 0, cellcount = 0;
Int_t clust[2][5000];
static Int_t neibx[6] = {1,0,-1,-1,0,1}, neiby[6] = {0,1,1,0,-1,-1};
// finds out the more refined clusters
const Float_t ktwobysqrt3 = 1.1547;
+ const Int_t kNmaxCell = 19;
+
AliPMDcludata *pmdcludata = 0;
- Int_t i12;
- Int_t i, j, k, i1, i2, id, icl, itest, ihld;
- Int_t ig, nsupcl, clno, clX,clY;
- Int_t clxy[15];
+ Int_t i12 = 0;
+ Int_t i = 0, j = 0, k = 0;
+ Int_t i1 = 0, i2 = 0, id = 0, icl = 0, itest = 0, ihld = 0;
+ Int_t ig = 0, nsupcl = 0, clno = 0, clX = 0, clY = 0;
+ Int_t clxy[kNmaxCell];
- Float_t clusdata[6];
- Double_t x1, y1, z1, x2, y2, z2, rr;
+ Float_t clusdata[6] = {0.,0.,0.,0.,0.,0.};
+ Double_t x1 = 0., y1 = 0., z1 = 0., x2 = 0., y2 = 0., z2 = 0., rr = 0.;
Int_t kndim = incr + 1;
clX = (Int_t)((fCoord[0][i1][i2] - clY/20.)*10);
clxy[0] = clX*10000 + clY ;
- for(Int_t icltr = 1; icltr < 15; icltr++)
+ for(Int_t icltr = 1; icltr < kNmaxCell; icltr++)
{
clxy[icltr] = -1;
}
clX = (Int_t)((x2 - clY/20.)*10);
clxy[1] = clX*10000 + clY ;
- for(Int_t icltr = 2; icltr < 15; icltr++)
+ for(Int_t icltr = 2; icltr < kNmaxCell; icltr++)
{
clxy[icltr] = -1;
}
clusdata[5] = rcs[j];
if(ig == 0)
{
- clusdata[3] = ncl[i] + 1;//ajay
- //clusdata[3] = ncl[i] ;
+ clusdata[3] = ncl[i] + 1;
}
else
{
}
// cell information
Int_t ncellcls = testncl[j];
- if( ncellcls < 15 )
+ if( ncellcls < kNmaxCell )
{
for(Int_t kk = 1; kk <= ncellcls; kk++)
{
clY = (Int_t)((ktwobysqrt3*y[ll])*10);
clX = (Int_t)((x[ll] - clY/20.)*10);
clxy[kk-1] = clX*10000 + clY ;
-
- //clX = (Int_t) x[ll]*10;
- //clY = (Int_t) y[ll]*10;
- //clxy[kk-1] = (Int_t) clX*10000 + clY ;
pp++;
}
- for(Int_t icltr = ncellcls ; icltr < 15; icltr++)
+ for(Int_t icltr = ncellcls ; icltr < kNmaxCell; icltr++)
{
clxy[icltr] = -1;
}
Int_t kndim2 = 20;
Int_t kndim3 = nclust + 1;//nclust
- Int_t i, j, k, i1, i2;
- Double_t x1, y1, x2, y2, rr, b, c, r1, r2;
- Double_t sumx, sumy, sumxy, sumxx, sum, sum1, sumyy;
+ Int_t i = 0, j = 0, k = 0, i1 = 0, i2 = 0;
+ Double_t x1 = 0., y1 = 0., x2 = 0., y2 = 0.;
+ Double_t rr = 0., b = 0., c = 0., r1 = 0., r2 = 0.;
+ Double_t sumx = 0., sumy = 0., sumxy = 0.;
+ Double_t sumxx = 0., sum = 0., sum1 = 0., sumyy = 0.;
Double_t *str, *str1, *xcl, *ycl, *cln;
Int_t **cell;
x1 = x[i];
y1 = y[i];
cluster[i][0] = 0;
+
// distance <= 1 cell unit
+
for(j = 0; j <= nclust; j++)
{
x2 = xc[j];
// To get the cell position in a cluster
testncl.Set(nclust+1);
- //testindex.Set(ncell);
testindex.Set(ncell+1);
- cell[0][0] = ncell + 1;//ajay
- //cell[0][0] = ncell;
+ cell[0][0] = ncell + 1;
testncl[0] = cell[0][0];
Int_t ll = 0;
for(Int_t ii = 1; ii <= ncell; ii++)
{
cell[0][ii]=ii;
- //clustcell[0][ii]=1.;
Int_t kk = cell[0][ii];
testindex[ll] = kk;
ll++;
// final assignments
xc[i] = xcl[i];
yc[i] = ycl[i];
- //zc[i] = str[i];//ajay
zc[i] = sum;
cells[i] = cln[i];
rcl[i] = r1;
fCutoff = decut;
}
// ------------------------------------------------------------------------ //
+void AliPMDClusteringV2::SetClusteringParam(Int_t cluspar)
+{
+ fClusParam = cluspar;
+}
+// ------------------------------------------------------------------------ //