]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
PWGPP-71 - enabling more detailed data debugging information for bad sector/timebin...
authormivanov <marian.ivanov@cern.ch>
Fri, 31 Oct 2014 22:26:17 +0000 (23:26 +0100)
committermivanov <marian.ivanov@cern.ch>
Fri, 31 Oct 2014 22:26:17 +0000 (23:26 +0100)
TPC/Rec/AliTPCtracker.cxx
TPC/Rec/AliTPCtracker.h

index 33046ed41d96048e4a097ab0f9dcdb896a11f0e6..7327586b1c7ab7b1c9c1762b54a1c458d610cefc 100644 (file)
 //  AliTPC parallel tracker
 //
 //  The track fitting is based on Kalman filtering approach
-
 //  The track finding steps:
 //      1. Seeding - with and without vertex constraint
 //                 - seeding with vertex constain done at first n^2 proble
 //                 - seeding without vertex constraint n^3 problem
 //      2. Tracking - follow prolongation road - find cluster - update kalman track
-
 //  The seeding and tracking is repeated several times, in different seeding region.
 //  This approach enables to find the track which cannot be seeded in some region of TPC
 //  This can happen because of low momenta (track do not reach outer radius), or track is currently in the ded region between sectors, or the track is for the moment overlapped with other track (seed quality is poor) ...
@@ -69,8 +67,7 @@
 // To enable storage of the TPC tracks in the ESD friend track
 // use AliTPCReconstructor::SetStreamLevel(n); 
 //
-// The debug level -  different procedure produce tree for numerical debugging
-//                    To enable them set AliTPCReconstructor::SetStreamLevel(n); where nis bigger 1
+// The debug level -  different procedure produce tree for numerical debugging of code and data (see comments foEStreamFlags in AliTPCtracker.h  )
 //
 
 //
@@ -82,7 +79,7 @@
 // The systematic errors are expressed there in RMS - position (cm), angle (rad), curvature (1/GeV)
 // The default values are 0. 
 //
-// The sytematic errors are added to the covariance matrix in following places:
+// The systematic errors are added to the covariance matrix in following places:
 //
 // 1. During fisrt itteration - AliTPCtracker::FillESD
 // 2. Second iteration - 
 //      3.a TRD->TPC   - AliTPCtracker::ReadSeeds
 //      3.b TPC->ITS   - AliTPCtracker::RefitInward
 //
-// There are several places in the code which can be numerically debuged
-// This code is keeped in order to enable code development and to check the calibration implementtion
-//
-//      1. ErrParam stream  - dump information about 
-//         1.a) cluster
-//         2.a) cluster error estimate
-//         3.a) cluster shape estimate
-//
-//
-//  Debug streamer levels:
-//  
-//-------------------------------------------------------
-
 
 /* $Id$ */
 
@@ -304,11 +288,11 @@ Int_t AliTPCtracker::UpdateTrack(AliTPCseed * track, Int_t accept){
     //  new(larr[ihelix]) AliHelix(*track) ;    
     //}
   }
-  if (AliTPCReconstructor::StreamLevel()>5) {
+  if (AliTPCReconstructor::StreamLevel()&kStreamUpdateTrack) {
     Int_t event = (fEvent==NULL)? 0: fEvent->GetEventNumberInFile();
     AliExternalTrackParam param(*track);
     TTreeSRedirector &cstream = *fDebugStreamer;
-    cstream<<"Update"<<
+    cstream<<"UpdateTrack"<<
       "cl.="<<c<<
       "event="<<event<<
       "track.="<<&param<<
@@ -358,7 +342,7 @@ Int_t AliTPCtracker::AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster)
     gcl[0]=gclf[0];    gcl[1]=gclf[1];    gcl[2]=gclf[2];
     Int_t nclSeed=seed->GetNumberOfClusters();
     
-    if (AliTPCReconstructor::StreamLevel()>2) {
+    if (AliTPCReconstructor::StreamLevel()&kStreamErrParam) { // flag:stream in debug mode cluster and track extrapolation at given row together with error nad shape estimate
     (*fDebugStreamer)<<"ErrParam"<<
       "iter="<<fIteration<<
       "Cl.="<<cluster<<
@@ -580,8 +564,8 @@ void AliTPCtracker::FillESD(const TObjArray* arr)
       if (!pt) continue; 
       pt->UpdatePoints();
       AddCovariance(pt);
-      if (AliTPCReconstructor::StreamLevel()>1) {
-       (*fDebugStreamer)<<"Track0"<<
+      if (AliTPCReconstructor::StreamLevel()&kStreamFillESD) {
+       (*fDebugStreamer)<<"FillESD"<<  // flag: stream track information in FillESD function (after track Iteration 0)
          "Tr0.="<<pt<<
          "\n";       
       }
@@ -1456,7 +1440,7 @@ Int_t  AliTPCtracker::LoadClusters()
        tpcrow->SetCluster2(k, *(AliTPCclusterMI*)(clrow->GetArray()->At(k)));
     }
   }
-  if (AliTPCReconstructor::StreamLevel()==1) {
+  if (AliTPCReconstructor::StreamLevel()&kStreamCrosstalkMatrix) {
     //
     // dump the crosstalk matrices to tree for further investigation
     //     a.) to estimate fluctuation of pedestal in indiviula wire segments
@@ -1496,7 +1480,7 @@ Int_t  AliTPCtracker::LoadClusters()
 
   if (AliTPCReconstructor::GetRecoParam()->GetUseIonTailCorrection()) ApplyTailCancellation();
   if (AliTPCReconstructor::GetRecoParam()->GetCrosstalkCorrection()!=0.) ApplyXtalkCorrection();
-  if (AliTPCReconstructor::GetRecoParam()->GetUseOulierClusterFilter()) FilterOutlierClusters();  
+  //if (AliTPCReconstructor::GetRecoParam()->GetUseOulierClusterFilter()) FilterOutlierClusters();  
   return 0;
 }
 
@@ -1633,46 +1617,28 @@ void    AliTPCtracker::FilterOutlierClusters(){
   for (Int_t isec=0; isec<nSectors; isec++){
     vecSectorOut6[isec]=0;
     vecSectorOut9[isec]=0;
-    if (TMath::Abs(vecTime[isec])>(mean69SectorTime+6.*(rms69SectorTime+ offsetTimeAccept)))  vecSectorOut6[isec]=1;
-    if (TMath::Abs(vecTime[isec])>(mean69SectorTime+9.*(rms69SectorTime+ offsetTimeAccept)))  vecSectorOut9[isec]=1;
+    if (TMath::Abs(vecMedianSectorTime[isec])>(mean69SectorTime+6.*(rms69SectorTime+ offsetTimeAccept))) {
+      vecSectorOut6[isec]=1;
+    }
+    if (TMath::Abs(vecMedianSectorTime[isec])>(mean69SectorTime+9.*(rms69SectorTime+ offsetTimeAccept))){
+      vecSectorOut9[isec]=1;
+    }
   }
   // light version of export variable
   Int_t filteredSector= vecSectorOut9.Sum();                  // light version of export variable
   Int_t filteredSectorTime= vecMedianSectorTimeOut9.Sum();
   Int_t filteredSectorPadRow= vecMedianSectorPadRowOut9.Sum();
-  fEvent->SetTPCNoiseFilterCounter(0,TMath::Min(filteredSector,255));
-  fEvent->SetTPCNoiseFilterCounter(1,TMath::Min(filteredSectorTime,255));
-  fEvent->SetTPCNoiseFilterCounter(2,TMath::Min(filteredSectorPadRow,255));
-  //
-  // dump info to streamer - for later tuning of cuts
-  //
-  if ((AliTPCReconstructor::StreamLevel()%4)>0) {  //bit 4 used
-    (*fDebugStreamer)<<"filterClusterInfo"<<
-      // minimal set variables for the ESDevent
-      "filteredSector="<<filteredSector<<                        //  counter filtered sectors                   
-      "filteredSectorTime="<<filteredSectorTime<<                //  counter filtered time bins
-      "filteredSectorPadRow="<<filteredSectorPadRow<<            //  counter filtered pad-rows
-      // per sector outlier information
-      "medianSectorTime="<<medianSectorTime<<                    // median number of clusters per sector/timebin
-      "mean69SectorTime="<<mean69SectorTime<<                    // LTM statistic  mean of clusters per sector/timebin
-      "rms69SectorTime="<<rms69SectorTime<<                      // LTM statistic  RMS of clusters per sector/timebin
-      "vecSectorOut6.="<<&vecSectorOut6<<                        // flag array sector  - 6 sigma +accept margin outlier
-      "vecSectorOut9.="<<&vecSectorOut9<<                        // flag array sector  - 9 sigma + accept margin outlier
-      // per sector/timebin outlier detection
-      "vecMedianSectorTime.="<<&vecMedianSectorTime<<
-      "vecRMSSectorTime.="<<&vecRMSSectorTime<<
-      "vecMedianSectorTimeOut6.="<<&vecMedianSectorTimeOut6<<
-      "vecMedianSectorTimeOut9.="<<&vecMedianSectorTimeOut9<<
-      // per sector/pad-row outlier detection
-      "vecMedianSectorPadRow.="<<&vecMedianSectorPadRow<<
-      "vecRMSSectorPadRow.="<<&vecRMSSectorPadRow<<
-      "vecMedianSectorPadRowOut6.="<<&vecMedianSectorPadRowOut6<<
-      "vecMedianSectorPadRowOut9.="<<&vecMedianSectorPadRowOut9<<
-      "\n";
+  if (fEvent){
+    fEvent->SetTPCNoiseFilterCounter(0,TMath::Min(filteredSector,255));
+    fEvent->SetTPCNoiseFilterCounter(1,TMath::Min(filteredSectorTime,255));
+    fEvent->SetTPCNoiseFilterCounter(2,TMath::Min(filteredSectorPadRow,255));
   }
   //
   // 4. Disabling clusters in outlier layers
   //
+  Int_t counterAll=0;
+  Int_t counterOut=0;
   for (Int_t isector=0; isector<36; isector++){      // loop over sectors
     for (Int_t iside=0; iside<2; iside++){           // loop over sides A/C
       AliTPCtrackerSector &sector= (isector<18)?fInnerSec[isector%18]:fOuterSec[isector%18];
@@ -1690,17 +1656,53 @@ void    AliTPCtracker::FilterOutlierClusters(){
          Int_t entriesPadRow=hisPadRow.GetBinContent(cluster->GetDetector()+1, cluster->GetRow()+1);
          Int_t entriesTime=hisTime.GetBinContent(cluster->GetDetector()+1, cluster->GetTimeBin()+1);
          Bool_t isOut=kFALSE;
-         if (vecSectorOut9[isector]>0.5) isOut=kTRUE;
+         if (vecSectorOut9[cluster->GetDetector()]>0.5) {
+           isOut=kTRUE;
+         }
          
          if (entriesTime>medianTime+nSigmaCut*rmsTime+offsetTime) isOut=kTRUE;
          if (entriesPadRow>medianPadRow+nSigmaCut*rmsPadRow+offsetPadRow) isOut=kTRUE;
+         counterAll++;
          if (isOut){
            cluster->Disable();
+           counterOut++;
          }
        }
       }
     }
   }
+  //
+  // dump info to streamer - for later tuning of cuts
+  //
+  if ((AliTPCReconstructor::StreamLevel()&kStreamFilterClusterInfo)>0) {  // stream TPC data ouliers filtering infomation
+    (*fDebugStreamer)<<"filterClusterInfo"<<
+      // minimal set variables for the ESDevent
+      "counterAll="<<counterAll<<
+      "counterOut="<<counterOut<<
+      //
+      "filteredSector="<<filteredSector<<                        //  counter filtered sectors                   
+      "filteredSectorTime="<<filteredSectorTime<<                //  counter filtered time bins
+      "filteredSectorPadRow="<<filteredSectorPadRow<<            //  counter filtered pad-rows
+      // per sector outlier information
+      "medianSectorTime="<<medianSectorTime<<                    // median number of clusters per sector/timebin
+      "mean69SectorTime="<<mean69SectorTime<<                    // LTM statistic  mean of clusters per sector/timebin
+      "rms69SectorTime="<<rms69SectorTime<<                      // LTM statistic  RMS of clusters per sector/timebin
+      "vecSectorOut6.="<<&vecSectorOut6<<                        // flag array sector  - 6 sigma +accept margin outlier
+      "vecSectorOut9.="<<&vecSectorOut9<<                        // flag array sector  - 9 sigma + accept margin outlier
+      // per sector/timebin outlier detection
+      "vecMedianSectorTime.="<<&vecMedianSectorTime<<
+      "vecRMSSectorTime.="<<&vecRMSSectorTime<<
+      "vecMedianSectorTimeOut6.="<<&vecMedianSectorTimeOut6<<
+      "vecMedianSectorTimeOut9.="<<&vecMedianSectorTimeOut9<<
+      // per sector/pad-row outlier detection
+      "vecMedianSectorPadRow.="<<&vecMedianSectorPadRow<<
+      "vecRMSSectorPadRow.="<<&vecRMSSectorPadRow<<
+      "vecMedianSectorPadRowOut6.="<<&vecMedianSectorPadRowOut6<<
+      "vecMedianSectorPadRowOut9.="<<&vecMedianSectorPadRowOut9<<
+      "\n";
+    ((*fDebugStreamer)<<"filterClusterInfo").GetTree()->Write();
+    fDebugStreamer->GetFile()->Flush();
+  }
 }
 
 void AliTPCtracker::UnloadClusters()
@@ -1780,12 +1782,12 @@ void   AliTPCtracker::Transform(AliTPCclusterMI * cluster){
   //
   // in debug mode  check the transformation
   //
-  if (AliTPCReconstructor::StreamLevel()>2) {
+  if ((AliTPCReconstructor::StreamLevel()&kStreamTransform)>0) { 
     Float_t gx[3];
     cluster->GetGlobalXYZ(gx);
     Int_t event = (fEvent==NULL)? 0: fEvent->GetEventNumberInFile();
     TTreeSRedirector &cstream = *fDebugStreamer;
-    cstream<<"Transform"<<
+    cstream<<"Transform"<<  // needed for debugging of the cluster transformation, resp. used for later visualization 
       "event="<<event<<
       "x0="<<x[0]<<
       "x1="<<x[1]<<
@@ -1852,7 +1854,7 @@ void  AliTPCtracker::ApplyXtalkCorrection(){
          cluster->SetQ(cluster->GetQ()+sumxTalk);
 
 
-          if (AliTPCReconstructor::StreamLevel()==1) {
+          if ((AliTPCReconstructor::StreamLevel()&kStreamXtalk)>0) {  // flag: stream crosstalk correctio as applied to cluster
             TTreeSRedirector &cstream = *fDebugStreamer;
             if (gRandom->Rndm() > 0.){
               cstream<<"Xtalk"<<
@@ -1991,7 +1993,7 @@ void  AliTPCtracker::ApplyTailCancellation(){
               qMaxArray[icl0]+=ionTailMax;
 
               // Dump some info for debugging while clusters are being corrected
-              if (AliTPCReconstructor::StreamLevel()>2) {
+              if ((AliTPCReconstructor::StreamLevel()&kStreamIonTail)>0) {  // flag: stream ion tail correction  as applied to cluster
                 TTreeSRedirector &cstream = *fDebugStreamer;
                 if (gRandom->Rndm() > 0.999){
                   cstream<<"IonTail"<<
@@ -2010,7 +2012,7 @@ void  AliTPCtracker::ApplyTailCancellation(){
             cl0->SetMax(TMath::Nint(Float_t(cl0->GetMax())+qMaxArray[icl0]));
           
             // Dump some info for debugging after clusters are corrected 
-            if (AliTPCReconstructor::StreamLevel()>2) {
+            if ((AliTPCReconstructor::StreamLevel()&kStreamIonTail)>0) {
               TTreeSRedirector &cstream = *fDebugStreamer;
               if (gRandom->Rndm() > 0.999){
               cstream<<"IonTailCorrected"<<
@@ -3007,7 +3009,7 @@ void AliTPCtracker::RemoveUsed2(TObjArray * arr, Float_t factor1,  Float_t facto
       //
       if (Float_t(shared+1)/Float_t(found+1)>factor){
        if (pt->GetKinkIndexes()[0]!=0) continue;  //don't remove tracks  - part of the kinks
-       if( AliTPCReconstructor::StreamLevel()>3){
+       if( (AliTPCReconstructor::StreamLevel()&kStreamRemoveUsed)>0){ // flag:stream  information about TPC tracks which were descarded (double track removal)
          TTreeSRedirector &cstream = *fDebugStreamer;
          cstream<<"RemoveUsed"<<
            "iter="<<fIteration<<
@@ -3019,7 +3021,7 @@ void AliTPCtracker::RemoveUsed2(TObjArray * arr, Float_t factor1,  Float_t facto
       }      
       if (pt->GetNumberOfClusters()<50&&(found-0.5*shared)<minimal){  //remove short tracks
        if (pt->GetKinkIndexes()[0]!=0) continue;  //don't remove tracks  - part of the kinks
-       if( AliTPCReconstructor::StreamLevel()>3){
+       if( (AliTPCReconstructor::StreamLevel()&kStreamRemoveShort)>0){ // flag:stream  information about TPC tracks which were discarded (short track removal)
          TTreeSRedirector &cstream = *fDebugStreamer;
          cstream<<"RemoveShort"<<
            "iter="<<fIteration<<
@@ -3389,7 +3391,7 @@ Int_t AliTPCtracker::RefitInward(AliESDEvent *event)
   SignShared(&arraySeed);
   //  FindCurling(fSeeds, event,2); // find multi found tracks
   FindSplitted(fSeeds, event,2); // find multi found tracks
-  if (AliTPCReconstructor::StreamLevel()>5)  FindMultiMC(fSeeds, fEvent,2); // find multi found tracks
+  if ((AliTPCReconstructor::StreamLevel()&kStreamFindMultiMC)>0)  FindMultiMC(fSeeds, fEvent,2); // flag: stream MC infomation about the multiple find track (ONLY for MC data)
 
   Int_t ntracks=0;
   Int_t nseed = fSeeds->GetEntriesFast();
@@ -3403,8 +3405,8 @@ Int_t AliTPCtracker::RefitInward(AliESDEvent *event)
       AliExternalTrackParam paramIn;
       AliExternalTrackParam paramOut;
       Int_t ncl = seed->RefitTrack(seed,&paramIn,&paramOut);
-      if (AliTPCReconstructor::StreamLevel()>2) {
-       (*fDebugStreamer)<<"RecoverIn"<<
+      if ((AliTPCReconstructor::StreamLevel() & kStreamRecoverIn)>0) {  // flag: stream track information for track  failing in RefitInward function and recovered back
+       (*fDebugStreamer)<<"RecoverIn"<< 
          "seed.="<<seed<<
          "esd.="<<esd<<
          "pin.="<<&paramIn<<
@@ -3425,9 +3427,9 @@ Int_t AliTPCtracker::RefitInward(AliESDEvent *event)
     seed->CookdEdx(0.02,0.6);
     CookLabel(seed,0.1); //For comparison only
     //
-    if (AliTPCReconstructor::StreamLevel()>1 && seed!=0) {
+    if (((AliTPCReconstructor::StreamLevel()&kStreamRefitInward)>0) && seed!=0) {
       TTreeSRedirector &cstream = *fDebugStreamer;
-      cstream<<"Crefit"<<
+      cstream<<"RefitInward"<<  // flag: stream track information in RefitInward function (after tracking Iteration 2)
        "Esd.="<<esd<<
        "Track.="<<seed<<
        "\n"; 
@@ -3485,7 +3487,7 @@ Int_t AliTPCtracker::RefitInward(AliESDEvent *event)
     }
   }
   //FindKinks(fSeeds,event);
-  if (AliTPCReconstructor::StreamLevel()>3)  DumpClusters(2,fSeeds);
+  if ((AliTPCReconstructor::StreamLevel()&kStreamClDump)>0)  DumpClusters(2,fSeeds);  // dump clusters at the end of process (signed with useage flags)
   Info("RefitInward","Number of refitted tracks %d",ntracks);
 
   AliCosmicTracker::FindCosmic(event, kTRUE);
@@ -3510,7 +3512,7 @@ Int_t AliTPCtracker::PropagateBack(AliESDEvent *event)
   RemoveUsed2(fSeeds,0.4,0.4,20);
   //FindCurling(fSeeds, fEvent,1);  
   FindSplitted(fSeeds, event,1); // find multi found tracks
-  if (AliTPCReconstructor::StreamLevel()>5)  FindMultiMC(fSeeds, fEvent,1); // find multi found tracks
+  if ((AliTPCReconstructor::StreamLevel()&kStreamFindMultiMC)>0)  FindMultiMC(fSeeds, fEvent,1); // find multi found tracks
 
   //
   Int_t nseed = fSeeds->GetEntriesFast();
@@ -3527,7 +3529,7 @@ Int_t AliTPCtracker::PropagateBack(AliESDEvent *event)
       AliExternalTrackParam paramIn;
       AliExternalTrackParam paramOut;
       Int_t ncl = seed->RefitTrack(seed,&paramIn,&paramOut);
-      if (AliTPCReconstructor::StreamLevel()>2) {
+      if ((AliTPCReconstructor::StreamLevel()&kStreamRecoverBack)>0) { // flag: stream track information for track  faling PropagateBack function and recovered back (RefitTrack)
        (*fDebugStreamer)<<"RecoverBack"<<
          "seed.="<<seed<<
          "esd.="<<esd<<
@@ -3554,8 +3556,8 @@ Int_t AliTPCtracker::PropagateBack(AliESDEvent *event)
       ntracks++;
       Int_t eventnumber = event->GetEventNumberInFile();// patch 28 fev 06
       // This is most likely NOT the event number you'd like to use. It has nothing to do with the 'real' event number      
-      if (AliTPCReconstructor::StreamLevel()>1 && esd) {
-       (*fDebugStreamer)<<"Cback"<<
+      if (((AliTPCReconstructor::StreamLevel()&kStreamCPropagateBack)>0) && esd) {
+       (*fDebugStreamer)<<"PropagateBack"<<  // flag: stream track information in PropagateBack function (after tracking Iteration 1)
          "Tr0.="<<seed<<
          "esd.="<<esd<<
          "EventNrInFile="<<eventnumber<<
@@ -3563,7 +3565,7 @@ Int_t AliTPCtracker::PropagateBack(AliESDEvent *event)
       }
     }
   }
-  if (AliTPCReconstructor::StreamLevel()>3)  DumpClusters(1,fSeeds);
+  if (AliTPCReconstructor::StreamLevel()&kStreamClDump)  DumpClusters(1,fSeeds); // flag:stream clusters at the end of process (signed with usage flag)
   //FindKinks(fSeeds,event);
   Info("PropagateBack","Number of back propagated tracks %d",ntracks);
   fEvent =0;
@@ -3763,6 +3765,8 @@ void AliTPCtracker::MakeSeeds3(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2,
   for (Int_t is=0; is < kr1; is++) {
     //
     if (kr1[is]->IsUsed(10)) continue;
+    if (kr1[is]->IsDisabled()) continue;
+
     Double_t y1=kr1[is]->GetY(), z1=kr1[is]->GetZ();    
     //if (TMath::Abs(y1)>ymax) continue;
 
@@ -3814,7 +3818,8 @@ void AliTPCtracker::MakeSeeds3(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2,
       Double_t dyy0 =  (xx2-x3)*sn13r;
       for (Int_t js=index1; js < index2; js++) {
        const AliTPCclusterMI *kcl = kr2[js];
-       if (kcl->IsUsed(10)) continue;  
+       if (kcl->IsUsed(10)) continue;  
+       if (kcl->IsDisabled()) continue;
        //
        //calcutate parameters
        //      
@@ -4087,7 +4092,9 @@ void AliTPCtracker::MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2,
   // loop over clusters  
   for (Int_t is=0; is < kr1; is++) {
     //
-    if (kr1[is]->IsUsed(10)) continue;
+    if (kr1[is]->IsUsed(10)) continue; 
+    if (kr1[is]->IsDisabled()) continue;
+
     Double_t y1=kr1[is]->GetY(), z1=kr1[is]->GetZ();    
     //
     if (deltay>0 && TMath::Abs(y1max-TMath::Abs(y1))> deltay ) continue;  // seed only at the edge    
@@ -4101,6 +4108,8 @@ void AliTPCtracker::MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2,
     UInt_t index;
     for (Int_t js=index1; js < index2; js++) {
       const AliTPCclusterMI *kcl = kr3[js];
+      if (kcl->IsDisabled()) continue;
+
       if (kcl->IsUsed(10)) continue;
       y3 = kcl->GetY(); 
       // apply angular cuts
@@ -4121,7 +4130,8 @@ void AliTPCtracker::MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2,
       const AliTPCclusterMI *kcm = krm.FindNearest2(yyym,zzzm,erry,errz,index);
       if (!kcm) continue;
       if (kcm->IsUsed(10)) continue;
-      
+      if (kcm->IsDisabled()) continue;
+
       erry = TMath::Abs(angley)*(x1-x1m)*0.4+0.5;
       errz = TMath::Abs(anglez)*(x1-x1m)*0.4+0.5;
       //
@@ -4316,7 +4326,8 @@ void AliTPCtracker::MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, F
       const AliTPCtrackerRow& krm=fSectors[sec][row0-iter];
       const AliTPCtrackerRow& krp=fSectors[sec][row0+iter];      
       const AliTPCclusterMI * cl= kr0[is];
-      
+      if (cl->IsDisabled()) continue;
+
       if (cl->IsUsed(10)) {
        cused++;
       }
@@ -4941,7 +4952,7 @@ void  AliTPCtracker::FindMultiMC(const TObjArray * array, AliESDEvent */*esd*/,
   //
   //  find multi tracks - THIS FUNCTION IS ONLY FOR DEBUG PURPOSES
   //                      USES MC LABELS
-  //  Use AliTPCReconstructor::StreamLevel()>2 if you want to tune parameters - cuts
+  //  Use AliTPCReconstructor::StreamLevel()& kStreamFindMultiMC if you want to tune parameters - cuts
   //
   //  Two reasons to have multiple find tracks
   //  1. Curling tracks can be find more than once
@@ -5065,7 +5076,7 @@ void  AliTPCtracker::FindMultiMC(const TObjArray * array, AliESDEvent */*esd*/,
        }
       }
       //
-      if (AliTPCReconstructor::StreamLevel()>5) {
+      if ((AliTPCReconstructor::StreamLevel()&kStreamFindMultiMC)>0) {  // flag: stream MC infomation about the multiple find track (ONLY for MC data)
       TTreeSRedirector &cstream = *fDebugStreamer;
       cstream<<"Multi"<<
        "iter="<<iter<<
@@ -5109,7 +5120,7 @@ void  AliTPCtracker::FindMultiMC(const TObjArray * array, AliESDEvent */*esd*/,
   delete [] xm;
   delete [] dz0;
   delete [] dz1;
-  if (AliTPCReconstructor::StreamLevel()>1) {
+  if (AliTPCReconstructor::StreamLevel()>0) {
     AliInfo("Time for curling tracks removal DEBUGGING MC");
     timer.Print();
   }
@@ -5122,7 +5133,7 @@ void  AliTPCtracker::FindSplitted(TObjArray * array, AliESDEvent */*esd*/, Int_t
   // Find Splitted tracks and remove the one with worst quality  
   // Corresponding debug streamer to tune selections - "Splitted2"
   // Algorithm:
-  // 0. Sort tracks according quility
+  // 0. Sort tracks according quality
   // 1. Propagate the tracks to the reference radius
   // 2. Double_t loop to select close tracks (only to speed up process)
   // 3. Calculate cluster overlap ratio - and remove the track if bigger than a threshold
@@ -5213,7 +5224,7 @@ void  AliTPCtracker::FindSplitted(TObjArray * array, AliESDEvent */*esd*/, Int_t
       Double_t ratio0 = Float_t(sumShared)/Float_t(TMath::Min(nall0+1,nall1+1));
       Double_t ratio1 = Float_t(sumShared)/Float_t(TMath::Max(nall0+1,nall1+1));
       
-      if( AliTPCReconstructor::StreamLevel()>1){
+      if ((AliTPCReconstructor::StreamLevel()&kStreamSplitted2)>0){ // flag:stream information about discarded TPC tracks pair algorithm 
        TTreeSRedirector &cstream = *fDebugStreamer;
        Int_t n0=s1->GetNumberOfClusters();
        Int_t n1=s2->GetNumberOfClusters();
@@ -5222,7 +5233,7 @@ void  AliTPCtracker::FindSplitted(TObjArray * array, AliESDEvent */*esd*/, Int_t
        Int_t lab0=s1->GetLabel();
        Int_t lab1=s2->GetLabel();
 
-       cstream<<"Splitted2"<<
+       cstream<<"Splitted2"<<    // flag:stream information about discarded TPC tracks pair algorithm 
          "iter="<<fIteration<<
          "lab0="<<lab0<<        // MC label if exist
          "lab1="<<lab1<<        // MC label if exist
@@ -5274,7 +5285,7 @@ void  AliTPCtracker::FindCurling(const TObjArray * array, AliESDEvent */*esd*/,
 {
   //
   //  find Curling tracks
-  //  Use AliTPCReconstructor::StreamLevel()>1 if you want to tune parameters - cuts
+  //  Use AliTPCReconstructor::StreamLevel()&kStreamFindCurling if you want to tune parameters - cuts
   //
   //
   //  Algorithm done in 2 phases - because of CPU consumption
@@ -5428,7 +5439,7 @@ void  AliTPCtracker::FindCurling(const TObjArray * array, AliESDEvent */*esd*/,
            track0->SetCircular(track0->GetCircular()+2);
          }
        }               
-       if (AliTPCReconstructor::StreamLevel()>2){        
+       if ((AliTPCReconstructor::StreamLevel()&kStreamFindCurling)>0){  // flag: stream track infroamtion if the FindCurling tracks method       
          //
          //debug stream to tune "fine" cuts      
          Int_t lab0=track0->GetLabel();
@@ -5629,7 +5640,7 @@ void  AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
            track0->SetCircular(track0->GetCircular()+2);
          }
        }               
-       if (lsign&&AliTPCReconstructor::StreamLevel()>1){         
+       if (lsign&&((AliTPCReconstructor::StreamLevel()&kStreamFindCurling)>0)){          
          //debug stream          
          Int_t lab0=track0->GetLabel();
          Int_t lab1=track1->GetLabel();
@@ -5875,7 +5886,7 @@ void  AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
       chi2P3*=chi2P3;
       chi2P3/=paramm.GetCovariance()[9]+paramd.GetCovariance()[9];
       //
-      if (AliTPCReconstructor::StreamLevel()>1) {
+      if ((AliTPCReconstructor::StreamLevel()&kStreamFindKinks)>0) {   // flag: stream track infroamtion in the FindKinks method
        (*fDebugStreamer)<<"kinkLpt"<<
          "chi2P2="<<chi2P2<<
          "chi2P3="<<chi2P3<<
@@ -6351,7 +6362,7 @@ void  AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
            track0->SetCircular(track0->GetCircular()+2);
          }
        }               
-       if (lsign&&AliTPCReconstructor::StreamLevel()>1){         
+       if (lsign&&((AliTPCReconstructor::StreamLevel()&kStreamFindKinks)>0)){// flag: stream track infroamtion in the FindKinks method   
          //debug stream          
          Int_t lab0=track0->GetLabel();
          Int_t lab1=track1->GetLabel();
@@ -6597,7 +6608,7 @@ void  AliTPCtracker::FindKinks(TObjArray * array, AliESDEvent *esd)
       chi2P3*=chi2P3;
       chi2P3/=paramm.GetCovariance()[9]+paramd.GetCovariance()[9];
       //
-      if (AliTPCReconstructor::StreamLevel()>1) {
+      if (AliTPCReconstructor::StreamLevel()&kStreamFindKinks) {// flag: stream track infroamtion in the FindKinks method
        (*fDebugStreamer)<<"kinkLpt"<<
          "chi2P2="<<chi2P2<<
          "chi2P3="<<chi2P3<<
@@ -7210,7 +7221,7 @@ Int_t  AliTPCtracker::CheckKinkPoint(AliTPCseed*seed,AliTPCseed &mother, AliTPCs
   chi2P3*=chi2P3;
   chi2P3/=param0[index].GetCovariance()[9]+param1[index].GetCovariance()[9];
   //
-  if (AliTPCReconstructor::StreamLevel()>1) {
+  if (AliTPCReconstructor::StreamLevel()&kStreamFindKinks) { // flag: stream track infroamtion in the FindKinks method
     (*fDebugStreamer)<<"kinkHpt"<<
       "chi2P2="<<chi2P2<<
       "chi2P3="<<chi2P3<<
@@ -7330,11 +7341,12 @@ Int_t AliTPCtracker::Clusters2TracksHLT (AliESDEvent *const esd, const AliESDEve
   else ResetSeedsPool();
   fEvent = esd; 
   fEventHLT = hltEvent;
-
+  if (AliTPCReconstructor::GetRecoParam()->GetUseOulierClusterFilter()) FilterOutlierClusters();  
   AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;  
   transform->SetCurrentTimeStamp( esd->GetTimeStamp());
   transform->SetCurrentRun(esd->GetRunNumber());
 
+  
   Clusters2Tracks();
   fEventHLT = 0;
   if (!fSeeds) return 1;
@@ -7388,10 +7400,10 @@ Int_t AliTPCtracker::Clusters2Tracks() {
   RemoveUsed2(fSeeds,0.85,0.85,0);
   if (AliTPCReconstructor::GetRecoParam()->GetDoKinks()) FindKinks(fSeeds,fEvent);
   //FindCurling(fSeeds, fEvent,0);  
-  if (AliTPCReconstructor::StreamLevel()>5)  FindMultiMC(fSeeds, fEvent,-1); // find multi found tracks
+  if (AliTPCReconstructor::StreamLevel()&kStreamFindMultiMC)  FindMultiMC(fSeeds, fEvent,-1); // find multi found tracks
   RemoveUsed2(fSeeds,0.5,0.4,20);
   FindSplitted(fSeeds, fEvent,0); // find multi found tracks
-  if (AliTPCReconstructor::StreamLevel()>5)  FindMultiMC(fSeeds, fEvent,0); // find multi found tracks
+  if (AliTPCReconstructor::StreamLevel()&kStreamFindMultiMC)  FindMultiMC(fSeeds, fEvent,0); // find multi found tracks
 
  //  //
 //   // refit short tracks
index 53bb15be0e9be9e88391222665f7da8f8cf33e30..1330733122d9184a385e1470ca00cc5a8d110062 100644 (file)
@@ -41,6 +41,28 @@ class TGraphErrors;
 
 class AliTPCtracker : public AliTracker {
 public:
+  enum EStreamFlags{ // flags to store addition data/code debugging infomation which is not stored in ESD but in specaial TPCdebug.root file
+    kStreamTransform          =0x00001,    // flag:stream cluster transformation 
+    kStreamErrParam           =0x00002,    // flag:stream in debug mode cluster and track extrapolation at given row together with error nad shape estimate
+    kStreamFilterClusterInfo  =0x00004,    // flag:stream TPC data ouliers filtering information
+    kStreamClDump             =0x00008,    // flag:stream clusters at the end of process (signed with useage flags)
+    kStreamRemoveUsed         =0x00010,    // flag:stream information about TPC tracks which were descarded (double track removal)
+    kStreamRemoveShort        =0x00020,    // flag:stream information about TPC tracks which were discarded (short track removal) 
+    kStreamSplitted2          =0x00040,    // flag:stream information about discarded TPC tracks pair algorithm 
+    kStreamFillESD            =0x00080,    // flag: stream track information in FillESD function (after track Iteration 0)
+    kStreamCPropagateBack     =0x00100,    // flag: stream track information in PropagateBack function (after tracking Iteration 1)
+    kStreamRecoverBack        =0x00200,    // flag: stream track information for track  failing PropagateBack function and recovered back
+    kStreamRefitInward        =0x00400,    // flag: stream track information in RefitInward function (after tracking Iteration 2)
+    kStreamRecoverIn          =0x00800,    // flag: stream track information for track  failing in RefitInward function and recovered back
+    kStreamUpdateTrack        =0x01000,    // flag: stream track/cluster infroamtion in track update method
+    //
+    kStreamCrosstalkMatrix    =0x02000,    // flag: stream crosstalk matrix as used in the reconstruction at given region of TPC
+    kStreamXtalk              =0x04000,    // flag: stream crosstalk correction as applied to cluster
+    kStreamIonTail            =0x08000,    // flag: stream ion tail correction  as applied to cluster
+    kStreamFindMultiMC        =0x10000,    // flag: stream MC infomation about the multiple find track (ONLY for MC data)
+    kStreamFindCurling        =0x20000,    // flag: stream track infroamtion in the FindCurling tracks method
+    kStreamFindKinks          =0x40000,    // flag: stream track infroamtion in the FindKinks method
+  };
   AliTPCtracker();
   AliTPCtracker(const AliTPCParam *par); 
   virtual ~AliTPCtracker();