1 /***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-----------------------------------------------------//
20 // Source File : PMDClusteringV2.cxx //
22 // clustering code for alice pmd //
24 //-----------------------------------------------------//
26 /* --------------------------------------------------------------------
27 Code developed by S. C. Phatak, Institute of Physics,
28 Bhubaneswar 751 005 ( phatak@iopb.res.in ) Given the energy deposited
29 ( or ADC value ) in each cell of supermodule ( pmd or cpv ), the code
30 builds up superclusters and breaks them into clusters. The input is
31 in TObjarray and cluster information is in TObjArray.
32 integer clno gives total number of clusters in the supermodule.
33 fClusters is the global ( public ) variables.
34 Others are local ( private ) to the code.
35 At the moment, the data is read for whole detector ( all supermodules
36 and pmd as well as cpv. This will have to be modify later )
37 LAST UPDATE : October 23, 2002
38 -----------------------------------------------------------------------*/
40 #include <Riostream.h>
42 #include <TObjArray.h>
45 #include "AliPMDcludata.h"
46 #include "AliPMDcluster.h"
47 #include "AliPMDClustering.h"
48 #include "AliPMDClusteringV2.h"
51 ClassImp(AliPMDClusteringV2)
53 const Double_t AliPMDClusteringV2::fgkSqroot3by2=0.8660254; // sqrt(3.)/2.
55 AliPMDClusteringV2::AliPMDClusteringV2():
56 fPMDclucont(new TObjArray()),
60 for(int i = 0; i < kNDIMX; i++)
62 for(int j = 0; j < kNDIMY; j++)
64 fCoord[0][i][j] = i+j/2.;
65 fCoord[1][i][j] = fgkSqroot3by2*j;
69 // ------------------------------------------------------------------------ //
72 AliPMDClusteringV2::AliPMDClusteringV2(const AliPMDClusteringV2& pmdclv2):
73 AliPMDClustering(pmdclv2),
79 AliError("Copy constructor not allowed ");
82 // ------------------------------------------------------------------------ //
83 AliPMDClusteringV2 &AliPMDClusteringV2::operator=(const AliPMDClusteringV2& /*pmdclv2*/)
86 AliError("Assignment operator not allowed ");
89 // ------------------------------------------------------------------------ //
90 AliPMDClusteringV2::~AliPMDClusteringV2()
94 // ------------------------------------------------------------------------ //
96 void AliPMDClusteringV2::DoClust(Int_t idet, Int_t ismn,
97 Int_t celltrack[48][96],
98 Int_t cellpid[48][96],
99 Double_t celladc[48][96],
102 // main function to call other necessary functions to do clustering
104 AliPMDcluster *pmdcl = 0;
106 const Float_t ktwobysqrt3 = 1.1547; // 2./sqrt(3.)
107 const Int_t kNmaxCell = 19; // # of cells surrounding a cluster center
108 Int_t i = 0, j = 0, nmx1 = 0;
109 Int_t incr = 0, id = 0, jd = 0;
112 Int_t celldataX[kNmaxCell], celldataY[kNmaxCell];
113 Int_t celldataTr[kNmaxCell], celldataPid[kNmaxCell];
114 Float_t celldataAdc[kNmaxCell];
115 Float_t clusdata[6] = {0.,0.,0.,0.,0.,0.};
116 Double_t cutoff = 0., ave = 0.;
117 Double_t edepcell[kNMX];
125 else if (ismn >= 12 && ismn <= 23)
131 for (i =0; i < kNMX; i++)
136 for (id = 0; id < ndimXr; id++)
138 for (jd = 0; jd < ndimYr; jd++)
141 i = id + (ndimYr/2-1) - (jd/2);
142 Int_t ij = i + j*kNDIMX;
145 edepcell[ij] = celladc[jd][id];
147 else if (ismn >= 12 && ismn <= 23)
149 edepcell[ij] = celladc[id][jd];
156 TMath::Sort((Int_t)kNMX,edepcell,iord1);// order the data
157 cutoff = fCutoff; // cutoff used to discard cells having ener. dep.
161 for(i = 0;i < kNMX; i++)
167 if(edepcell[i] > cutoff )
173 AliDebug(1,Form("Number of cells having energy >= %f are %d",cutoff,nmx1));
181 AliDebug(1,Form("Number of cells in a SuperM = %d and Average = %f",
184 incr = CrClust(ave, cutoff, nmx1,iord1, edepcell);
185 RefClust(incr,edepcell );
187 Int_t nentries1 = fPMDclucont->GetEntries();
188 AliDebug(1,Form("Detector Plane = %d Serial Module No = %d Number of clusters = %d",idet, ismn, nentries1));
189 AliDebug(1,Form("Total number of clusters/module = %d",nentries1));
190 for (Int_t ient1 = 0; ient1 < nentries1; ient1++)
192 AliPMDcludata *pmdcludata =
193 (AliPMDcludata*)fPMDclucont->UncheckedAt(ient1);
194 Float_t cluXC = pmdcludata->GetClusX();
195 Float_t cluYC = pmdcludata->GetClusY();
196 Float_t cluADC = pmdcludata->GetClusADC();
197 Float_t cluCELLS = pmdcludata->GetClusCells();
198 Float_t cluSIGX = pmdcludata->GetClusSigmaX();
199 Float_t cluSIGY = pmdcludata->GetClusSigmaY();
201 Float_t cluY0 = ktwobysqrt3*cluYC;
202 Float_t cluX0 = cluXC - cluY0/2.;
205 // Cluster X centroid is back transformed
209 clusdata[0] = cluX0 - (24-1) + cluY0/2.;
211 else if (ismn >= 12 && ismn <= 23)
213 clusdata[0] = cluX0 - (48-1) + cluY0/2.;
217 clusdata[2] = cluADC;
218 clusdata[3] = cluCELLS;
219 clusdata[4] = cluSIGX;
220 clusdata[5] = cluSIGY;
222 // Cells associated with a cluster
224 for (Int_t ihit = 0; ihit < kNmaxCell; ihit++)
226 Int_t dummyXY = pmdcludata->GetCellXY(ihit);
228 Int_t celldumY = dummyXY%10000;
229 Int_t celldumX = dummyXY/10000;
230 Float_t cellY = (Float_t) celldumY/10;
231 Float_t cellX = (Float_t) celldumX/10;
234 // Cell X centroid is back transformed
238 celldataX[ihit] = (Int_t) ((cellX - (24-1) + cellY/2.) + 0.5);
240 else if (ismn >= 12 && ismn <= 23)
242 celldataX[ihit] = (Int_t) ((cellX - (48-1) + cellY/2.) + 0.5 );
244 celldataY[ihit] = (Int_t) (cellY + 0.5);
246 Int_t irow = celldataX[ihit];
247 Int_t icol = celldataY[ihit];
249 if ((irow >= 0 && irow < 48) && (icol >= 0 && icol < 96))
251 celldataTr[ihit] = celltrack[irow][icol];
252 celldataPid[ihit] = cellpid[irow][icol];
253 celldataAdc[ihit] = (Float_t) celladc[irow][icol];
257 celldataTr[ihit] = -1;
258 celldataPid[ihit] = -1;
259 celldataAdc[ihit] = -1;
264 pmdcl = new AliPMDcluster(idet, ismn, clusdata, celldataX, celldataY,
265 celldataTr, celldataPid, celldataAdc);
268 fPMDclucont->Delete();
270 // ------------------------------------------------------------------------ //
271 Int_t AliPMDClusteringV2::CrClust(Double_t ave, Double_t cutoff, Int_t nmx1,
272 Int_t iord1[], Double_t edepcell[])
274 // Does crude clustering
275 // Finds out only the big patch by just searching the
279 Int_t i = 0, j = 0, k = 0, id1 =0, id2 = 0, icl = 0, numcell = 0;
280 Int_t jd1 = 0, jd2 = 0, icell = 0, cellcount = 0;
281 Int_t clust[2][5000];
282 static Int_t neibx[6] = {1,0,-1,-1,0,1}, neiby[6] = {0,1,1,0,-1,-1};
284 // neibx and neiby define ( incremental ) (i,j) for the neighbours of a
285 // cell. There are six neighbours.
286 // cellcount --- total number of cells having nonzero ener dep
287 // numcell --- number of cells in a given supercluster
289 AliDebug(1,Form("kNMX = %d nmx1 = %d kNDIMX = %d kNDIMY = %d ave = %f cutoff = %f",kNMX,nmx1,kNDIMX,kNDIMY,ave,cutoff));
291 for (j=0; j < kNDIMX; j++)
293 for(k=0; k < kNDIMY; k++)
295 fInfocl[0][j][k] = 0;
296 fInfocl[1][j][k] = 0;
300 for(i=0; i < kNMX; i++)
308 if(edepcell[j] <= cutoff)
310 fInfocl[0][id1][id2] = -1;
313 // ---------------------------------------------------------------
314 // crude clustering begins. Start with cell having largest adc
315 // count and loop over the cells in descending order of adc count
316 // ---------------------------------------------------------------
319 for(icell=0; icell <= nmx1; icell++)
324 if(fInfocl[0][id1][id2] == 0 )
326 // ---------------------------------------------------------------
327 // icl -- cluster #, numcell -- # of cells in it, clust -- stores
328 // coordinates of the cells in a cluster, fInfocl[0][i1][i2] is 1 for
329 // primary and 2 for secondary cells,
330 // fInfocl[1][i1][i2] stores cluster #
331 // ---------------------------------------------------------------
335 fInfocl[0][id1][id2] = 1;
336 fInfocl[1][id1][id2] = icl;
337 fInfcl[0][cellcount] = icl;
338 fInfcl[1][cellcount] = id1;
339 fInfcl[2][cellcount] = id2;
341 clust[0][numcell] = id1;
342 clust[1][numcell] = id2;
343 for(i = 1; i < 5000; i++)
347 // ---------------------------------------------------------------
348 // check for adc count in neib. cells. If ne 0 put it in this clust
349 // ---------------------------------------------------------------
350 for(i = 0; i < 6; i++)
352 jd1 = id1 + neibx[i];
353 jd2 = id2 + neiby[i];
354 if( (jd1 >= 0 && jd1 < kNDIMX) && (jd2 >= 0 && jd2 < kNDIMY) &&
355 fInfocl[0][jd1][jd2] == 0)
358 fInfocl[0][jd1][jd2] = 2;
359 fInfocl[1][jd1][jd2] = icl;
360 clust[0][numcell] = jd1;
361 clust[1][numcell] = jd2;
363 fInfcl[0][cellcount] = icl;
364 fInfcl[1][cellcount] = jd1;
365 fInfcl[2][cellcount] = jd2;
368 // ---------------------------------------------------------------
369 // check adc count for neighbour's neighbours recursively and
370 // if nonzero, add these to the cluster.
371 // ---------------------------------------------------------------
372 for(i = 1;i < 5000; i++)
374 if(clust[0][i] != -1)
378 for(j = 0; j < 6 ; j++)
380 jd1 = id1 + neibx[j];
381 jd2 = id2 + neiby[j];
382 if( (jd1 >= 0 && jd1 < kNDIMX) &&
383 (jd2 >= 0 && jd2 < kNDIMY)
384 && fInfocl[0][jd1][jd2] == 0 )
386 fInfocl[0][jd1][jd2] = 2;
387 fInfocl[1][jd1][jd2] = icl;
389 clust[0][numcell] = jd1;
390 clust[1][numcell] = jd2;
392 fInfcl[0][cellcount] = icl;
393 fInfcl[1][cellcount] = jd1;
394 fInfcl[2][cellcount] = jd2;
403 // ------------------------------------------------------------------------ //
404 void AliPMDClusteringV2::RefClust(Int_t incr, Double_t edepcell[])
406 // Does the refining of clusters
407 // Takes the big patch and does gaussian fitting and
408 // finds out the more refined clusters
410 const Float_t ktwobysqrt3 = 1.1547;
411 const Int_t kNmaxCell = 19;
413 AliPMDcludata *pmdcludata = 0;
416 Int_t i = 0, j = 0, k = 0;
417 Int_t i1 = 0, i2 = 0, id = 0, icl = 0, itest = 0, ihld = 0;
418 Int_t ig = 0, nsupcl = 0, clno = 0, clX = 0, clY = 0;
419 Int_t clxy[kNmaxCell];
421 Float_t clusdata[6] = {0.,0.,0.,0.,0.,0.};
422 Double_t x1 = 0., y1 = 0., z1 = 0., x2 = 0., y2 = 0., z2 = 0., rr = 0.;
424 Int_t kndim = incr + 1;
431 Double_t *x, *y, *z, *xc, *yc, *zc, *cells, *rcl, *rcs;
433 ncl = new Int_t [kndim];
434 iord = new Int_t [kndim];
435 x = new Double_t [kndim];
436 y = new Double_t [kndim];
437 z = new Double_t [kndim];
438 xc = new Double_t [kndim];
439 yc = new Double_t [kndim];
440 zc = new Double_t [kndim];
441 cells = new Double_t [kndim];
442 rcl = new Double_t [kndim];
443 rcs = new Double_t [kndim];
445 for(Int_t kk = 0; kk < 15; kk++)
447 if( kk < 6 )clusdata[kk] = 0.;
450 // nsupcl = # of superclusters; ncl[i]= # of cells in supercluster i
451 // x, y and z store (x,y) coordinates of and energy deposited in a cell
452 // xc, yc store (x,y) coordinates of the cluster center
453 // zc stores the energy deposited in a cluster, rc is cluster radius
458 for(i = 0; i < kndim; i++)
462 for(i = 0; i <= incr; i++)
464 if(fInfcl[0][i] != nsupcl)
470 AliWarning("RefClust: Too many superclusters!");
477 AliDebug(1,Form("Number of cells = %d Number of Superclusters = %d",
482 for(i = 0; i <= nsupcl; i++)
488 // one cell super-clusters --> single cluster
489 // cluster center at the centyer of the cell
490 // cluster radius = half cell dimension
493 AliWarning("RefClust: Too many clusters! more than 5000");
499 i12 = i1 + i2*kNDIMX;
500 clusdata[0] = fCoord[0][i1][i2];
501 clusdata[1] = fCoord[1][i1][i2];
502 clusdata[2] = edepcell[i12];
509 clY = (Int_t)((ktwobysqrt3*fCoord[1][i1][i2])*10);
510 clX = (Int_t)((fCoord[0][i1][i2] - clY/20.)*10);
511 clxy[0] = clX*10000 + clY ;
513 for(Int_t icltr = 1; icltr < kNmaxCell; icltr++)
517 pmdcludata = new AliPMDcludata(clusdata,clxy);
518 fPMDclucont->Add(pmdcludata);
524 // two cell super-cluster --> single cluster
525 // cluster center is at ener. dep.-weighted mean of two cells
526 // cluster radius == half cell dimension
531 AliWarning("RefClust: Too many clusters! more than 5000");
537 i12 = i1 + i2*kNDIMX;
539 x1 = fCoord[0][i1][i2];
540 y1 = fCoord[1][i1][i2];
546 i12 = i1 + i2*kNDIMX;
548 x2 = fCoord[0][i1][i2];
549 y2 = fCoord[1][i1][i2];
552 clusdata[0] = (x1*z1+x2*z2)/(z1+z2);
553 clusdata[1] = (y1*z1+y2*z2)/(z1+z2);
556 clusdata[4] = (TMath::Sqrt(z1*z2))/(z1+z2);
559 clY = (Int_t)((ktwobysqrt3*y1)*10);
560 clX = (Int_t)((x1 - clY/20.)*10);
561 clxy[0] = clX*10000 + clY ;
563 clY = (Int_t)((ktwobysqrt3*y2)*10);
564 clX = (Int_t)((x2 - clY/20.)*10);
565 clxy[1] = clX*10000 + clY ;
567 for(Int_t icltr = 2; icltr < kNmaxCell; icltr++)
571 pmdcludata = new AliPMDcludata(clusdata, clxy);
572 fPMDclucont->Add(pmdcludata);
577 // super-cluster of more than two cells - broken up into smaller
578 // clusters gaussian centers computed. (peaks separated by > 1 cell)
579 // Begin from cell having largest energy deposited This is first
581 // *****************************************************************
582 // NOTE --- POSSIBLE MODIFICATION: ONE MAY NOT BREAKING SUPERCLUSTERS
583 // IF NO. OF CELLS IS NOT TOO LARGE ( SAY 5 OR 6 )
584 // SINCE WE EXPECT THE SUPERCLUSTER
585 // TO BE A SINGLE CLUSTER
586 //*******************************************************************
590 i12 = i1 + i2*kNDIMX;
592 x[0] = fCoord[0][i1][i2];
593 y[0] = fCoord[1][i1][i2];
594 z[0] = edepcell[i12];
597 for(j = 1; j <= ncl[i]; j++)
603 i12 = i1 + i2*kNDIMX;
605 x[j] = fCoord[0][i1][i2];
606 y[j] = fCoord[1][i1][i2];
607 z[j] = edepcell[i12];
610 // arranging cells within supercluster in decreasing order
611 for(j = 1; j <= ncl[i];j++)
615 for(i1 = 0; i1 < j; i1++)
617 if(itest == 0 && z[iord[i1]] < z[ihld])
620 for(i2 = j-1;i2 >= i1;i2--)
622 iord[i2+1] = iord[i2];
630 // compute the number of clusters and their centers ( first
632 // centers must be separated by cells having smaller ener. dep.
633 // neighbouring centers should be either strong or well-separated
638 for(j = 1; j <= ncl[i]; j++)
643 for(k = 0; k <= ig; k++)
647 rr = Distance(x1,y1,x2,y2);
648 //************************************************************
649 // finetuning cluster splitting
650 // the numbers zc/4 and zc/10 may need to be changed.
651 // Also one may need to add one more layer because our
652 // cells are smaller in absolute scale
653 //************************************************************
656 if( rr >= 1.1 && rr < 1.8 && z[iord[j]] > zc[k]/4.) itest++;
657 if( rr >= 1.8 && rr < 2.1 && z[iord[j]] > zc[k]/10.) itest++;
658 if( rr >= 2.1)itest++;
669 ClustDetails(ncl[i], ig, x, y ,z, xc, yc, zc, rcl, rcs, cells,
673 for(j = 0; j <= ig; j++)
678 AliWarning("RefClust: Too many clusters! more than 5000");
684 clusdata[4] = rcl[j];
685 clusdata[5] = rcs[j];
688 clusdata[3] = ncl[i] + 1;
692 clusdata[3] = cells[j];
695 Int_t ncellcls = testncl[j];
696 if( ncellcls < kNmaxCell )
698 for(Int_t kk = 1; kk <= ncellcls; kk++)
700 Int_t ll = testindex[pp];
701 clY = (Int_t)((ktwobysqrt3*y[ll])*10);
702 clX = (Int_t)((x[ll] - clY/20.)*10);
703 clxy[kk-1] = clX*10000 + clY ;
707 for(Int_t icltr = ncellcls ; icltr < kNmaxCell; icltr++)
712 pmdcludata = new AliPMDcludata(clusdata, clxy);
713 fPMDclucont->Add(pmdcludata);
731 // ------------------------------------------------------------------------ //
732 void AliPMDClusteringV2::ClustDetails(Int_t ncell, Int_t nclust, Double_t x[],
733 Double_t y[], Double_t z[],Double_t xc[],
734 Double_t yc[], Double_t zc[],
735 Double_t rcl[], Double_t rcs[],
736 Double_t cells[], TArrayI &testncl,
742 Int_t kndim1 = ncell + 1;//ncell
744 Int_t kndim3 = nclust + 1;//nclust
746 Int_t i = 0, j = 0, k = 0, i1 = 0, i2 = 0;
747 Double_t x1 = 0., y1 = 0., x2 = 0., y2 = 0.;
748 Double_t rr = 0., b = 0., c = 0., r1 = 0., r2 = 0.;
749 Double_t sumx = 0., sumy = 0., sumxy = 0.;
750 Double_t sumxx = 0., sum = 0., sum1 = 0., sumyy = 0.;
752 Double_t *str, *str1, *xcl, *ycl, *cln;
755 Double_t **clustcell;
756 str = new Double_t [kndim3];
757 str1 = new Double_t [kndim3];
758 xcl = new Double_t [kndim3];
759 ycl = new Double_t [kndim3];
760 cln = new Double_t [kndim3];
762 clustcell = new Double_t *[kndim3];
763 cell = new Int_t *[kndim3];
764 cluster = new Int_t *[kndim1];
765 for(i = 0; i < kndim1; i++)
767 cluster[i] = new Int_t [kndim2];
770 for(i = 0; i < kndim3; i++)
778 cell[i] = new Int_t [kndim2];
779 clustcell[i] = new Double_t [kndim1];
780 for(j = 0; j < kndim1; j++)
784 for(j = 0; j < kndim2; j++)
793 // more than one cluster
794 // checking cells shared between several clusters.
795 // First check if the cell is within
796 // one cell unit ( nearest neighbour). Else,
797 // if it is within 1.74 cell units ( next nearest )
798 // Else if it is upto 2 cell units etc.
800 for (i = 0; i <= ncell; i++)
806 // distance <= 1 cell unit
808 for(j = 0; j <= nclust; j++)
812 rr = Distance(x1, y1, x2, y2);
820 // next nearest neighbour
821 if(cluster[i][0] == 0)
823 for(j=0; j<=nclust; j++)
827 rr = Distance(x1, y1, x2, y2);
828 if(rr <= TMath::Sqrt(3.))
836 // next-to-next nearest neighbour
837 if(cluster[i][0] == 0)
839 for(j=0; j<=nclust; j++)
843 rr = Distance(x1, y1, x2, y2);
853 if(cluster[i][0] == 0)
855 for(j = 0; j <= nclust; j++)
859 rr = Distance(x1, y1, x2, y2);
870 // computing cluster strength. Some cells are shared.
871 for(i = 0; i <= ncell; i++)
873 if(cluster[i][0] != 0)
876 for(j = 1; j <= i1; j++)
884 for(k = 0; k < 5; k++)
886 for(i = 0; i <= ncell; i++)
888 if(cluster[i][0] != 0)
892 for(j = 1; j <= i1; j++)
894 sum += str[cluster[i][j]];
897 for(j = 1; j <= i1; j++)
900 str1[i2] += z[i]*str[i2]/sum;
901 clustcell[i2][i] = z[i]*str[i2]/sum;
907 for(j = 0; j <= nclust; j++)
914 for(i = 0; i <= nclust; i++)
920 for(j = 0; j <= ncell; j++)
922 if(clustcell[i][j] != 0)
924 sumx += clustcell[i][j]*x[j];
925 sumy += clustcell[i][j]*y[j];
926 sum += clustcell[i][j];
927 sum1 += clustcell[i][j]/z[j];
930 //** xcl and ycl are cluster centroid positions ( center of gravity )
938 for(j = 0; j <= ncell; j++)
940 sumxx += clustcell[i][j]*(x[j]-xcl[i])*(x[j]-xcl[i])/sum;
941 sumyy += clustcell[i][j]*(y[j]-ycl[i])*(y[j]-ycl[i])/sum;
942 sumxy += clustcell[i][j]*(x[j]-xcl[i])*(y[j]-ycl[i])/sum;
945 c = sumxx*sumyy-sumxy*sumxy;
946 // ******************r1 and r2 are major and minor axes ( r1 > r2 ).
947 r1 = b/2.+TMath::Sqrt(b*b/4.-c);
948 r2 = b/2.-TMath::Sqrt(b*b/4.-c);
949 // final assignments to proper external variables
959 //To get the cell position in a cluster
961 for(Int_t ii=0; ii<= ncell; ii++)
963 Int_t jj = cluster[ii][0];
964 for(Int_t kk=1; kk<= jj; kk++)
966 Int_t ll = cluster[ii][kk];
968 cell[ll][cell[ll][0]] = ii;
972 testncl.Set(nclust+1);
975 for(Int_t ii=0; ii <= nclust; ii++)
977 testncl[ii] = cell[ii][0];
978 counter += testncl[ii];
980 testindex.Set(counter);
982 for(Int_t ii=0; ii<= nclust; ii++)
984 for(Int_t jj = 1; jj<= testncl[ii]; jj++)
986 Int_t kk = cell[ii][jj];
1000 for(j = 0; j <= ncell; j++)
1013 for(j = 0; j <= ncell; j++)
1015 sumxx += clustcell[i][j]*(x[j]-xcl[i])*(x[j]-xcl[i])/sum;
1016 sumyy += clustcell[i][j]*(y[j]-ycl[i])*(y[j]-ycl[i])/sum;
1017 sumxy += clustcell[i][j]*(x[j]-xcl[i])*(y[j]-ycl[i])/sum;
1020 c = sumxx*sumyy-sumxy*sumxy;
1021 r1 = b/2.+ TMath::Sqrt(b*b/4.-c);
1022 r2 = b/2.- TMath::Sqrt(b*b/4.-c);
1024 // To get the cell position in a cluster
1025 testncl.Set(nclust+1);
1026 testindex.Set(ncell+1);
1027 cell[0][0] = ncell + 1;
1028 testncl[0] = cell[0][0];
1030 for(Int_t ii = 1; ii <= ncell; ii++)
1033 Int_t kk = cell[0][ii];
1037 // final assignments
1045 for(i = 0; i < kndim3; i++)
1047 delete [] clustcell[i];
1050 delete [] clustcell;
1052 for(i = 0; i <kndim1 ; i++)
1054 delete [] cluster[i];
1064 // ------------------------------------------------------------------------ //
1065 Double_t AliPMDClusteringV2::Distance(Double_t x1, Double_t y1,
1066 Double_t x2, Double_t y2)
1068 return TMath::Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
1070 // ------------------------------------------------------------------------ //
1071 void AliPMDClusteringV2::SetEdepCut(Float_t decut)
1075 // ------------------------------------------------------------------------ //
1076 void AliPMDClusteringV2::SetClusteringParam(Int_t cluspar)
1078 fClusParam = cluspar;
1080 // ------------------------------------------------------------------------ //