]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderV2SPD.cxx
Do not delete the loader, it is not owned by the class. Remove clusters to avoid...
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SPD.cxx
index c0f11d4fbdbf3545d24e2362033cc0540f900ecb..f73d843d2fca9f17d0ec4144337cb9aded8b8d4a 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "AliITSClusterFinderV2SPD.h"
 #include "AliITSRecPoint.h"
+#include "AliITSgeomTGeo.h"
 #include "AliITSDetTypeRec.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSPD.h"
 
 ClassImp(AliITSClusterFinderV2SPD)
 
-extern AliRun *gAlice;
-
 AliITSClusterFinderV2SPD::AliITSClusterFinderV2SPD(AliITSDetTypeRec* dettyp):AliITSClusterFinderV2(dettyp),
-fLastSPD1(0),
+fLastSPD1(AliITSgeomTGeo::GetModuleIndex(2,1,1)-1),
 fNySPD(256),
 fNzSPD(160),
 fYpitchSPD(0.0050),
@@ -44,7 +43,6 @@ fHlSPD(3.48){
 
   //Default constructor
 
-  fLastSPD1=fDetTypeRec->GetITSgeom()->GetModuleIndex(2,1,1)-1;
   fYSPD[0]=0.5*fYpitchSPD;
   for (Int_t m=1; m<fNySPD; m++) fYSPD[m]=fYSPD[m-1]+fYpitchSPD; 
   fZSPD[0]=fZ1pitchSPD;
@@ -86,6 +84,8 @@ Int_t AliITSClusterFinderV2SPD::ClustersSPD(AliBin* bins, TClonesArray* digits,T
   
   //Cluster finder for SPD (from digits and from rawdata)
 
+  const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(iModule);
+  
   Int_t nclu=0;
   for(Int_t iBin =0; iBin < maxBins;iBin++){
     if(bins[iBin].IsUsed()) continue;
@@ -189,23 +189,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] = 1.;
+
        if(!rawdata) milab[3]=fNdet[iModule];
        Int_t info[3] = {ymax-ymin+1,zmax-zmin+1,fNlayer[iModule]};
        if(!rawdata){
-        AliITSRecPoint cl(iModule,fDetTypeRec->GetITSgeom(),milab,hit,info);
+        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)) 
-               AliITSRecPoint(iModule,fDetTypeRec->GetITSgeom(),label, hit,info);
+               AliITSRecPoint(label, hit,info);
        } 
        nclu++;
       }// for iiy