]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderSPD.cxx
Generate also hits in the amplification region
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderSPD.cxx
index 6712ac332633f2dcda15c9ca57d1081453901976..f24fa7382d9961e439cf0ae92d8db550b444b5a7 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/*
+$Log$
+Revision 1.14  2001/03/05 14:48:46  nilsen
+Fixed a reoccuring bug. Array sizes must be declare const.
 
+*/
+
+#include <iostream.h>
 #include "AliITSClusterFinderSPD.h"
 #include "AliITSMapA1.h"
 #include "AliITS.h"
@@ -39,7 +46,7 @@ AliITSClusterFinderSPD::AliITSClusterFinderSPD
     fNclusters= fClusters->GetEntriesFast();
     SetDx();
     SetDz();
-    fMap=new AliITSMapA1(fSegmentation,fDigits);
+    SetMap();
     SetNCells();
 }
 
@@ -200,22 +207,12 @@ void AliITSClusterFinderSPD::Find1DClusters()
             Float_t fRphiPitch = fSegmentation->Dpx(dummy);
            clusterX /= (clusterSizeX/fRphiPitch); // center of gravity for x 
            
-           
-           //printf("ClusterZ ClusterX %f %f \n",clusterZ, clusterX);
-           
-            // Int_t nclusters = fClusters->GetEntriesFast();
-           //              cout << nclusters << " clusters" << endl;
-           //            cout<< "Create point"<<endl;
-           
            // Write the points (coordinates and some cluster information) to the
            // AliITSRawClusterSPD object
            
            AliITSRawClusterSPD *clust = new AliITSRawClusterSPD(clusterZ,clusterX,clusterCharge,clusterSizeZ,clusterSizeX,xstart,xstop,xstartfull,xstopfull,zstart,zstop,k);
-           // fClusters->Add(point);
+
            iTS->AddCluster(0,clust);
-           //              cout << "Cluster at Ladder: " << fLadder << ", Detector: " <<fDetector<<endl;
-           
-           // cout<<" end of cluster finding for Z pixel "<<endl;
            
       }    // new cluster (ilcl=1)
     } // X direction loop (it)
@@ -235,7 +232,7 @@ void  AliITSClusterFinderSPD::GroupClusters()
   // get number of clusters for this module
   Int_t nofClusters = fClusters->GetEntriesFast();
   nofClusters -= fNclusters;
-  
+
   AliITSRawClusterSPD *clusterI;
   AliITSRawClusterSPD *clusterJ;
   
@@ -252,27 +249,34 @@ void  AliITSClusterFinderSPD::GroupClusters()
       if(pair) {     
        
        //    if((clusterI->XStop() == clusterJ->XStart()-1)||(clusterI->XStart()==clusterJ->XStop()+1)) cout<<"!! Diagonal cluster"<<endl;
-       /*      
-      cout << "clusters " << i << "," << j << " before grouping" << endl;
+
+       /*
+             cout << "clusters " << i << "," << j << " before grouping" << endl;
              clusterI->PrintInfo();
              clusterJ->PrintInfo();
-       */    
+       */
+
        clusterI->Add(clusterJ);
-       //        cout << "remove cluster " << j << endl;
+       //      cout << "remove cluster " << j << endl;
        label[j] = 1;
        fClusters->RemoveAt(j);
+
        /*
          cout << "cluster  " << i << " after grouping" << endl;
          clusterI->PrintInfo();
        */
+
       }  // pair
     } // J clusters  
     label[i] = 1;
   } // I clusters
   fClusters->Compress();
-  //  Int_t totalNofClusters = fClusters->GetEntriesFast();
-  //  cout << " Nomber of clusters at the group end ="<< totalNofClusters<<endl;
-  
+
+  /*
+    Int_t totalNofClusters = fClusters->GetEntriesFast();
+    cout << " Nomber of clusters at the group end ="<< totalNofClusters<<endl;
+  */
+
   delete [] label;
 
   return;
@@ -290,20 +294,16 @@ void AliITSClusterFinderSPD::TracksInCluster()
   Int_t nofClusters = fClusters->GetEntriesFast();
   nofClusters -= fNclusters;
 
-  //printf("nofClusters fNclusters %d %d\n",nofClusters,fNclusters);   //commented 18-09-00
-
   Int_t i, ix, iz, jx, jz, xstart, xstop, zstart, zstop, nclx, nclz;
-  //  Int_t signal, track0, track1, track2;
   const Int_t trmax = 100;
   Int_t cltracks[trmax], itr, tracki, ii, is, js, ie, ntr, tr0, tr1, tr2;
 
   for(i=0; i<nofClusters; i++) { 
     ii = 0;
     memset(cltracks,-1,sizeof(int)*trmax);
-    tr0=tr1=tr2=-3;
+    tr0=tr1=tr2=-1;
 
     AliITSRawClusterSPD *clusterI = (AliITSRawClusterSPD*) fClusters->At(i);
-    //printf("clusterI %p\n",clusterI);               //commented 18-09-00
 
     nclx = clusterI->NclX();
     nclz = clusterI->NclZ();
@@ -311,7 +311,6 @@ void AliITSClusterFinderSPD::TracksInCluster()
     xstop = clusterI->XStopf();
     zstart = clusterI->Zend()-nclz+1;
     zstop = clusterI->Zend();
-
     Int_t ind; 
 
      for(iz=0; iz<nclz; iz++) { 
@@ -319,11 +318,9 @@ void AliITSClusterFinderSPD::TracksInCluster()
        for(ix=0; ix<nclx; ix++) { 
         jx = xstart + ix;
         ind = fMap->GetHitIndex(jz,jx);
-        //printf("ind %d\n",ind);                              // commented 18-09-00
-        // this part must be wrong - the index of the digit 
-        // can be zero but not -1 !!! comment out this part
-        // and replace it - see below
-        /*
+        if(ind < 0) {
+          continue;
+         }
         if(ind == 0 && iz >= 0 && ix > 0) {
           continue;
          }
@@ -333,24 +330,23 @@ void AliITSClusterFinderSPD::TracksInCluster()
         if(ind == 0 && iz == 0 && ix == 0 && i > 0) {
           continue;
          }
-        */
-        // change the conditions above to :
-        if (ind < 0) continue;
 
         AliITSdigitSPD *dig = (AliITSdigitSPD*)fMap->GetHit(jz,jx);
-       if (!dig) printf("SPD: something wrong ! dig %p\n",dig);
+
        /*
          signal=dig->fSignal;
          track0=dig->fTracks[0];
          track1=dig->fTracks[1];
          track2=dig->fTracks[2];
        */
+
           for(itr=0; itr<3; itr++) { 
            tracki = dig->fTracks[itr];
-           //printf("tracki %d\n",tracki);                        //commented 18-09-00
             if(tracki >= 0) {
              ii += 1;
-             cltracks[ii-1] = tracki;
+             if(ii > 90) { 
+             }
+             if(ii < 99) cltracks[ii-1] = tracki;
             }
          }
        } // ix pixel
@@ -425,7 +421,7 @@ void AliITSClusterFinderSPD::GetRecPoints()
 }
 //_____________________________________________________________________________
 
-void AliITSClusterFinderSPD::FindRawClusters()
+void AliITSClusterFinderSPD::FindRawClusters(Int_t mod)
 {
   // find raw clusters
   Find1DClusters();
@@ -435,3 +431,5 @@ void AliITSClusterFinderSPD::FindRawClusters()
 
 }
 
+
+