]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderSPD.cxx
AliITSgeom taken from loader
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderSPD.cxx
index 33e580fa870d0adbfd77802e158a8336f567b4b1..f25750ecfd74bb236ed0db0dc3d18a45e6a2f1ef 100644 (file)
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////        
 
-#include "AliITS.h"
 #include "AliITSClusterFinderSPD.h"
+#include "AliITSDetTypeRec.h"
 #include "AliITSRawClusterSPD.h"
 #include "AliITSRecPoint.h"
 #include "AliITSdigitSPD.h"
-#include "AliITSresponseSPD.h"
 #include "AliITSsegmentationSPD.h"
 #include "AliLog.h"
-#include "AliRun.h"
 
 //#define DEBUG
 
@@ -40,9 +38,8 @@ fMinNCells(0){
     // constructor
 }
 //----------------------------------------------------------
-AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg,
-                                               AliITSresponse *res):
-AliITSClusterFinder(seg,res),
+AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSDetTypeRec* dettyp):
+AliITSClusterFinder(dettyp),
 fDz(0.0),
 fDx(0.0),
 fMinNCells(0){
@@ -52,10 +49,10 @@ fMinNCells(0){
     SetDz();
 }
 //----------------------------------------------------------
-AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg,
+AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSDetTypeRec* dettyp,
                                                TClonesArray *digits,
                                                TClonesArray *recp):
-AliITSClusterFinder(seg,0),
+AliITSClusterFinder(dettyp,digits),
 fDz(0.0),
 fDx(0.0),
 fMinNCells(0){
@@ -383,7 +380,7 @@ void AliITSClusterFinderSPD::ClusterFinder(Int_t ndigits,Int_t digx[],
                                                              (Double_t) ndzmin,
                                                              (Double_t) ndzmax,
                                                              0,GetModule());
-        fITS->AddCluster(0,clust);
+       fDetTypeRec->AddCluster(0,clust);
         delete clust;
     }//end loop on clusters   
     delete[] ifpad;
@@ -407,6 +404,10 @@ void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus,
     Double_t l[3],xg,zg;
     const Double_t kconv = 1.0e-4; // micron -> cm
 
+    Int_t lay,lad,det;
+    fDetTypeRec->GetITSgeom()->GetModuleId(fModule,lay,lad,det);
+    Int_t ind=(lad-1)*fDetTypeRec->GetITSgeom()->GetNdetectors(lay)+(det-1);
+    Int_t lyr=(lay-1);
     // get rec points
     for (Int_t i=0; i<nclus; i++){
         l[0] = kconv*xcenter[i];
@@ -418,16 +419,17 @@ void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus,
 
         Double_t sigma2x = (kconv*errxcenter[i]) * (kconv*errxcenter[i]);
         Double_t sigma2z = (kconv*errzcenter[i]) * (kconv*errzcenter[i]);
-        AliITSRecPoint rnew;
-        rnew.SetX(xg);
-        rnew.SetZ(zg);
+        AliITSRecPoint rnew(fDetTypeRec->GetITSgeom());
+        rnew.SetXZ(fModule,xg,zg);
         rnew.SetQ(1.);
         rnew.SetdEdX(0.);
-        rnew.SetSigmaX2(sigma2x);
+        rnew.SetSigmaDetLocX2(sigma2x);
         rnew.SetSigmaZ2(sigma2z);
-        rnew.fTracks[0]=tr1clus[i];
-        rnew.fTracks[1]=tr2clus[i];
-        rnew.fTracks[2]=tr3clus[i];
-        fITS->AddRecPoint(rnew); 
+        rnew.SetLabel(tr1clus[i],0);
+        rnew.SetLabel(tr2clus[i],1);
+        rnew.SetLabel(tr3clus[i],2);
+       rnew.SetDetectorIndex(ind);
+       rnew.SetLayer(lyr);
+       fDetTypeRec->AddRecPoint(rnew); 
     } // end for i
 }