]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
TPC ClusterFinder and related changes (Kenneth)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Jul 2008 09:21:45 +0000 (09:21 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Jul 2008 09:21:45 +0000 (09:21 +0000)
- Added functionality: deconvolution in pad and time direction.
- bugfix: Qmax is updated in the clusters. Unsorted reading of data is now default
- timebin range by component arguments
- component arguments according to convention and code cleanup

HLT/TPCLib/AliHLTTPCAgent.cxx
HLT/TPCLib/AliHLTTPCClusterFinder.cxx
HLT/TPCLib/AliHLTTPCClusterFinder.h
HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
HLT/TPCLib/AliHLTTPCClusterFinderComponent.h
HLT/TPCLib/AliHLTTPCPad.cxx
HLT/TPCLib/AliHLTTPCPad.h
HLT/TPCLib/macros/conf-tpc-esd.C
HLT/TPCLib/macros/conf-tpc-writer.C
HLT/TPCLib/macros/rec-hlt-tpc.C

index bb6a7e6d5217f1d057d361422e81d63c772202b5..ba0abdbaf9573468dc9e2b5b00b982fa755caa44 100644 (file)
@@ -109,7 +109,7 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
 
        // cluster finder components
        cf.Form("TPC-CF_%02d_%d", slice, part);
-       handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
+       handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "-timebins 446 -sorted");
        if (trackerInput.Length()>0) trackerInput+=" ";
        trackerInput+=cf;
       }
index 1657270233ac39fda34154561cf076d305d061f3..9ba4ea6137f1ed768def4f51774d1db1acd96269 100644 (file)
@@ -30,7 +30,6 @@
 #include "AliHLTTPCLogging.h"
 #include "AliHLTTPCClusterFinder.h"
 #include "AliHLTTPCDigitData.h"
-#include "AliHLTTPCTransform.h"
 #include "AliHLTTPCSpacePointData.h"
 #include "AliHLTTPCMemHandler.h"
 #include "AliHLTTPCPad.h"
@@ -50,8 +49,8 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   fDigitReader(NULL),
   fPtr(NULL),
   fSize(0),
-  fDeconvTime(kTRUE),
-  fDeconvPad(kTRUE),
+  fDeconvTime(kFALSE),
+  fDeconvPad(kFALSE),
   fStdout(kFALSE),
   fCalcerr(kTRUE),
   fRawSP(kFALSE),
@@ -62,8 +61,6 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   fCurrentPatch(0),
   fMatch(1),
   fThreshold(10),
-  fSignalThreshold(-1),
-  fNSigmaThreshold(0),
   fNClusters(0),
   fMaxNClusters(0),
   fXYErr(0.2),
@@ -75,7 +72,11 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   fNumberOfPadsInRow(NULL),
   fNumberOfRows(0),
   fRowOfFirstCandidate(0),
-  fDoPadSelection(kFALSE)
+  fDoPadSelection(kFALSE),
+  fFirstTimeBin(0),
+  fLastTimeBin(AliHLTTPCTransform::GetNTimeBins()),
+  fTotalChargeOfPreviousClusterCandidate(0),
+  fChargeOfCandidatesFalling(kFALSE)
 {
   //constructor  
 }
@@ -225,14 +226,18 @@ void AliHLTTPCClusterFinder::ProcessDigits()
      bins.
    */
   Int_t gatingGridOffset=50;
+  if(fFirstTimeBin>0){
+    gatingGridOffset=fFirstTimeBin;
+  }
   AliHLTTPCPad baseline(gatingGridOffset, AliHLTTPCTransform::GetNTimeBins());
   // just to make later conversion to a list of objects easier
   AliHLTTPCPad* pCurrentPad=NULL;
-  if (fSignalThreshold>=0) {
+  /*
+    if (fSignalThreshold>=0) {
     pCurrentPad=&baseline;
     baseline.SetThreshold(fSignalThreshold);
   }
-
+  */
   while ( readValue!=0 && iResult>=0){   // Reads through all digits in block
     iResult=0;
 
@@ -599,9 +604,15 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
          }  
        
        fSpacePointData[counter].fX = xyz[0];
-       fSpacePointData[counter].fY = xyz[1];
+       //      fSpacePointData[counter].fY = xyz[1];
+       if(fCurrentSlice<18){
+         fSpacePointData[counter].fY = xyz[1];
+       }
+       else{
+         fSpacePointData[counter].fY = -1*xyz[1];
+       }
        fSpacePointData[counter].fZ = xyz[2];
-       
+
       } else {
        fSpacePointData[counter].fX = fCurrentRow;
        fSpacePointData[counter].fY = fpad;
@@ -613,6 +624,8 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
       fSpacePointData[counter].fSigmaY2 = fpad2;
       fSpacePointData[counter].fSigmaZ2  = ftime2;
 
+      fSpacePointData[counter].fMaxQ = list[j].fQMax;
+
       fSpacePointData[counter].fUsed = kFALSE;         // only used / set in AliHLTTPCDisplay
       fSpacePointData[counter].fTrackN = -1;           // only used / set in AliHLTTPCDisplay
 
@@ -686,26 +699,106 @@ void AliHLTTPCClusterFinder::ReadDataUnsorted(void* ptr,unsigned long size)
     UInt_t row=fDigitReader->GetRow();
     UInt_t pad=fDigitReader->GetPad();
 
-    fRowPadVector[row][pad]->ClearCandidates();
     while(fDigitReader->NextBunch()){
       if(fDigitReader->GetBunchSize()>1){//to remove single timebin values, this will have to change at some point
-       const UInt_t *bunchData= fDigitReader->GetSignals();
        UInt_t time = fDigitReader->GetTime();
-       AliHLTTPCClusters candidate;
-       for(Int_t i=0;i<fDigitReader->GetBunchSize();i++){
-         candidate.fTotalCharge+=bunchData[i]; 
-         candidate.fTime += time*bunchData[i];
-         candidate.fTime2 += time*time*bunchData[i];
-         time++;
+       if((Int_t)time>=fFirstTimeBin && (Int_t)time+fDigitReader->GetBunchSize()<=fLastTimeBin){
+         const UInt_t *bunchData= fDigitReader->GetSignals();
+         AliHLTTPCClusters candidate;
+         for(Int_t i=0;i<fDigitReader->GetBunchSize();i++){
+           candidate.fTotalCharge+=bunchData[i];       
+           candidate.fTime += time*bunchData[i];
+           candidate.fTime2 += time*time*bunchData[i];
+           if(bunchData[i]>candidate.fQMax){
+             candidate.fQMax=bunchData[i];
+           }
+           time++;
+         }
+         if(candidate.fTotalCharge>0){
+           candidate.fMean=candidate.fTime/candidate.fTotalCharge;
+           candidate.fPad=candidate.fTotalCharge*pad;
+           candidate.fPad2=candidate.fPad*pad;
+           candidate.fLastMergedPad=pad;
+           candidate.fRowNumber=row+fDigitReader->GetRowOffset();
+         }
+         fRowPadVector[row][pad]->AddClusterCandidate(candidate);
        }
-       if(candidate.fTotalCharge>0){
-         candidate.fMean=candidate.fTime/candidate.fTotalCharge;
-         candidate.fPad=candidate.fTotalCharge*pad;
-         candidate.fPad2=candidate.fPad*pad;
-         candidate.fLastMergedPad=pad;
-         candidate.fRowNumber=row+fDigitReader->GetRowOffset();
+      }
+    }
+  }
+}
+
+void AliHLTTPCClusterFinder::ReadDataUnsortedDeconvoluteTime(void* ptr,unsigned long size)
+{
+  //set input pointer
+  fPtr = (UChar_t*)ptr;
+  fSize = size;
+
+  if(!fVectorInitialized){
+    InitializePadArray();
+  }
+
+  fDigitReader->InitBlock(fPtr,fSize,fFirstRow,fLastRow,fCurrentPatch,fCurrentSlice);
+  
+  while(fDigitReader->NextChannel()){
+    UInt_t row=fDigitReader->GetRow();
+    UInt_t pad=fDigitReader->GetPad();
+
+    while(fDigitReader->NextBunch()){
+      if(fDigitReader->GetBunchSize()>1){//to remove single timebin values, this will have to change at some point
+       UInt_t time = fDigitReader->GetTime();
+       if((Int_t)time>=fFirstTimeBin && (Int_t)time+fDigitReader->GetBunchSize()<=fLastTimeBin){
+         Int_t indexInBunchData=0;
+         Bool_t moreDataInBunch=kFALSE;
+         UInt_t prevSignal=0;
+         Bool_t signalFalling=kFALSE;
+         const UInt_t *bunchData= fDigitReader->GetSignals();
+         do{
+           AliHLTTPCClusters candidate;
+           for(Int_t i=indexInBunchData;i<fDigitReader->GetBunchSize();i++){
+             // Checks if one need to deconvolute the signals
+             if(bunchData[i]>prevSignal && signalFalling==kTRUE){
+               if(i<fDigitReader->GetBunchSize()-1){ // means there are more than one signal left in the bunch
+                 moreDataInBunch=kTRUE;
+                 prevSignal=0;
+               }
+               break;
+             }
+             
+             // Checks if the signal is 0, then quit processing the data.
+             if(bunchData[i]==0 && i<fDigitReader->GetBunchSize()-1){//means we have 0 data fom the rcu, might happen depending on the configuration settings
+               moreDataInBunch=kTRUE;
+               prevSignal=0;
+               break;
+             }
+
+             if(prevSignal>bunchData[i]){//means the peak of the signal has been reached and deconvolution will happen if the signal rise again.
+               signalFalling=kTRUE;
+             }
+             candidate.fTotalCharge+=bunchData[i];     
+             candidate.fTime += time*bunchData[i];
+             candidate.fTime2 += time*time*bunchData[i];
+             if(bunchData[i]>candidate.fQMax){
+               candidate.fQMax=bunchData[i];
+             }
+
+             prevSignal=bunchData[i];
+             time++;
+             indexInBunchData++;
+           }
+           if(candidate.fTotalCharge>0){
+             candidate.fMean=candidate.fTime/candidate.fTotalCharge;
+             candidate.fPad=candidate.fTotalCharge*pad;
+             candidate.fPad2=candidate.fPad*pad;
+             candidate.fLastMergedPad=pad;
+             candidate.fRowNumber=row+fDigitReader->GetRowOffset();
+           }
+           fRowPadVector[row][pad]->AddClusterCandidate(candidate);
+           if(indexInBunchData<fDigitReader->GetBunchSize()-1){
+             moreDataInBunch=kFALSE;
+           }
+         }while(moreDataInBunch);
        }
-       fRowPadVector[row][pad]->AddClusterCandidate(candidate);
       }
     }
   }
@@ -716,6 +809,14 @@ Bool_t AliHLTTPCClusterFinder::ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCCluste
   for(UInt_t candidateNumber=0;candidateNumber<nextPad->fClusterCandidates.size();candidateNumber++){
     AliHLTTPCClusters *candidate =&nextPad->fClusterCandidates[candidateNumber]; 
     if(cluster->fMean-candidate->fMean==1 || candidate->fMean-cluster->fMean==1 || cluster->fMean-candidate->fMean==0){
+      if(fDeconvPad){
+       if(candidate->fTotalCharge<fTotalChargeOfPreviousClusterCandidate){//peak is reached
+         fChargeOfCandidatesFalling=kTRUE;
+       }
+       if(candidate->fTotalCharge>fTotalChargeOfPreviousClusterCandidate && fChargeOfCandidatesFalling==kTRUE){//we have deconvolution
+         return kFALSE;
+       }
+      }
       cluster->fMean=candidate->fMean;
       cluster->fTotalCharge+=candidate->fTotalCharge;
       cluster->fTime += candidate->fTime;
@@ -723,25 +824,21 @@ Bool_t AliHLTTPCClusterFinder::ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCCluste
       cluster->fPad+=candidate->fPad;
       cluster->fPad2=candidate->fPad2;
       cluster->fLastMergedPad=candidate->fPad;
-            
-      //cout<<"Adding "<<candidate->fTotalCharge<<"   to the pad "<<nextPad->GetPadNumber()<<"  row: "<<nextPad->GetRowNumber()<<"   HWAddress: "<<(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(nextPad->GetRowNumber(),nextPad->GetPadNumber())<<endl;
-
+      if(candidate->fQMax>cluster->fQMax){
+       cluster->fQMax=candidate->fQMax;
+      }
+      
       if(fDoPadSelection){
-       UInt_t rowNo = nextPad->GetRowNumber();
-       UInt_t padNo = nextPad->GetPadNumber();
-       if(padNo-1>0){
-        fRowPadVector[rowNo][padNo-2]->fSelectedPad=kTRUE;
-        fRowPadVector[rowNo][padNo-2]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-2);
-       }
-       fRowPadVector[rowNo][padNo-1]->fSelectedPad=kTRUE;// quick solution to set the first pad to selected
-       fRowPadVector[rowNo][padNo-1]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-1);
-       fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
-       fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
-       /*      if(padNo+1<(Int_t)fNumberOfPadsInRow[fRowOfFirstCandidate]){
-        fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
-        fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
-        }*/
-       //      cout<<"We have an active pad in row: "<<rowNo<<"  pad: "<<padNo<<"   hwadd: "<<(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo)<<endl;
+       UInt_t rowNo = nextPad->GetRowNumber();
+       UInt_t padNo = nextPad->GetPadNumber();
+       if(padNo-1>0){
+         fRowPadVector[rowNo][padNo-2]->fSelectedPad=kTRUE;
+         fRowPadVector[rowNo][padNo-2]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-2);
+       }
+       fRowPadVector[rowNo][padNo-1]->fSelectedPad=kTRUE;// quick solution to set the first pad to selected
+       fRowPadVector[rowNo][padNo-1]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-1);
+       fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
+       fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
       }
 
       //setting the matched pad to used
@@ -769,7 +866,6 @@ Int_t AliHLTTPCClusterFinder::FillHWAddressList(AliHLTUInt16_t *hwaddlist, Int_t
       if(fRowPadVector[row][pad]->fSelectedPad){
        if(counter<maxHWadd){
         hwaddlist[counter]=(AliHLTUInt16_t)fRowPadVector[row][pad]->fHWAddress;
-        //cout<<"Filling the f.. hardwareaddress: "<<fRowPadVector[row][pad]->fHWAddress<<endl;
         counter++;
        }
        else{
@@ -797,6 +893,7 @@ void AliHLTTPCClusterFinder::FindClusters()
        }
        tmpCandidate=&tmpPad->fClusterCandidates[candidate];
        UInt_t tmpTotalCharge=tmpCandidate->fTotalCharge;
+
        ComparePads(fRowPadVector[row][pad+1],tmpCandidate,pad+1);
        if(tmpCandidate->fTotalCharge>tmpTotalCharge){
          //we have a cluster
@@ -836,11 +933,11 @@ void AliHLTTPCClusterFinder::PrintClusters()
   // see header file for class documentation
   for(size_t i=0;i<fClusters.size();i++){
     HLTInfo("Cluster number: %d",i);
-    HLTInfo("Row: %d \t Pad: %d",fClusters[i].fRowNumber,fClusters[i].fFirstPad);
+    HLTInfo("Row: %d \t Pad: %d",fClusters[i].fRowNumber,fClusters[i].fPad/fClusters[i].fTotalCharge);
     HLTInfo("Total Charge:   %d",fClusters[i].fTotalCharge);
     HLTInfo("fPad:           %d",fClusters[i].fPad);
     HLTInfo("PadError:       %d",fClusters[i].fPad2);
-    HLTInfo("TimeMean:       %d",fClusters[i].fTime);
+    HLTInfo("TimeMean:       %d",fClusters[i].fTime/fClusters[i].fTotalCharge);
     HLTInfo("TimeError:      %d",fClusters[i].fTime2);
     HLTInfo("EndOfCluster:");
   }
@@ -917,7 +1014,13 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
          }  
        
        fSpacePointData[counter].fX = xyz[0];
-       fSpacePointData[counter].fY = xyz[1];
+       //      fSpacePointData[counter].fY = xyz[1];
+       if(fCurrentSlice<18){
+         fSpacePointData[counter].fY = xyz[1];
+       }
+       else{
+         fSpacePointData[counter].fY = -1*xyz[1];
+       }
        fSpacePointData[counter].fZ = xyz[2];
        
       } else {
@@ -931,6 +1034,8 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
       fSpacePointData[counter].fSigmaY2 = fpad2;
       fSpacePointData[counter].fSigmaZ2  = ftime2;
 
+      fSpacePointData[counter].fMaxQ = list[j].fQMax;
+
       fSpacePointData[counter].fUsed = kFALSE;         // only used / set in AliHLTTPCDisplay
       fSpacePointData[counter].fTrackN = -1;           // only used / set in AliHLTTPCDisplay
 
index 5eea963763a516c0d48a68ac36a7857d4d260793..2796afe0e326a747be6324f906dc34363d98fc94 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "AliHLTLogging.h"
 #include <vector>
+#include "AliHLTTPCTransform.h"
 
 class AliHLTTPCPad;
 class AliHLTTPCSpacePointData;
@@ -115,6 +116,7 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
     UInt_t fLastCharge;    //for deconvolution
     UInt_t fLastMergedPad; //dont merge twice per pad
     Int_t fRow;             //row value
+    UInt_t fQMax;           //qmax
   };
   typedef struct AliClusterData AliClusterData; //!
 
@@ -135,10 +137,10 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   void SetXYError(Float_t f) {fXYErr=f;}
   void SetZError(Float_t f) {fZErr=f;}
   void SetDeconv(Bool_t f) {fDeconvPad=f; fDeconvTime=f;}
+  void SetDeconvPad(Bool_t f) {fDeconvPad=f;}
+  void SetDeconvTime(Bool_t f) {fDeconvTime=f;}
   void SetThreshold(UInt_t i) {fThreshold=i;}
   void SetOccupancyLimit(Float_t f) {fOccupancyLimit=f;}
-  void SetSignalThreshold(Int_t i) {fSignalThreshold=i;}
-  void SetNSigmaThreshold(Double_t d) {fNSigmaThreshold=d;}
   void SetMatchWidth(UInt_t i) {fMatch=i;}
   void SetSTDOutput(Bool_t f=kFALSE) {fStdout=f;}  
   void SetCalcErr(Bool_t f=kTRUE) {fCalcerr=f;}
@@ -148,6 +150,7 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
 
   //----------------------------------Methods for the new unsorted way of reading data ----------
   void ReadDataUnsorted(void* ptr,unsigned long size);
+  void ReadDataUnsortedDeconvoluteTime(void* ptr,unsigned long size);
   void FindClusters();
   void WriteClusters(Int_t nclusters,AliHLTTPCClusters *list);
   void SetUnsorted(Int_t unsorted){fUnsorted=unsorted;}
@@ -159,6 +162,12 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   void SetDoPadSelection(Bool_t input){fDoPadSelection=input;}
   
   Int_t FillHWAddressList(AliHLTUInt16_t *hwaddlist, Int_t maxHWAddress);
+
+  void UpdateLastTimeBin(){fLastTimeBin=AliHLTTPCTransform::GetNTimeBins();}
+
+  void SetLastTimeBin(Int_t ltb){fLastTimeBin=ltb;}
+
+  void SetFirstTimeBin(Int_t ftb){fFirstTimeBin=ftb;}
   
   vector<AliHLTUInt16_t> fClustersHWAddressVector;  //! transient
   
@@ -177,7 +186,7 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
 
   UChar_t* fPtr;   //! pointer to packed block
   unsigned long fSize; //packed block size
-  Bool_t fDeconvTime; //deconv in time direction
+  Bool_t fDeconvTime;  //deconv in time direction
   Bool_t fDeconvPad;  //deconv in pad direction
   Bool_t fStdout;     //have print out in write clusters
   Bool_t fCalcerr;    //calculate centroid sigmas
@@ -191,10 +200,6 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   Int_t fCurrentPatch;   //current patch
   Int_t fMatch;          //size of match
   UInt_t fThreshold;     //threshold for clusters
-  /** threshold for zero suppression (applied per bin) */
-  Int_t fSignalThreshold;// see above
-  /** threshold for zero suppression 2007 December run */
-  Double_t fNSigmaThreshold; // see above
   Int_t fNClusters;      //number of found clusters
   Int_t fMaxNClusters;   //max. number of clusters
   Float_t fXYErr;        //fixed error in XY
@@ -205,10 +210,6 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   Int_t fUnsorted;       // enable for processing of unsorted digit data
   Bool_t fVectorInitialized;
 
-  //typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
-
-  //vector<AliHLTTPCPadVector> fRowPadVector;                        //! transient
-
   vector<AliHLTTPCClusters> fClusters;                             //! transient
   
   UInt_t* fNumberOfPadsInRow;                                      //! transient
@@ -219,11 +220,19 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
 
   Bool_t fDoPadSelection;                                         //! transient
 
+  Int_t fFirstTimeBin;                                            //! transient
+  
+  Int_t fLastTimeBin;                                             //! transient
+
+  UInt_t fTotalChargeOfPreviousClusterCandidate;                   //! transient
+
+  Bool_t fChargeOfCandidatesFalling;                               //! transient
+
 
 #ifdef do_mc
   void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
 #endif
   
-  ClassDef(AliHLTTPCClusterFinder,5) //Fast cluster finder
+  ClassDef(AliHLTTPCClusterFinder,6) //Fast cluster finder
 };
 #endif
index 9dee1b286c8ed2804f8509eb7536faa81be550b9..15bc3d75f038afc5de613a96cb9b881900b33039 100644 (file)
@@ -52,13 +52,17 @@ AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
   :
   fClusterFinder(NULL),
   fReader(NULL),
-  fClusterDeconv(true),
+  fDeconvTime(kFALSE),
+  fDeconvPad(kFALSE),
+  fClusterDeconv(false),
   fXYClusterError(-1),
   fZClusterError(-1),
   fModeSwitch(mode),
-  fUnsorted(0),
+  fUnsorted(1),
   fPatch(0),
-  fGetActivePads(0)
+  fGetActivePads(0),
+  fFirstTimeBin(-1),
+  fLastTimeBin(-1)
 {
   // see header file for class documentation
   // or
@@ -158,10 +162,10 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
 
   fClusterFinder = new AliHLTTPCClusterFinder();
 
-  Int_t sigthresh = -1;
-  Double_t sigmathresh= -1;
+  //  Int_t sigthresh = -1;
+  //  Double_t sigmathresh= -1;
   Float_t occulimit = 1.0;
-  Int_t oldRCUFormat=0;
+  //  Int_t oldRCUFormat=0;
   // Data Format version numbers:
   // 0: RCU Data format as delivered during TPC commissioning, pads/padrows are sorted, RCU trailer is one 32 bit word.
   // 1: As 0, but pads/padrows are delivered "as is", without sorting
@@ -174,31 +178,89 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
 
   while ( i < argc ) {      
 
-    // -- raw reader mode option
-    if ( !strcmp( argv[i], "rawreadermode" ) ) {
-      if ( argc <= i+1 ) {
-       Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Raw Reader Mode not specified" );
-       return ENOTSUP;
+
+
+    // -- deconvolute-time option
+    if ( !strcmp( argv[i], "-deconvolute-time" ) ) {
+      fDeconvTime = kTRUE;
+      i++;
+      continue;
+    }
+
+    // -- deconvolute-pad option
+    if ( !strcmp( argv[i], "-deconvolute-pad" ) ) {
+      fDeconvPad = kTRUE;
+      i++;
+      continue;
+    }
+
+    // -- number of timebins (default 1024)
+    if (!strcmp( argv[i], "-timebins") || !strcmp( argv[i], "timebins" )){
+      TString parameter(argv[i+1]);
+      parameter.Remove(TString::kLeading, ' '); // remove all blanks
+      if (parameter.IsDigit()) {
+       AliHLTTPCTransform::SetNTimeBins(parameter.Atoi());
+       HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
+       fClusterFinder->UpdateLastTimeBin();
+      } else {
+       HLTError("Cannot timebin specifier '%s'.", argv[i+1]);
+       return EINVAL;
+      }
+      if(!strcmp( argv[i], "timebins")){
+       HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
       }
+      i+=2;
+      continue;
+    }
 
-      Logging( kHLTLogWarning, "HLT::TPCClusterFinder::DoInit", "parameter rawreadermode is deprecated", "argument scan" );      
+    // -first-timebin (default 0)
+    if ( !strcmp( argv[i], "-first-timebin" ) ) {
+      TString parameter(argv[i+1]);
+      parameter.Remove(TString::kLeading, ' '); // remove all blanks
+      if (parameter.IsDigit()){
+       fFirstTimeBin=parameter.Atoi();
+       HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
+      } 
+      else {
+       HLTError("Cannot -first-timebin specifier '%s'. Not a number.", argv[i+1]);
+       return EINVAL;
+      }
+      i+=2;
+      continue;
+    }
 
-      i += 2;
+    // -last-timebin (default 1024)
+    if ( !strcmp( argv[i], "-last-timebin" ) ) {
+      TString parameter(argv[i+1]);
+      parameter.Remove(TString::kLeading, ' '); // remove all blanks
+      if (parameter.IsDigit()){
+       fLastTimeBin=parameter.Atoi();
+       HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
+      } 
+      else {
+       HLTError("Cannot -last-timebin specifier '%s'. Not a number.", argv[i+1]);
+       return EINVAL;
+      }
+      i+=2;
       continue;
     }
 
-    // -- pp run option
-    if ( !strcmp( argv[i], "pp-run" ) ) {
-      fClusterDeconv = false;
+    // --  unsorted option
+    if ( !strcmp( argv[i], "-sorted" ) ) {
+      fUnsorted=0;
       i++;
       continue;
     }
 
-    // -- zero suppression threshold
-    if ( !strcmp( argv[i], "adc-threshold" ) ) {
-      sigthresh = strtoul( argv[i+1], &cpErr ,0);
-      if ( *cpErr ) {
-       HLTError("Cannot convert threshold specifier '%s'.", argv[i+1]);
+      
+    // -- checking for active pads, used in 2007 December run
+    if ( !strcmp( argv[i], "-active-pads" ) || !strcmp( argv[i], "activepads" ) ) {
+      if(!strcmp( argv[i], "activepads" )){
+       HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'active-pads'");
+      }
+      fGetActivePads = strtoul( argv[i+1], &cpErr ,0);
+      if ( *cpErr ){
+       HLTError("Cannot convert activepads specifier '%s'. Should  be 0(off) or 1(on), must be integer", argv[i+1]);
        return EINVAL;
       }
       i+=2;
@@ -206,72 +268,91 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
     }
 
     // -- pad occupancy limit
-    if ( !strcmp( argv[i], "occupancy-limit" ) ) {
+    if ( !strcmp( argv[i], "-occupancy-limit" ) || !strcmp( argv[i], "occupancy-limit" ) ) {
+      if(!strcmp( argv[i], "occupancy-limit" )){
+       HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
+      }
       occulimit = strtod( argv[i+1], &cpErr);
       if ( *cpErr ) {
        HLTError("Cannot convert occupancy specifier '%s'.", argv[i+1]);
        return EINVAL;
       }
+      if(fModeSwitch!=kClusterFinderPacked){
+       HLTWarning("Argument '-occupancy-limit' is only used with -sorted set and with the TPCClusterFinderPacked , argument is deprecated");
+      }
       i+=2;
       continue;
     }
 
-    // -- number of timebins (default 1024)
-    if ( !strcmp( argv[i], "timebins" ) ) {
-      TString parameter(argv[i+1]);
-      parameter.Remove(TString::kLeading, ' '); // remove all blanks
-      if (parameter.IsDigit()) {
-       AliHLTTPCTransform::SetNTimeBins(parameter.Atoi());
-       HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
-      } else {
-       HLTError("Cannot timebin specifier '%s'.", argv[i+1]);
+
+    // -- raw reader mode option
+    if ( !strcmp( argv[i], "rawreadermode" ) ) {
+      if ( argc <= i+1 ) {
+       Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Raw Reader Mode not specified. rawreadermode is no longer a valid argument and will be deprecated even if rawreadermode is specified." );
+       return ENOTSUP;
+      }
+
+      HLTWarning("Argument 'rawreadermode' is deprecated");      
+
+      i += 2;
+      continue;
+    }
+
+
+    // -- pp-run option
+    if ( !strcmp( argv[i], "pp-run") ) {
+      HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
+      fClusterDeconv = false;
+      i++;
+      continue;
+    }
+
+    // -- zero suppression threshold
+    if ( !strcmp( argv[i], "adc-threshold" ) ) {
+      strtoul( argv[i+1], &cpErr ,0);
+      if ( *cpErr ) {
+       HLTError("Cannot convert threshold specifier '%s'.", argv[i+1]);
        return EINVAL;
       }
+      HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
       i+=2;
       continue;
     }
 
+
     // -- checking for rcu format
     if ( !strcmp( argv[i], "oldrcuformat" ) ) {
-      oldRCUFormat = strtoul( argv[i+1], &cpErr ,0);
+      strtoul( argv[i+1], &cpErr ,0);
       if ( *cpErr ){
        HLTError("Cannot convert oldrcuformat specifier '%s'. Should  be 0(off) or 1(on), must be integer", argv[i+1]);
        return EINVAL;
       }
+      HLTWarning("Argument 'oldrcuformat' is deprecated.");
       i+=2;
       continue;
     }
       
-    // -- checking for unsorted clusterfinding
+    // -- checking for unsorted clusterfinding (default 1)
     if ( !strcmp( argv[i], "unsorted" ) ) {
       fUnsorted = strtoul( argv[i+1], &cpErr ,0);
       if ( *cpErr ){
        HLTError("Cannot convert unsorted specifier '%s'. Should  be 0(off) or 1(on), must be integer", argv[i+1]);
        return EINVAL;
       }
-      i+=2;
-      continue;
-    }
-      
-    // -- checking for active pads, used in 2007 December run
-    if ( !strcmp( argv[i], "activepads" ) ) {
-      fGetActivePads = strtoul( argv[i+1], &cpErr ,0);
-      if ( *cpErr ){
-       HLTError("Cannot convert activepads specifier '%s'. Should  be 0(off) or 1(on), must be integer", argv[i+1]);
-       return EINVAL;
-      }
+      HLTWarning("Argument 'unsorted' is old and does not follow the new argument naming convention. A change has been made, and the clusterfinder will read the data unsorted by default. For sorted reading, please use '-sorted' as argument. (unsorted 0 will do the same job, but please change anyway.)");
       i+=2;
       continue;
     }
 
     // -- checking for nsigma-threshold, used in 2007 December run in ZeroSuppression
     if ( !strcmp( argv[i], "nsigma-threshold" ) ) {
-       sigmathresh = strtoul( argv[i+1], &cpErr ,0);
+      strtoul( argv[i+1], &cpErr ,0);
       if ( *cpErr ){
        HLTError("Cannot convert nsigma-threshold specifier '%s'. Must be integer", argv[i+1]);
        return EINVAL;
       }
       i+=2;
+      HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
       continue;
     }
 
@@ -280,16 +361,32 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
 
   }
 
+  //Checking for conflicting arguments
+  if(fClusterDeconv){
+    if(fDeconvPad==kTRUE || fDeconvTime==kTRUE){
+      HLTWarning("Conflicting arguments: argument 'pp-run' will be ignored.");
+    }
+  }
+  if(occulimit!=1.0 && fUnsorted){
+    HLTWarning("Argument 'occupancy-limit' is deprecated when doing unsorted data reading.");
+  }
+  if(fGetActivePads==kTRUE && fUnsorted==kFALSE){
+    HLTWarning("Argument '-active-pads' only work with unsorted data reading. Active pads list will not be produced.");
+  }
+  
+
   // Choose reader
   if (fModeSwitch==kClusterFinderPacked) {
       HLTDebug("using AliHLTTPCDigitReaderPacked");
       fReader = new AliHLTTPCDigitReaderPacked();
-      if(oldRCUFormat==1){
+      /*
+       if(oldRCUFormat==1){
        fReader->SetOldRCUFormat(kTRUE);
-      }
-      else if(oldRCUFormat!=0){
+       }
+       else if(oldRCUFormat!=0){
        HLTWarning("Wrong oldrcuformat specifier %d; oldrcuformat set to default(kFALSE)",oldRCUFormat);
-      }
+       }
+      */
       if(fUnsorted==1){
        fReader->SetUnsorted(kTRUE);
       }
@@ -314,21 +411,24 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
   else 
     fClusterFinder->SetOccupancyLimit(1.0);
       
-  // Variables to setup the Clusterfinder
-  // TODO: this sounds strange and has to be verified; is the cluster finder not working when
-  // fClusterDeconv = false ?
-  fClusterDeconv = true;
-  fXYClusterError = -1;
-  fZClusterError = -1;
-
-  fClusterFinder->SetDeconv( fClusterDeconv );
+  
+  fClusterFinder->SetDeconv(fClusterDeconv);
+  fClusterFinder->SetDeconvPad(fDeconvPad);
+  fClusterFinder->SetDeconvTime(fDeconvPad);
   fClusterFinder->SetXYError( fXYClusterError );
   fClusterFinder->SetZError( fZClusterError );
-  if ( (fXYClusterError>0) && (fZClusterError>0) )
+  if ( (fXYClusterError>0) && (fZClusterError>0) ){
     fClusterFinder->SetCalcErr( false );
-  fClusterFinder->SetSignalThreshold(sigthresh);
-  fClusterFinder->SetNSigmaThreshold(sigmathresh);
+  }
+  //  fClusterFinder->SetSignalThreshold(sigthresh);
+  //  fClusterFinder->SetNSigmaThreshold(sigmathresh);
+
+  if(fFirstTimeBin>0){
+    fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
+  }
+  if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
+    fClusterFinder->SetLastTimeBin(fLastTimeBin);
+  }
 
   return 0;
 }
@@ -433,8 +533,13 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
        if(fGetActivePads){
          fClusterFinder->SetDoPadSelection(kTRUE);
        }
-
-       fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
+       
+       if(fDeconvTime){
+         fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
+       }
+       else{
+         fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
+       }
 
        fClusterFinder->FindClusters();
       }
index a83c54e8dc603e4cea65c26578912d92e3a2539c..e20d6f5feb8cb7afdae0e8e560759854d3ade927 100644 (file)
@@ -23,19 +23,49 @@ class AliHLTTPCDigitReader;
  * Implementation of the cluster finder component.
  * The component implements the interface methods of the @ref AliHLTProcessor.
  * The actual cluster finding algorithm is implemented in @ref AliHLTTPCClusterFinder.
- * The component can handle unpacked and packed data of different formats via the
- * AliHLTTPCDigitReader implementations. Two components are registered, the
- * TPCClusterFinderUnpacked and the TPCClusterFinderPacked. The latter one can
- * instantiate different digit readers depending on the arguments.
+ * Two components are registered, TPCClusterFinderPacked and TPCClusterFinderDecoder.
+ * TPCClusterFinderDecoder use the AliTPCRawStream class for decoding of the data, while TPCClusterFinderDecoder 
+ * use the AliAltroDecoder for decoding the data.
+ *
+ * TPCClusterFinderDecoder is the fastest of the two, this is due to that the AliAltroDecoder
+ * returns data in a bunch format. A bunch consist of consecutive signals.
+ * TPCClusterFinderPacked first have to read the data one by one, which means that row, pad and
+ * time signals have to be compared between each new digit, which leads to a slower alorithm. 
  * 
- * The component has the following component arguments:
- * - adc-threshold   ADC count threshold for zero suppression, if <0 the base line
- *                   calculation and subtraction is switched off
- * - pp-run          set parameters specific to a pp run; currently this switches
- *                   cluster deconvolution off for pp runs (not true for unsorted reading)
- * - unsorted        if 1 the data will be read unsorted in to a PadArray object. This should
- *                   only be done on patch level since it use a lot of memory
- * - patch           specify on which patch to resd the data unsorted
+ * Component ID: \b TPCClusterFinderDecoder and TPCClusterFinderPacked <br>
+ * Library: \b libAliHLTTPC
+ *
+ * Mandatory arguments: <br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * Optional arguments: <br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -deconvolute-time <br>  
+ *      Turns on deconvolution in the time direction.
+ * \li -deconvolute-pad <br>  
+ *      Turns on deconvolution in the pad direction.
+ * \li -timebins <br>  
+ *      Sets the number of timebins (446 for simulated data, and 1024 for real data) Default:1024
+ * \li -first-timebin <br>  
+ *      First timebin taken into consideration when reading the data. 
+ * \li -last-timebin <br>  
+ *      Last timebin taken into consideration when reading the data. 
+ * \li -sorted <br>  
+ *      Switch off unsorted reading of data. Equivalent to the old argument unsorted 0.
+ * \li -active-pads <br>  
+ *      Switch off unsorted reading of data. Equivalent to the old argument unsorted 0.
+ * \li -occupancy-limit <br>  
+ *      Set the occupancy limit for the sorted clusterfinding.
+ *
+ *
+ * Obsolete arguments: <br>
+ * \li occupancy-limit <br>  
+ * \li rawreadermode   <br>  
+ * \li pp-run          <br>  
+ * \li adc-threshold   <br>  
+ * \li oldrcuformat    <br>  
+ * \li unsorted        <br>  
+ * \li nsigma-threshold <br>  
  *
  * @ingroup alihlt_tpc_components
  */
@@ -108,8 +138,16 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
        /** the reader object for data decoding */
        AliHLTTPCDigitReader* fReader;                                               //!transient
 
-       bool fClusterDeconv; //!transient
-       float fXYClusterError; //!transient
+       /** flag to deconvolute in time direction */
+       Bool_t fDeconvTime;                                                          //!transient
+
+       /** flag to deconvolute in pad direction */
+       Bool_t fDeconvPad;                                                           //!transient
+       /** flag to switch on/off deconvolution in pad and time directions (used by sorted clusterfinding method) */
+       bool fClusterDeconv;                                                         //!transient
+       /** Error in xy of cluster */
+       float fXYClusterError;                                                       //!transient
+       /** Error in Z direction of cluster */
        float fZClusterError; //!transient
        /**
         * switch to indicated the reader
@@ -117,7 +155,7 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
         * use fModeSwitch = 1 for unpacked inputtype "gkUnpackedRawDataType"
         * use fModeSwitch = 2 for packed inputtype "gkDDLPackedRawDataType" with new digit reader
         */
-       Int_t fModeSwitch;                                                           // see above
+       Int_t fModeSwitch;                                                            // see above
       
        /*
         * Reads the data the new unsorted way if true
@@ -132,12 +170,17 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
        Int_t fPatch;                                                                  //!transient
 
        /*
-        * Switch to specify if one ship out a list of active pads.
-        * Used for the 2007 December run. 
+        * Switch to specify if one ship out a list of active pads (pads conected to a cluster).
         */
        Int_t fGetActivePads;                                                          //!transient
 
-       ClassDef(AliHLTTPCClusterFinderComponent, 4)
+       /** First timebin taken into account when reading the data */
+       Int_t fFirstTimeBin;                                                           //!transient
+
+       /** Last timebin taken in to account when reading the data */
+       Int_t fLastTimeBin;                                                            //!transient
+
+       ClassDef(AliHLTTPCClusterFinderComponent, 5)
 
 };
 #endif
index 996d190315f33cfb2f1ef145552b3c273d893330..f4879cf451a6024890a10d61fbc16c951fae9cf0 100644 (file)
@@ -1,21 +1,21 @@
-// @(#) $Id$
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project        * 
- * ALICE Experiment at CERN, All rights reserved.                         *
- *                                                                        *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
- *                  Kenneth Aamodt   <Kenneth.aamodt@ift.uib.no>          *
- *                  for The ALICE HLT Project.                            *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Timm Steinbeck, Matthias Richter                      *
+//* Developers:      Kenneth Aamodt <kenneth.aamodt@student.uib.no>        *
+//*                  for The ALICE HLT Project.                            *
+//*                                                                        *
+//* Permission to use, copy, modify and distribute this software and its   *
+//* documentation strictly for non-commercial purposes is hereby granted   *
+//* without fee, provided that the above copyright notice appears in all   *
+//* copies and that both the copyright notice and this permission notice   *
+//* appear in the supporting documentation. The authors make no claims     *
+//* about the suitability of this software for any purpose. It is          *
+//* provided "as is" without express or implied warranty.                  *
+//**************************************************************************
 
 /** @file   AliHLTTPCPad.cxx
     @author Matthias Richter, Kenneth Aamodt
     @brief  Container Class for TPC Pads.
 */
 
-// see header file for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
 #if __GNUC__>= 3
 using namespace std;
 #endif
@@ -77,9 +71,7 @@ AliHLTTPCPad::AliHLTTPCPad()
   fDataSignals(NULL),
   fSignalPositionArray(NULL),
   fSizeOfSignalPositionArray(0),
-  fNGoodSignalsSent(0),
-  fNSigmaThreshold(0),
-  fSignalThreshold(0)
+  fNGoodSignalsSent(0)
 {
   // see header file for class documentation
   // or
@@ -121,9 +113,7 @@ AliHLTTPCPad::AliHLTTPCPad(Int_t dummy)
   fDataSignals(NULL),
   fSignalPositionArray(NULL),
   fSizeOfSignalPositionArray(0),
-  fNGoodSignalsSent(0),
-  fNSigmaThreshold(0),
-  fSignalThreshold(0)
+  fNGoodSignalsSent(0)
 {
   // see header file for class documentation
   // or
@@ -158,9 +148,7 @@ AliHLTTPCPad::AliHLTTPCPad(Int_t offset, Int_t nofBins)
   fDataSignals(NULL),
   fSignalPositionArray(NULL),
   fSizeOfSignalPositionArray(0),
-  fNGoodSignalsSent(0),
-  fNSigmaThreshold(0),
-  fSignalThreshold(0)
+  fNGoodSignalsSent(0)
 {
   // see header file for class documentation
 }
index f881fe61d2c345c937d4ed108580c01fbfa17d3d..bc52eb781f2f2c9826b4130e088be58d96014dbd 100644 (file)
@@ -338,16 +338,6 @@ public:
    */
   void PrintRawData();
 
-   /**
-   * Set the Signal Threshold
-   */
-  void SetSignalThreshold(Int_t i){fSignalThreshold=i;}
-
-  /**
-   * Set the nSigma threshold
-   */
-  void SetNSigmaThreshold(Double_t i){fNSigmaThreshold=i;}
-
   /**
    * Vector of cluster candidates
    */
@@ -426,12 +416,6 @@ public:
   /** Number of good signals sent (good signals is signals surviving ZeroSuppression) */
   Int_t fNGoodSignalsSent;
   
-  /** Number of sigma threshold for the ZeroSuppression */
-  Double_t fNSigmaThreshold;                                       //! transient
-
-  /** Signal threshold for the ZeroSuppression */
-  Double_t fSignalThreshold;                                       //! transient
-
-  ClassDef(AliHLTTPCPad, 5)
+  ClassDef(AliHLTTPCPad, 6)
 };
 #endif // ALIHLTTPCPAD_H
index dd7a4db06f5679b2dd9e1d662bc076c808f4faae..a254aa0b85194eb1b9cf4d4112d5f4279ce53832 100644 (file)
@@ -5,7 +5,7 @@
  * The reconstruction is done from the TPC digits.
  *
  * The output is written to an ESD file either using the TPCEsdWriter (an
- * AliFileWriter) or the TPCEsdConverter with an attached EsdCollector.
+ * AliHLTFileWriter) or the TPCEsdConverter with an attached EsdCollector.
  *
  * Matthias.Richter@ift.uib.no
  */
@@ -27,7 +27,7 @@
 
       // cluster finder components
       cf.Form("CF_%02d_%d", slice, part);
-      AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
+      AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "-timebins 446 -sorted");
       if (trackerInput.Length()>0) trackerInput+=" ";
       trackerInput+=cf;
     }
index 7fc4aa44d768a0695228dbacea79720149d28bbd..29d92d8e1581876323e79df1166db75d1ba08fa2 100644 (file)
@@ -27,7 +27,7 @@
 
       // cluster finder components
       cf.Form("CF_%02d_%d", slice, part);
-      AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
+      AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "-timebins 446 -sorted");
       if (trackerInput.Length()>0) trackerInput+=" ";
       trackerInput+=cf;
     }
index 3b886f46834f49e809176add615351b044f825e2..72ba5bdba7c1ce375e417a8d43efedd37376a7e4 100644 (file)
  *   aliroot -b -q rec-hlt-tpc.C'("input.root")'
  * </pre>
  *
+ * By the second parameter the digit reader can be chosen, default is
+ * AliHLTTPCDigitReaderPacked (=false). Set to true to use
+ * AliHLTTPCDigitReaderDecoder
+ *
  * In the first section, an analysis chain is defined. The scale of the
  * chain can be defined by choosing the range of sectors and partitions.
  *
@@ -27,7 +31,7 @@
  * @ingroup alihlt_tpc
  * @author Matthias.Richter@ift.uib.no
  */
-void rec_hlt_tpc(const char* input="./")
+void rec_hlt_tpc(const char* input="./", bool bUseClusterFinderDecoder=false)
 {
   if (!input) {
     cerr << "please specify input or run without arguments" << endl;
@@ -41,9 +45,6 @@ void rec_hlt_tpc(const char* input="./")
   gSystem->Load("libHLTrec.so");
   AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
 
-  // choose between ClusterFinderDecoder (true) and ClusterFinderPacked (false)
-  bool bUseClusterFinderDecoder=false;
-
   ///////////////////////////////////////////////////////////////////////////////////////////////////
   //
   // define the analysis chain to be run
@@ -53,6 +54,7 @@ void rec_hlt_tpc(const char* input="./")
   int iMinPart=0;
   int iMaxPart=5;
   TString writerInput;
+  TString mergerInput;
   for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
     TString trackerInput;
     for (int part=iMinPart; part<=iMaxPart; part++) {
@@ -69,9 +71,9 @@ void rec_hlt_tpc(const char* input="./")
       // cluster finder components
       cf.Form("CF_%02d_%d", slice, part);
       if (bUseClusterFinderDecoder) {
-       AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), "pp-run timebins 446 unsorted 1");
+       AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");
       } else {
-       AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderPacked", publisher.Data(), "pp-run timebins 446 rawreadermode 4");
+       AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderPacked", publisher.Data(), "-timebins 446 -sorted");
       }
       if (trackerInput.Length()>0) trackerInput+=" ";
       trackerInput+=cf;
@@ -84,10 +86,27 @@ void rec_hlt_tpc(const char* input="./")
     AliHLTConfiguration trackerconf(tracker.Data(), "TPCSliceTracker", trackerInput.Data(), "-pp-run -bfield 0.5");
     if (writerInput.Length()>0) writerInput+=" ";
     writerInput+=tracker;
+    if (mergerInput.Length()>0) mergerInput+=" ";
+    mergerInput+=tracker;
   }
 
-  // the writer configuration
-  AliHLTConfiguration fwconf("sink1", "FileWriter"   , writerInput.Data(), "-specfmt=_%d -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
+  // specify whether to write all blocks separately or merge the tracks
+  // and convert to ESD
+  bool writeBlocks=false;
+
+  if (writeBlocks) {
+    // the writer configuration
+    AliHLTConfiguration fwconf("sink1", "FileWriter"   , writerInput.Data(), "-specfmt=_%d -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
+  } else {
+    // GlobalMerger component
+    AliHLTConfiguration mergerconf("globalmerger","TPCGlobalMerger",mergerInput.Data(),"");
+
+    // the esd converter configuration
+    AliHLTConfiguration esdcconf("esd-converter", "TPCEsdConverter"   , "globalmerger", "-tree");
+    
+    // the root file writer configuration
+    AliHLTConfiguration sink("sink1", "EsdCollector"   , "esd-converter", "-directory hlt-tpc");
+  }
 
   ///////////////////////////////////////////////////////////////////////////////////////////////////
   //