- clust[0][numcell]=id1;
- clust[1][numcell]=id2;
- for(i=1; i<5000; i++)clust[0][i]=0;
- // ---------------------------------------------------------------
- // check for adc count in neib. cells. If ne 0 put it in this clust
- // ---------------------------------------------------------------
- for(i=0; i<6; i++){
- jd1=id1+neibx[i];
- jd2=id2+neiby[i];
- if( (jd1 >= 0 && jd1 < kNDIMX) && (jd2 >= 0 && jd2 < kNDIMY) &&
- fInfocl[0][jd1][jd2] == 0){
- numcell=numcell+1;
- fInfocl[0][jd1][jd2]=2;
- fInfocl[1][jd1][jd2]=icl;
- clust[0][numcell]=jd1;
- clust[1][numcell]=jd2;
- cellcount=cellcount+1;
- fInfcl[0][cellcount]=icl;
- fInfcl[1][cellcount]=jd1;
- fInfcl[2][cellcount]=jd2;
- }
- }
- // ---------------------------------------------------------------
- // check adc count for neighbour's neighbours recursively and
- // if nonzero, add these to the cluster.
- // ---------------------------------------------------------------
- for(i=1;i < 5000;i++){
- if(clust[0][i] != 0){
- id1=clust[0][i];
- id2=clust[1][i];
- for(j=0; j<6 ; j++){
- jd1=id1+neibx[j];
- jd2=id2+neiby[j];
- if( (jd1 >= 0 && jd1 < kNDIMX) && (jd2 >= 0 && jd2 < kNDIMY) &&
- fInfocl[0][jd1][jd2] == 0 ){
- fInfocl[0][jd1][jd2] = 2;
- fInfocl[1][jd1][jd2] = icl;
- numcell = numcell + 1;
- clust[0][numcell] = jd1;
- clust[1][numcell] = jd2;
- cellcount = cellcount+1;
- fInfcl[0][cellcount] = icl;
- fInfcl[1][cellcount] = jd1;
- fInfcl[2][cellcount] = jd2;
+ for(icell = 0; icell <= nmx1; icell++)
+ {
+ id1 = fIord[0][icell];
+ id2 = fIord[1][icell];
+ if(fInfocl[0][id1][id2] == 0 )
+ {
+ icl++;
+ numcell = 0;
+ cellcount++;
+ fInfocl[0][id1][id2] = 1;
+ fInfocl[1][id1][id2] = icl;
+ fInfcl[0][cellcount] = icl;
+ fInfcl[1][cellcount] = id1;
+ fInfcl[2][cellcount] = id2;
+
+ clust[0][numcell] = id1;
+ clust[1][numcell] = id2;
+
+ for(i = 1; i < 5000; i++)
+ {
+ clust[0][i]=0;
+ }
+ // ---------------------------------------------------------------
+ // check for adc count in neib. cells. If ne 0 put it in this clust
+ // ---------------------------------------------------------------
+ for(i = 0; i < 6; i++)
+ {
+ jd1 = id1 + neibx[i];
+ jd2 = id2 + neiby[i];
+ if( (jd1 >= 0 && jd1 < kNDIMX) && (jd2 >= 0 && jd2 < kNDIMY) &&
+ fInfocl[0][jd1][jd2] == 0)
+ {
+ numcell++;
+ fInfocl[0][jd1][jd2] = 2;
+ fInfocl[1][jd1][jd2] = icl;
+ clust[0][numcell] = jd1;
+ clust[1][numcell] = jd2;
+ cellcount++;
+ fInfcl[0][cellcount] = icl;
+ fInfcl[1][cellcount] = jd1;
+ fInfcl[2][cellcount] = jd2;
+ }
+ }
+ // ---------------------------------------------------------------
+ // check adc count for neighbour's neighbours recursively and
+ // if nonzero, add these to the cluster.
+ // ---------------------------------------------------------------
+ for(i = 1; i < 5000;i++)
+ {
+ if(clust[0][i] != 0)
+ {
+ id1 = clust[0][i];
+ id2 = clust[1][i];
+ for(j = 0; j < 6 ; j++)
+ {
+ jd1 = id1 + neibx[j];
+ jd2 = id2 + neiby[j];
+ if( (jd1 >= 0 && jd1 < kNDIMX) &&
+ (jd2 >= 0 && jd2 < kNDIMY) &&
+ fInfocl[0][jd1][jd2] == 0 )
+ {
+ fInfocl[0][jd1][jd2] = 2;
+ fInfocl[1][jd1][jd2] = icl;
+ numcell++;
+ clust[0][numcell] = jd1;
+ clust[1][numcell] = jd2;
+ cellcount++;
+ fInfcl[0][cellcount] = icl;
+ fInfcl[1][cellcount] = jd1;
+ fInfcl[2][cellcount] = jd2;
+ }
+ }
+ }