]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/Rec/AliTPCclusterer.cxx
remove cout
[u/mrichter/AliRoot.git] / TPC / Rec / AliTPCclusterer.cxx
index 8be2bfeb48978f09a0003a39799d12f6a69ef108..2d5df5ffc6fa7fd61b00b8e100361aa2df3acdbf 100644 (file)
@@ -611,7 +611,7 @@ void AliTPCclusterer::AddCluster(AliTPCclusterMI &c, Float_t * /*matrix*/, Int_t
     return;
   }
   transform->SetCurrentRecoParam((AliTPCRecoParam*)fRecoParam);
-  Double_t x[3]={c.GetRow(),c.GetPad(),c.GetTimeBin()};
+  Double_t x[3]={static_cast<Double_t>(c.GetRow()),static_cast<Double_t>(c.GetPad()),static_cast<Double_t>(c.GetTimeBin())};
   Int_t i[1]={fSector};
   transform->Transform(x,i,0,1);
   c.SetX(x[0]);
@@ -648,8 +648,8 @@ void AliTPCclusterer::AddCluster(AliTPCclusterMI &c, Float_t * /*matrix*/, Int_t
   if (!fRecoParam->DumpSignal()) {
     cl->SetInfo(0);
   }
-  const Int_t kClusterStream=101; // stream level should be per action - to be added to the AliTPCReconstructor
-  if (AliTPCReconstructor::StreamLevel()&kClusterStream !=0) {
+  const Int_t kClusterStream=128; // stream level should be per action - to be added to the AliTPCReconstructor
+  if ( (AliTPCReconstructor::StreamLevel()&kClusterStream)==kClusterStream) {
     Float_t xyz[3];
     cl->GetGlobalXYZ(xyz);
      (*fDebugStreamer)<<"Clusters"<<
@@ -771,7 +771,7 @@ void AliTPCclusterer::Digits2Clusters()
        Float_t dig=digarr.CurrentDigit();
        if (dig<=fParam->GetZeroSup()) continue;
        Int_t j=digarr.CurrentRow()+3, i=digarr.CurrentColumn()+3;
-       Float_t gain = gainROC->GetValue(row,digarr.CurrentColumn());
+        Float_t gain = gainROC->GetValue(row,digarr.CurrentColumn());
        Int_t bin = i*fMaxTime+j;
        if (gain>0){
          fBins[bin]=dig/gain;
@@ -873,7 +873,7 @@ void AliTPCclusterer::ProcessSectorData(){
           Int_t bin = iPad*fMaxTime+iTimeBin;
           Float_t signal = fAllBins[iRow][bin];
           if (AliTPCReconstructor::StreamLevel()>3 && signal>3) {
-            Double_t x[]={iRow,iPad-3,iTimeBin-3};
+            Double_t x[]={static_cast<Double_t>(iRow),static_cast<Double_t>(iPad-3),static_cast<Double_t>(iTimeBin-3)};
             Int_t i[]={fSector};
             AliTPCTransform trafo;
             trafo.Transform(x,i,0,1);
@@ -1428,6 +1428,18 @@ Int_t AliTPCclusterer::ReadHLTClusters()
   const Int_t kNOS = fParam->GetNOuterSector();
   const Int_t kNS = kNIS + kNOS;
   fNclusters  = 0;
+
+  // noise and dead channel treatment -- should be the same as in offline clusterizer
+  const AliTPCCalPad * gainTPC  = AliTPCcalibDB::Instance() -> GetPadGainFactor();
+  const AliTPCCalPad * noiseTPC = AliTPCcalibDB::Instance() -> GetPadNoise();
+
+  // charge thresholds
+  // TODO: In the offline cluster finder there are also cuts in time and pad direction
+  //       do they need to be included here? Most probably this is not possible
+  //       since we don't have the charge information
+  const Float_t minMaxCutAbs       = fRecoParam -> GetMinMaxCutAbs();
+  const Float_t minMaxCutSigma     = fRecoParam -> GetMinMaxCutSigma();
+  
   
   // make sure that all clusters from the previous event are cleared
   pClusterAccess->Clear("event");
@@ -1460,6 +1472,10 @@ Int_t AliTPCclusterer::ReadHLTClusters()
     Int_t nClusterSector=0;
     Int_t nRows=fParam->GetNRow(fSector);
 
+    // active channel map and noise map for current sector
+    const AliTPCCalROC * gainROC  = gainTPC  -> GetCalROC(fSector);  // pad gains per given sector
+    const AliTPCCalROC * noiseROC = noiseTPC -> GetCalROC(fSector); // noise per given sector
+    
     for (fRow = 0; fRow < nRows; fRow++) {
       fRowCl->SetID(fParam->GetIndex(fSector, fRow));
       if (fOutput) fOutput->GetBranch("Segment")->SetAddress(&fRowCl);
@@ -1482,6 +1498,26 @@ Int_t AliTPCclusterer::ReadHLTClusters()
        AliTPCclusterMI* cluster=dynamic_cast<AliTPCclusterMI*>(clusterArray->At(i));
        if (!cluster) continue;
        if (cluster->GetRow()!=fRow) continue;
+
+        const Int_t   currentPad = TMath::Nint(cluster->GetPad());
+        const Float_t maxCharge  = cluster->GetMax();
+        
+        const Float_t gain       = gainROC  -> GetValue(fRow, currentPad);
+        const Float_t noise      = noiseROC -> GetValue(fRow, currentPad);
+
+        // check if cluster is on an active pad
+        // TODO: PadGainFactor should only contain 1 or 0. However in Digits2Clusters
+        //       this is treated as a real gain factor per pad. Is the implementation
+        //       below fine?
+        if (!(gain>0)) continue;
+
+        // check if the cluster is on a too noisy pad
+        if (noise>fRecoParam->GetMaxNoise()) continue;
+
+        // check if the charge is above the required minimum
+        if (maxCharge<minMaxCutAbs)         continue;
+        if (maxCharge<minMaxCutSigma*noise) continue;
+        
        nClusterSector++;
        AddCluster(*cluster, NULL, 0);
       }