]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderSDD.cxx
Improved access to AliITSgeom in reconstruction
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderSDD.cxx
index 7494c78a702508f556621275ed81968961883744..6430c48401dbf5250c004ecdd72cfcc3b610c72b 100644 (file)
@@ -28,7 +28,7 @@
 #include "AliITSRecPoint.h"
 #include "AliITSdigitSDD.h"
 #include "AliITSDetTypeRec.h"
-#include "AliITSresponseSDD.h"
+#include "AliITSCalibrationSDD.h"
 #include "AliITSsegmentationSDD.h"
 #include "AliLog.h"
 
@@ -69,7 +69,7 @@ fMaxNCells(0){
     SetCutAmplitude(fDetTypeRec->GetITSgeom()->GetStartSDD());
     SetDAnode();
     SetDTime();
-    SetMinPeak((Int_t)(((AliITSresponseSDD*)GetResp(fDetTypeRec->GetITSgeom()->GetStartSDD()))->
+    SetMinPeak((Int_t)(((AliITSCalibrationSDD*)GetResp(fDetTypeRec->GetITSgeom()->GetStartSDD()))->
                        GetNoiseAfterElectronics()*5));
     //    SetMinPeak();
     SetMinNCells();
@@ -84,7 +84,7 @@ void AliITSClusterFinderSDD::SetCutAmplitude(Int_t mod,Double_t nsigma){
     Double_t baseline,noise,noiseAfterEl;
 
     GetResp(mod)->GetNoiseParam(noise,baseline);
-    noiseAfterEl = ((AliITSresponseSDD*)GetResp(mod))->GetNoiseAfterElectronics();
+    noiseAfterEl = ((AliITSCalibrationSDD*)GetResp(mod))->GetNoiseAfterElectronics();
     fCutAmplitude = (Int_t)((baseline + nsigma*noiseAfterEl));
 }
 //______________________________________________________________________
@@ -98,7 +98,7 @@ void AliITSClusterFinderSDD::Find1DClusters(){
     Int_t dummy          = 0;
     Double_t fTimeStep    = GetSeg()->Dpx(dummy);
     Double_t fSddLength   = GetSeg()->Dx();
-    Double_t fDriftSpeed  = GetResp(fModule)->DriftSpeed();  
+    Double_t fDriftSpeed  = GetResp(fModule)->GetDriftSpeed();  
     Double_t anodePitch   = GetSeg()->Dpz(dummy);
 
     // map the signal
@@ -251,7 +251,7 @@ void AliITSClusterFinderSDD::Find1DClustersE(){
     Int_t dummy=0;
     Double_t fTimeStep = GetSeg()->Dpx( dummy );
     Double_t fSddLength = GetSeg()->Dx();
-    Double_t fDriftSpeed = GetResp(fModule)->DriftSpeed();
+    Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
     Double_t anodePitch = GetSeg()->Dpz( dummy );
     Double_t n, baseline;
     GetResp(fModule)->GetNoiseParam( n, baseline );
@@ -259,7 +259,7 @@ void AliITSClusterFinderSDD::Find1DClustersE(){
     Map()->ClearMap();
     Map()->SetThreshold( fCutAmplitude );
     Map()->FillMap();
-    
+
     Int_t nClu = 0;
     //        cout << "Search  cluster... "<< endl;
     for( Int_t j=0; j<2; j++ ){
@@ -415,7 +415,7 @@ void AliITSClusterFinderSDD::PeakFunc( Int_t xdim, Int_t zdim, Double_t *par,
     //                 par[i+2] = zpos
     //                 par[i+3] = tau
     //                 par[i+4] = sigma.
-    Int_t electronics = GetResp(fModule)->Electronics(); // 1 = PASCAL, 2 = OLA
+    Int_t electronics = GetResp(fModule)->GetElectronics(); // 1 = PASCAL, 2 = OLA
     const Int_t knParam = 5;
     Int_t npeak = (Int_t)par[0];
 
@@ -694,11 +694,11 @@ void AliITSClusterFinderSDD::ResolveClusters(){
     Int_t dummy=0;
     Double_t fTimeStep = GetSeg()->Dpx( dummy );
     Double_t fSddLength = GetSeg()->Dx();
-    Double_t fDriftSpeed = GetResp(fModule)->DriftSpeed();
+    Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
     Double_t anodePitch = GetSeg()->Dpz( dummy );
     Double_t n, baseline;
     GetResp(fModule)->GetNoiseParam( n, baseline );
-    Int_t electronics = GetResp(fModule)->Electronics(); // 1 = PASCAL, 2 = OLA
+    Int_t electronics =GetResp(fModule)->GetElectronics(); // 1 = PASCAL, 2 = OLA
 
     for( Int_t j=0; j<nofClusters; j++ ){ 
         // get cluster information
@@ -928,6 +928,13 @@ void AliITSClusterFinderSDD::GetRecPoints(){
     Int_t ix, iz, idx=-1;
     AliITSdigitSDD *dig=0;
     Int_t ndigits=NDigits();
+
+    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);
+
+
     for(i=0; i<nofClusters; i++) { 
         AliITSRawClusterSDD *clusterI = (AliITSRawClusterSDD*)Cluster(i);
         if(!clusterI) Error("SDD: GetRecPoints","i clusterI ",i,clusterI);
@@ -944,18 +951,18 @@ void AliITSClusterFinderSDD::GetRecPoints(){
             if (!dig) dig = (AliITSdigitSDD*)Map()->GetHit(iz-1,ix+1); 
             if (!dig) printf("SDD: cannot assign the track number!\n");
         } //  end if !dig
-        AliITSRecPoint rnew;
-        rnew.SetX(clusterI->X());
-        rnew.SetZ(clusterI->Z());
+        AliITSRecPoint rnew(fDetTypeRec->GetITSgeom());
+       rnew.SetXZ(fModule,clusterI->X(),clusterI->Z());
         rnew.SetQ(clusterI->Q());   // in KeV - should be ADC
         rnew.SetdEdX(kconvGeV*clusterI->Q());
-        rnew.SetSigmaX2(kRMSx*kRMSx);
+        rnew.SetSigmaDetLocX2(kRMSx*kRMSx);
         rnew.SetSigmaZ2(kRMSz*kRMSz);
 
-        if(dig) rnew.fTracks[0]=dig->GetTrack(0);
-        if(dig) rnew.fTracks[1]=dig->GetTrack(1);
-        if(dig) rnew.fTracks[2]=dig->GetTrack(2);
-
+        if(dig) rnew.SetLabel(dig->GetTrack(0),0);
+        if(dig) rnew.SetLabel(dig->GetTrack(1),1);
+        if(dig) rnew.SetLabel(dig->GetTrack(2),2);
+       rnew.SetDetectorIndex(ind);
+       rnew.SetLayer(lyr);
        fDetTypeRec->AddRecPoint(rnew);        
     } // I clusters
 //    Map()->ClearMap();