- Int_t currentstripNo;
- Int_t *dbuffer = new Int_t [300]; //buffer for strip numbers
- Int_t dnumber; //curent number of digits in buffer
- TArrayI &lDigitsIndexP = *fDigitsIndexP;
- TArrayI &lDigitsIndexN = *fDigitsIndexN;
- TObjArray &lDigits = *(Digits());
- TClonesArray &lClusterP = *fClusterP;
- TClonesArray &lClusterN = *fClusterN;
-
- //process P side
- dnumber = 1;
- dbuffer[0]=lDigitsIndexP[0];
- //If next digit is a neighbour of previous, adds to last cluster this digit
- for (i=1; i<fNDigitsP; i++) {
- //reads new digit
- currentstripNo = ((AliITSdigitSSD*)lDigits[lDigitsIndexP[i]])->
- GetStripNumber();
- //check if it is a neighbour of a previous one
- if ( (((AliITSdigitSSD*)lDigits[lDigitsIndexP[i-1]])->GetStripNumber())
- == (currentstripNo-1) ) dbuffer[dnumber++]=lDigitsIndexP[i];
- else {
- //create a new one side cluster
- new(lClusterP[fNClusterP++]) AliITSclusterSSD(dnumber,dbuffer,Digits(),fgkSIDEP);
- dbuffer[0]=lDigitsIndexP[i];
- dnumber = 1;
- }
- } // end loop over fNDigitsP
- new(lClusterP[fNClusterP++]) AliITSclusterSSD(dnumber,dbuffer,Digits(),fgkSIDEP);
-
-
- //process N side
- //for comments, see above
- dnumber = 1;
- dbuffer[0]=lDigitsIndexN[0];
- //If next digit is a neighbour of previous, adds to last cluster this digit
- for (i=1; i<fNDigitsN; i++) {
- currentstripNo = ((AliITSdigitSSD*)(lDigits[lDigitsIndexN[i]]))->
- GetStripNumber();
- if ( (((AliITSdigitSSD*)lDigits[lDigitsIndexN[i-1]])->GetStripNumber())
- == (currentstripNo-1) ) dbuffer[dnumber++]=lDigitsIndexN[i];
- else {
- new(lClusterN[fNClusterN++]) AliITSclusterSSD(dnumber,dbuffer,Digits(),fgkSIDEN);
- dbuffer[0]=lDigitsIndexN[i];
- dnumber = 1;
- }
- } // end loop over fNDigitsN
- new(lClusterN[fNClusterN++]) AliITSclusterSSD(dnumber,dbuffer,Digits(),fgkSIDEN);
- delete [] dbuffer;
-
- } // end condition on NDigits
-
- if (debug) cout<<"\n Found clusters: fNClusterP = "<<fNClusterP<<" fNClusterN ="<<fNClusterN<<"\n";
-
-}
-
-//--------------------------------------------------------------
-
-void AliITSClusterFinderSSD::SeparateOverlappedClusters()
-{
-// overlapped clusters separation
+ new(lClusterP[fNClusterP++]) AliITSclusterSSD(dnumber,dbuffer,
+ Digits(),
+ fgkSIDEP);
+
+ flag=0;
+ }
+
+ flag=0;
+
+ //process N side
+ //for comments, see above
+ dnumber = 1;
+ dbuffer[0]=lDigitsIndexN[0];
+ //If next digit is a neigh. of previous, adds to last clust. this digit
+
+ // cout<<" Nside"<<endl;
+ // cout<<" "<<((AliITSdigitSSD*)lDigits[lDigitsIndexN[0]])->GetStripNumber()<<" "<<
+ // ((AliITSdigitSSD*)lDigits[lDigitsIndexN[0]])->GetSignal()<<endl;
+
+ for (i=1; i<fNDigitsN; i++) {
+ currentstripNo = ((AliITSdigitSSD*)(lDigits[lDigitsIndexN[i]]))->GetStripNumber();
+ // cout<<" "<<currentstripNo<<" "<<((AliITSdigitSSD*)lDigits[lDigitsIndexN[i]])->GetSignal()<<endl;
+
+ if ( (((AliITSdigitSSD*)lDigits[lDigitsIndexN[i-1]])->GetStripNumber()) == (currentstripNo-1) )
+ dbuffer[dnumber++]=lDigitsIndexN[i];
+
+ else {
+
+ // check signal
+ for(j=0;j<dnumber;j++) {
+
+ if( (((AliITSdigitSSD*)lDigits[dbuffer[j]])->GetSignal())
+ > fgkNoiseThreshold*((AliITSCalibrationSSD*)GetResp(module))->
+ GetNoiseN( ((AliITSdigitSSD*)lDigits[dbuffer[j]])->GetStripNumber()) )
+ flag+=1;
+
+ }
+
+ //if(flag==dnumber) {
+ if(flag>0) {
+ //create a new one side cluster
+
+ // cout<<" new cluster with "<<dnumber<<" digits"<<endl;
+
+ new(lClusterN[fNClusterN++]) AliITSclusterSSD(dnumber,dbuffer,
+ Digits(),
+ fgkSIDEN);
+
+ flag=0;
+ }
+
+ flag=0;
+ dbuffer[0]=lDigitsIndexN[i];
+ dnumber = 1;
+ } // end if else
+ } // end loop over fNDigitsN
+
+ // check signal
+ for(j=0;j<dnumber;j++) {
+
+ if( (((AliITSdigitSSD*)lDigits[dbuffer[j]])->GetSignal())
+ > fgkNoiseThreshold*((AliITSCalibrationSSD*)GetResp(module))->
+ GetNoiseN( ((AliITSdigitSSD*)lDigits[dbuffer[j]])->GetStripNumber()) )
+ flag+=1;
+
+ }
+
+ //if(flag==dnumber) {
+ if(flag>0) {
+ //create a new one side cluster