- y /= q;
- z /= q;
- y -= fHwSPD;
- z -= fHlSPD;
-
- Float_t hit[5]; // y, z, sigma(y)^2, sigma(z)^2, charge
- hit[0] = -y-fYshift[iModule];
- if (iModule <= fLastSPD1) hit[0] = -hit[0];
- hit[1] = z+fZshift[iModule];
- hit[2] = fYpitchSPD*fYpitchSPD/12.;
- hit[3] = fZ1pitchSPD*fZ1pitchSPD/12.;
-// hit[4] = q;
- hit[4] = (zmax-zmin+1)*100 + (ymax-ymin+1);
-
- CheckLabels(label);
- Int_t info[3]={0,0,0};
- new (clusters[iModule]->AddrAt(nClusters))
- AliITSclusterV2(label, hit,info);
- nClusters++;
+
+ Int_t idy = 0; // max 2 clusters
+ if ((iModule <= fLastSPD1) &&idy<3) idy=3;
+ if ((iModule > fLastSPD1) &&idy<4) idy=4;
+ Int_t idz =3;
+ for (Int_t iiz=zmin; iiz<=zmax;iiz+=idz)
+ for (Int_t iiy=ymin; iiy<=ymax;iiy+=idy){
+ //
+ Int_t ndigits =0;
+ Float_t y=0.,z=0.,q=0.;
+ for (Int_t idx = 0; idx < nBins; idx++) {
+ Int_t iy = (idxBins[idx] / kNzBins) - 1;
+ Int_t iz = (idxBins[idx] % kNzBins) - 1;
+ if (zmax-zmin>=idz || ymax-ymin>=idy){
+ if (TMath::Abs(iy-iiy)>0.75*idy) continue;
+ if (TMath::Abs(iz-iiz)>0.75*idz) continue;
+ }
+ ndigits++;
+ Float_t qBin = bins[idxBins[idx]].GetQ();
+ y += qBin * fYSPD[iy];
+ z += qBin * fZSPD[iz];
+ q += qBin;
+ }
+ if (ndigits==0) continue;
+ y /= q;
+ z /= q;
+ y -= fHwSPD;
+ z -= fHlSPD;
+
+ Float_t hit[5]; // y, z, sigma(y)^2, sigma(z)^2, charge
+ hit[0] = -(-y+fYshift[iModule]);
+ if (iModule <= fLastSPD1) hit[0] = -hit[0];
+ hit[1] = -z+fZshift[iModule];
+ hit[2] = fYpitchSPD*fYpitchSPD/12.;
+ hit[3] = fZ1pitchSPD*fZ1pitchSPD/12.;
+ // hit[4] = q;
+ hit[4] = (zmax-zmin+1)*100 + (ymax-ymin+1);
+ // CheckLabels(label);
+ Int_t info[3]={ymax-ymin+1,zmax-zmin+1,fNlayer[iModule]};
+ new (clusters[iModule]->AddrAt(nClusters))
+ AliITSclusterV2(label, hit,info);
+ nClusters++;
+ }