]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCclustererMI.cxx
Updated reco alghorithm, changes in OCDB object and in RecoParam objects, new classes...
[u/mrichter/AliRoot.git] / TPC / AliTPCclustererMI.cxx
index 0812f4c076bfc026427c464ca794bf0fdf266e73..8ec09a4dd02b8cad9a9667c5a102f8320986dcb2 100644 (file)
@@ -359,7 +359,7 @@ AliTPCclusterMI &c)
   
   //
   if ( ( (ry<0.6) || (rz<0.6) ) && fLoop==2) return;
-  if ( (ry <1.2) && (rz<1.2) || (!fRecoParam->GetDoUnfold())) {
+  if ( ((ry <1.2) && (rz<1.2)) || (!fRecoParam->GetDoUnfold())) {
     //
     //if cluster looks like expected or Unfolding not switched on
     //standard COG is used
@@ -445,7 +445,7 @@ void AliTPCclustererMI::UnfoldCluster(Float_t * matrix2[7], Float_t recmatrix[5]
     else{
       Float_t ratio =1;
       if (  ( ((sum3i[dk+3]+3)/(sum3i[3]-3))+1 < (sum3i[2*dk+3]-3)/(sum3i[dk+3]+3))||
-          sum3i[dk+3]<=sum3i[2*dk+3] && sum3i[dk+3]>2 ){
+           (sum3i[dk+3]<=sum3i[2*dk+3] && sum3i[dk+3]>2 )){
        Float_t xm2 = sum3i[-dk+3];
        Float_t xm1 = sum3i[+3];
        Float_t x1  = sum3i[2*dk+3];
@@ -558,7 +558,7 @@ Float_t AliTPCclustererMI::FitMax(Float_t vmatrix[5][5], Float_t y, Float_t z, F
   return max;
 }
 
-void AliTPCclustererMI::AddCluster(AliTPCclusterMI &c, Float_t * matrix, Int_t pos){
+void AliTPCclustererMI::AddCluster(AliTPCclusterMI &c, Float_t * /*matrix*/, Int_t /*pos*/){
   //
   //
   // Transform cluster to the rotated global coordinata
@@ -635,8 +635,13 @@ void AliTPCclustererMI::AddCluster(AliTPCclusterMI &c, Float_t * matrix, Int_t p
   }
   
   if (AliTPCReconstructor::StreamLevel()>1) {
+    Float_t xyz[3];
+    cl->GetGlobalXYZ(xyz);
      (*fDebugStreamer)<<"Clusters"<<
        "Cl.="<<cl<<
+       "gx="<<xyz[0]<<
+       "gy="<<xyz[1]<<
+       "gz="<<xyz[2]<<
        "\n";
   }
 
@@ -655,7 +660,16 @@ void AliTPCclustererMI::Digits2Clusters()
     Error("Digits2Clusters", "input tree not initialised");
     return;
   }
+  fRecoParam = AliTPCReconstructor::GetRecoParam();
+  if (!fRecoParam){
+    AliFatal("Can not get the reconstruction parameters");
+  }
+  if(AliTPCReconstructor::StreamLevel()>5) {
+    AliInfo("Parameter Dumps");
+    fParam->Dump();
+    fRecoParam->Dump();
+  }
+
   AliTPCCalPad * gainTPC = AliTPCcalibDB::Instance()->GetPadGainFactor();
   AliTPCCalPad * noiseTPC = AliTPCcalibDB::Instance()->GetPadNoise();
   AliSimDigits digarr, *dummy=&digarr;
@@ -711,7 +725,11 @@ void AliTPCclustererMI::Digits2Clusters()
        Int_t j=digarr.CurrentRow()+3, i=digarr.CurrentColumn()+3;
        Float_t gain = gainROC->GetValue(row,digarr.CurrentColumn());
        Int_t bin = i*fMaxTime+j;
-       fBins[bin]=dig/gain;
+       if (gain>0){
+         fBins[bin]=dig/gain;
+       }else{
+         fBins[bin]=0;
+       }
        fSigBins[fNSigBins++]=bin;
       } while (digarr.Next());
     digarr.ExpandTrackBuffer();
@@ -724,7 +742,7 @@ void AliTPCclustererMI::Digits2Clusters()
     delete[] fBins;
     delete[] fSigBins;
   }  
-
   Info("Digits2Clusters", "Number of found clusters : %d", nclusters);
 }
 
@@ -736,8 +754,15 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
 // The pedestal subtraction can be switched on and off
 // using an option of the TPC reconstructor
 //-----------------------------------------------------------------
-
-
+  fRecoParam = AliTPCReconstructor::GetRecoParam();
+  if (!fRecoParam){
+    AliFatal("Can not get the reconstruction parameters");
+  }
+  if(AliTPCReconstructor::StreamLevel()>5) {
+    AliInfo("Parameter Dumps");
+    fParam->Dump();
+    fRecoParam->Dump();
+  }
   fRowDig = NULL;
   AliTPCROC * roc = AliTPCROC::Instance();
   AliTPCCalPad * gainTPC = AliTPCcalibDB::Instance()->GetPadGainFactor();
@@ -880,7 +905,11 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
 
       if (!calcPedestal) {
        Int_t bin = iPad*fMaxTime+iTimeBin;
-       allBins[iRow][bin] = signal/gain;
+       if (gain>0){
+         allBins[iRow][bin] = signal/gain;
+       }else{
+         allBins[iRow][bin] =0;
+       }
        allSigBins[iRow][allNSigBins[iRow]++] = bin;
       }else{
        allBins[iRow][iPad*fMaxTime+iTimeBin] = signal;
@@ -897,7 +926,7 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
     // Now loop over rows and perform pedestal subtraction
     if (digCounter==0) continue;
     //    if (calcPedestal) {
-    if (kTRUE) {
+    if (kFALSE ) {
       for (Int_t iRow = 0; iRow < nRows; iRow++) {
        Int_t maxPad;
        if (fSector < kNIS)
@@ -932,9 +961,9 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
          for (Int_t iTimeBin = 0; iTimeBin < fMaxTime; iTimeBin++) {
            Int_t bin = iPad*fMaxTime+iTimeBin;
            allBins[iRow][bin] -= pedestalEvent;
-           if (iTimeBin < AliTPCReconstructor::GetRecoParam()->GetFirstBin())  
+           if (iTimeBin < fRecoParam->GetFirstBin())  
              allBins[iRow][bin] = 0;
-           if (iTimeBin > AliTPCReconstructor::GetRecoParam()->GetLastBin())  
+           if (iTimeBin > fRecoParam->GetLastBin())  
              allBins[iRow][bin] = 0;
            if (allBins[iRow][iPad*fMaxTime+iTimeBin] < zeroSup)
              allBins[iRow][bin] = 0;
@@ -965,7 +994,12 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
              trafo.Transform(x,i,0,1);
              Double_t gx[3]={x[0],x[1],x[2]};
              trafo.RotatedGlobal2Global(fSector,gx);
-             
+             //              allSigBins[iRow][allNSigBins[iRow]++]
+             Int_t rowsigBins = allNSigBins[iRow];
+             Int_t first=allSigBins[iRow][0];
+             Int_t last= 0;
+             //              if (rowsigBins>0) allSigBins[iRow][allNSigBins[iRow]-1];
+
               if (AliTPCReconstructor::StreamLevel()>0) {
              (*fDebugStreamer)<<"Digits"<<
                "sec="<<fSector<<
@@ -979,6 +1013,10 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader)
                "gx="<<gx[0]<<
                "gy="<<gx[1]<<
                "gz="<<gx[2]<<
+               //
+               "rowsigBins="<<rowsigBins<<
+               "first="<<first<<
+               "last="<<last<<
                "\n";
              }
            }
@@ -1123,7 +1161,7 @@ Double_t AliTPCclustererMI::ProcesSignal(Float_t *signal, Int_t nchannels, Int_t
   Int_t    count1 =  0;
   Float_t  rmsCalib   = rmsEvent;       // backup initial value ( from calib)
   Float_t  pedestalCalib = pedestalEvent;// backup initial value ( from calib)
-  Int_t    firstBin = AliTPCReconstructor::GetRecoParam()->GetFirstBin();
+  Int_t    firstBin = fRecoParam->GetFirstBin();
   //
   UShort_t histo[kPedMax];
   //memset(histo,0,kPedMax*sizeof(UShort_t));
@@ -1238,7 +1276,7 @@ Double_t AliTPCclustererMI::ProcesSignal(Float_t *signal, Int_t nchannels, Int_t
   // Big signals dumping
   //    
   if (AliTPCReconstructor::StreamLevel()>0) {
-  if (max-median>kMin &&maxPos>AliTPCReconstructor::GetRecoParam()->GetFirstBin()) 
+  if (max-median>kMin &&maxPos>fRecoParam->GetFirstBin()) 
     (*fDebugStreamer)<<"SignalB"<<     // pads with signal
       "TimeStamp="<<fTimeStamp<<
       "EventType="<<fEventType<<