]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderV2SPD.cxx
Remove AliTRDv2
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SPD.cxx
index f6349be2665710d6874724f03ebb73e1dc10e116..f92dabfecc00152c63c02ef3d54668d57168cccf 100644 (file)
 //                                                                        //
 ///////////////////////////////////////////////////////////////////////////
 
-#include "AliRun.h"
 
 #include "AliITSClusterFinderV2SPD.h"
-#include "AliITSclusterV2.h"
+#include "AliITSRecPoint.h"
+#include "AliITSDetTypeRec.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSPD.h"
-
 #include <TClonesArray.h>
-#include "AliITS.h"
-#include "AliITSgeom.h"
 #include "AliITSdigitSPD.h"
 
 ClassImp(AliITSClusterFinderV2SPD)
 
 extern AliRun *gAlice;
 
-AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD():AliITSClusterFinderV2(){
+AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD(AliITSDetTypeRec* dettyp):AliITSClusterFinderV2(dettyp){
 
   //Default constructor
-  AliITSgeom *geom=(AliITSgeom*)fITS->GetITSgeom();
 
+  fLastSPD1=fDetTypeRec->GetITSgeom()->GetModuleIndex(2,1,1)-1;
 
-  fLastSPD1=geom->GetModuleIndex(2,1,1)-1;
   fNySPD=256; fNzSPD=160;
   fYpitchSPD=0.0050;
   fZ1pitchSPD=0.0425; fZ2pitchSPD=0.0625;
@@ -196,17 +192,17 @@ Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,T
        hit[1] = -z+fZshift[iModule];
        hit[2] = fYpitchSPD*fYpitchSPD/12.;
        hit[3] = fZ1pitchSPD*fZ1pitchSPD/12.;
-       hit[4] = (zmax-zmin+1)*100 + (ymax-ymin+1);
+       hit[4] = 1.;
        if(!rawdata) milab[3]=fNdet[iModule];
        Int_t info[3] = {ymax-ymin+1,zmax-zmin+1,fNlayer[iModule]};
        if(!rawdata){
-        AliITSclusterV2 cl(milab,hit,info); 
-        fITS->AddClusterV2(cl);
+        AliITSRecPoint cl(iModule,fDetTypeRec->GetITSgeom(),milab,hit,info);
+        fDetTypeRec->AddRecPoint(cl);
        }
         else{
          Int_t label[4]={milab[0],milab[1],milab[2],milab[3]};
          new (clusters->AddrAt(nclu)) 
-               AliITSclusterV2(label, hit,info);
+               AliITSRecPoint(iModule,fDetTypeRec->GetITSgeom(),label, hit,info);
        } 
        nclu++;
       }// for iiy
@@ -229,6 +225,8 @@ void AliITSClusterFinderV2SPD::FindClustersSPD(AliITSRawStream* input,
   Int_t kNzBins = fNzSPD + 2;
   Int_t kNyBins = fNySPD + 2;
   Int_t kMaxBin = kNzBins * kNyBins;
+  AliBin *binsSPD = new AliBin[kMaxBin];
+  AliBin *binsSPDInit = new AliBin[kMaxBin];  
   AliBin* bins = NULL;
 
   // read raw data input stream
@@ -239,14 +237,15 @@ void AliITSClusterFinderV2SPD::FindClustersSPD(AliITSRawStream* input,
 
       // when all data from a module was read, search for clusters
       if (bins) { 
-       clusters[iModule] = new TClonesArray("AliITSclusterV2");
+       clusters[iModule] = new TClonesArray("AliITSRecPoint");
        Int_t nClusters = ClustersSPD(bins,0,clusters[iModule],kMaxBin,kNzBins,iModule,kTRUE);
        nClustersSPD += nClusters;
-       delete bins;
+       bins = NULL;
       }
 
       if (!next) break;
-      bins = new AliBin[kMaxBin];
+      bins = binsSPD;
+      memcpy(binsSPD,binsSPDInit,sizeof(AliBin)*kMaxBin);
     }
 
     // fill the current digit into the bins array
@@ -256,6 +255,9 @@ void AliITSClusterFinderV2SPD::FindClustersSPD(AliITSRawStream* input,
     bins[index].SetQ(1);
   }
 
+  delete [] binsSPDInit;
+  delete [] binsSPD;
+  
   Info("FindClustersSPD", "found clusters in ITS SPD: %d", nClustersSPD);
 }