]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderV2SDD.cxx
fix in calling of gaussian spread function
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SDD.cxx
index 616932b677966a4e4ff6ecaf88426398bc98d001..a565b63ef064117ff04a0f458dbc8dd6928e0c3b 100644 (file)
@@ -28,6 +28,7 @@
 #include <TBits.h>
 #include "AliITSClusterFinderV2SDD.h"
 #include "AliITSRecPoint.h"
+#include "AliITSRecPointContainer.h"
 #include "AliITSDetTypeRec.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSDD.h"
@@ -239,6 +240,7 @@ FindClustersSDD(AliBin* bins[2], TBits* anodeFired[2],
                if (index<0) continue;
                if (index>=kMaxBin) continue;
                AliBin *b=&bins[s][index];
+               if(b->GetQ()<0.1) continue;
                AliITSdigitSDD* d=(AliITSdigitSDD*)digits->UncheckedAt(b->GetIndex());
                for (Int_t itrack=0;itrack<10;itrack++){
                  Int_t track = (d->GetTracks())[itrack];
@@ -248,6 +250,9 @@ FindClustersSDD(AliBin* bins[2], TBits* anodeFired[2],
                }
              }
            }
+         } 
+         else { // raw data
+           if (fRawID2ClusID) milab[0] = fNClusters+1; // RS: store clID+1 as a reference to the cluster
          }
          
 
@@ -289,12 +294,12 @@ FindClustersSDD(AliBin* bins[2], TBits* anodeFired[2],
          y=trk[1];
          z=trk[2]; 
          
+         q+=(driftTime*rsdd->GetADCvsDriftTime(fModule)); // correction for zero supp.
          q/=rsdd->GetADCtokeV(fModule);
-         q+=(driftTime*rsdd->GetChargevsTime()); // correction for zero supp.
          if(cal-> IsAMAt20MHz()) q*=2.; // account for 1/2 sampling freq.
          if(q<repa->GetMinClusterChargeSDD()) continue; // remove noise clusters
          
-         Float_t hit[5] = {y, z, 0.0030*0.0030, 0.0020*0.0020, q};
+         Float_t hit[6] = {y, z, 0.0030*0.0030, 0.0020*0.0020, q, 0.};
          Int_t  info[3] = {clSizTb, clSizAnode, fNlayer[fModule]};
          if (digits) CheckLabels2(milab);
          milab[3]=fNdet[fModule];
@@ -307,6 +312,7 @@ FindClustersSDD(AliBin* bins[2], TBits* anodeFired[2],
          else {
            fDetTypeRec->AddRecPoint(cc);
          }
+         fNClusters++; // RS
          ncl++;
        }
       }
@@ -316,11 +322,11 @@ FindClustersSDD(AliBin* bins[2], TBits* anodeFired[2],
 
 } 
 //______________________________________________________________________
-void AliITSClusterFinderV2SDD::RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters){
+void AliITSClusterFinderV2SDD::RawdataToClusters(AliRawReader* rawReader){
     //------------------------------------------------------------
   // This function creates ITS clusters from raw data
   //------------------------------------------------------------
-
+  fNClusters = 0; //RS
   AliITSRawStream* inputSDD=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
   AliDebug(1,Form("%s is used",inputSDD->ClassName()));
 
@@ -343,16 +349,16 @@ void AliITSClusterFinderV2SDD::RawdataToClusters(AliRawReader* rawReader,TClones
       }
     }
   }
-  FindClustersSDD(inputSDD,clusters);
+  FindClustersSDD(inputSDD);
   delete inputSDD;
 }
 
-void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input, 
-                                       TClonesArray** clusters) 
+void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input) 
 {
   //------------------------------------------------------------
   // Actual SDD cluster finder for raw data
   //------------------------------------------------------------
+  AliITSRecPointContainer* rpc = AliITSRecPointContainer::Instance();
   Int_t nClustersSDD = 0;
   AliBin *bins[2];
   TBits* anodeFired[2];
@@ -365,6 +371,9 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
   for(Int_t iMod=0; iMod<kModulesPerDDL; iMod++) vectModId[iMod]=-1;
 
   // read raw data input stream
+  int countRW = 0; //RS
+  if (fRawID2ClusID) fRawID2ClusID->Reset(); //RS if array was provided, we shall store the rawID -> ClusterID
+  //
   while (input->Next()) {
     Int_t iModule = input->GetModuleID();
     if(iModule<0){
@@ -385,13 +394,13 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
       for(Int_t iMod=0; iMod<kModulesPerDDL; iMod++){
        if(vectModId[iMod]>=0){
          fModule = vectModId[iMod];
-         clusters[fModule] = new TClonesArray("AliITSRecPoint");
+         TClonesArray* clusters = rpc->UncheckedGetClusters(fModule);
          bins[0]=fDDLBins[iMod*2];   // first hybrid of the module
          bins[1]=fDDLBins[iMod*2+1]; // second hybrid of the module
          anodeFired[0]=ddlAnodeFired[iMod*2];
          anodeFired[1]=ddlAnodeFired[iMod*2+1];
-         FindClustersSDD(bins, anodeFired, NULL, clusters[fModule],jitter);
-         Int_t nClusters = clusters[fModule]->GetEntriesFast();
+         FindClustersSDD(bins, anodeFired, NULL, clusters,jitter);
+         Int_t nClusters = clusters->GetEntriesFast();
          nClustersSDD += nClusters;
          vectModId[iMod]=-1;
        }
@@ -436,6 +445,7 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
            fDDLBins[iHybrid][index].SetQ(q);
            fDDLBins[iHybrid][index].SetMask(1);
            fDDLBins[iHybrid][index].SetIndex(index);
+           fDDLBins[iHybrid][index].SetRawID(countRW); //RS register raw id
            ddlAnodeFired[iHybrid]->SetBitNumber(iz);
          }else{
            AliWarning(Form("Invalid SDD cell: Anode=%d   TimeBin=%d",iz,itb));   
@@ -443,6 +453,7 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
        }
       }
     }
+    countRW++; //RS
   }
   for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++){ 
    delete ddlAnodeFired[iHyb];
@@ -451,7 +462,7 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
 }
 
 //______________________________________________________________________
-Bool_t AliITSClusterFinderV2SDD::NoiseSuppress(Int_t k, Int_t sid, AliBin* bins, AliITSCalibrationSDD* cal) const {
+Bool_t AliITSClusterFinderV2SDD::NoiseSuppress(Int_t k, Int_t sid, AliBin* bins, const AliITSCalibrationSDD* cal) const {
   // applies zero suppression using the measured noise of each anode
   // threshold values from ALICE-INT-1999-28 V10
   // returns kTRUE if the digit should eb noise suppressed, kFALSE if it should be kept