]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderV2SPD.cxx
- AliITSInitGeometry.cxx (updated): fgkOldSSDcone changed from kTRUE to
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SPD.cxx
index cda2cda345cc04f179ebeef3858f4fa0baf6f00c..c574df15f39206eb91aa154dae4c36ee754fdd92 100644 (file)
 //            Implementation of the ITS clusterer V2 class                //
 //                                                                        //
 //          Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch            //
+//          Unfolding switch from AliITSRecoParam: D. Elia, INFN Bari     //
 //                                                                        //
-///////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
 
 
 #include "AliITSClusterFinderV2SPD.h"
-#include "AliITSclusterV2.h"
+#include "AliITSRecPoint.h"
+#include "AliITSgeomTGeo.h"
 #include "AliITSDetTypeRec.h"
+#include "AliITSReconstructor.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSPD.h"
-
 #include <TClonesArray.h>
-#include "AliITSgeom.h"
 #include "AliITSdigitSPD.h"
 
 ClassImp(AliITSClusterFinderV2SPD)
 
-extern AliRun *gAlice;
-
-AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD(AliITSgeom* geom):AliITSClusterFinderV2(geom){
+AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD(AliITSDetTypeRec* dettyp):AliITSClusterFinderV2(dettyp),
+fLastSPD1(AliITSgeomTGeo::GetModuleIndex(2,1,1)-1),
+fNySPD(256),
+fNzSPD(160),
+fYpitchSPD(0.0050),
+fZ1pitchSPD(0.0425),
+fZ2pitchSPD(0.0625),
+fHwSPD(0.64),
+fHlSPD(3.48){
 
   //Default constructor
 
-  fITSgeom = geom;
-  fLastSPD1=fITSgeom->GetModuleIndex(2,1,1)-1;
-
-  fNySPD=256; fNzSPD=160;
-  fYpitchSPD=0.0050;
-  fZ1pitchSPD=0.0425; fZ2pitchSPD=0.0625;
-  fHwSPD=0.64; fHlSPD=3.48;
   fYSPD[0]=0.5*fYpitchSPD;
   for (Int_t m=1; m<fNySPD; m++) fYSPD[m]=fYSPD[m-1]+fYpitchSPD; 
   fZSPD[0]=fZ1pitchSPD;
@@ -86,6 +86,16 @@ Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,T
   
   //Cluster finder for SPD (from digits and from rawdata)
 
+  static AliITSRecoParam *repa = NULL;
+  if(!repa){
+    repa = (AliITSRecoParam*) AliITSReconstructor::GetRecoParam();
+    if(!repa){
+      repa = (AliITSRecoParam*) AliITSReconstructor::GetRecoParamDefault();
+      AliWarning("Using default AliITSRecoParam class");
+    }
+  }
+  const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(iModule);
+  
   Int_t nclu=0;
   for(Int_t iBin =0; iBin < maxBins;iBin++){
     if(bins[iBin].IsUsed()) continue;
@@ -152,6 +162,13 @@ Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,T
     if((iModule <= fLastSPD1) &&idy<3) idy=3;
     if((iModule > fLastSPD1) &&idy<4) idy=4;
     Int_t idz=3;
+
+    // Switch the unfolding OFF/ON
+    if(!repa->GetUseUnfoldingInClusterFinderSPD()) {
+      idy=ymax-ymin+1;
+      idz=zmax-zmin+1;
+    }
     for(Int_t iiz=zmin; iiz<=zmax;iiz+=idz){
       for(Int_t iiy=ymin;iiy<=ymax;iiy+=idy){
 
@@ -189,23 +206,28 @@ Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,T
        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];
+        {
+        Double_t loc[3]={y,0.,z},trk[3]={0.,0.,0.};
+        mT2L->MasterToLocal(loc,trk);
+        hit[0]=trk[1];
+        hit[1]=trk[2];
+       }
        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); 
-        fDetTypeRec->AddClusterV2(cl);
+        AliITSRecPoint cl(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(label, hit,info);
        } 
        nclu++;
       }// for iiy
@@ -240,7 +262,7 @@ 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;
        bins = NULL;
@@ -261,7 +283,7 @@ void AliITSClusterFinderV2SPD::FindClustersSPD(AliITSRawStream* input,
   delete [] binsSPDInit;
   delete [] binsSPD;
   
-  Info("FindClustersSPD", "found clusters in ITS SPD: %d", nClustersSPD);
+  AliDebug(1,Form("found clusters in ITS SPD: %d", nClustersSPD));
 }
 
 
@@ -289,8 +311,10 @@ void AliITSClusterFinderV2SPD::FindClustersSPD(TClonesArray *digits) {
      bins[index].SetMask(1);
   }
    
-  ClustersSPD(bins,digits,0,kMAXBIN,kNzBins,fModule,kFALSE); 
+  Int_t nClustersSPD = ClustersSPD(bins,digits,0,kMAXBIN,kNzBins,fModule,kFALSE); 
   delete [] bins;
+
+  AliDebug(1,Form("found clusters in ITS SPD: %d", nClustersSPD));
 }