Added the digit reader classes that allow reading of raw packed and unpacked
authortimms <timms@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 28 Oct 2005 09:45:11 +0000 (09:45 +0000)
committertimms <timms@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 28 Oct 2005 09:45:11 +0000 (09:45 +0000)
data via the same interface.

Copied the AliHLTTPCClustFinderNew class into the AliHLTTPCClusterFinder
class and modified this to use the new digit reader class(es) for reading
of its input data. The cluster finder can therefore now work both on
the raw packed data (as received from the TPC) and the pre-unpacked data
as delivered by the RawDataUnpackerComponent.

Added the TPC online display ROOT code in the OnlineDisplay subdirectory.

20 files changed:
HLT/TPCLib/AliHLTTPC.cxx
HLT/TPCLib/AliHLTTPC.h
HLT/TPCLib/AliHLTTPCClusterFinder.cxx [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCClusterFinder.h [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
HLT/TPCLib/AliHLTTPCClusterFinderComponent.h
HLT/TPCLib/AliHLTTPCDigitReader.cxx [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCDigitReader.h [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCDigitReaderPacked.cxx [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCDigitReaderPacked.h [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.h [new file with mode: 0644]
HLT/TPCLib/AliHLTTPCLinkDef.h
HLT/TPCLib/AliHLTTPCMemHandler.cxx
HLT/TPCLib/AliHLTTPCMemHandler.h
HLT/TPCLib/Makefile
HLT/TPCLib/OnlineDisplay/GEO/alice.geom [new file with mode: 0644]
HLT/TPCLib/OnlineDisplay/HLT-OnlineDisplay-HOMER.C [new file with mode: 0644]
HLT/TPCLib/OnlineDisplay/StartDisplayMacro.C [new file with mode: 0644]
HLT/TPCLib/OnlineDisplay/rootlogon.C [new file with mode: 0644]

index bd78aa1..814f1c0 100644 (file)
@@ -27,7 +27,8 @@
 #include "AliHLTTPCConfMapPoint.h"
 #include "AliHLTTPCConfMapTrack.h"
 #include "AliHLTTPCTransform.h"
-#include "AliHLTTPCClustFinderNew.h"
+#include "AliHLTTPCClusterFinder.h"
+#include "AliHLTTPCDigitReaderUnpacked.h"
 #include "AliHLTTPCDigitData.h"
 #include "AliHLTTPCTrackArray.h"
 #include "AliHLTTPCMemHandler.h"
@@ -357,9 +358,10 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
     AliHLTTPCSpacePointData *points =0;
     UInt_t ndigits=0;
     AliHLTTPCDigitRowData *digits =0;
+    UInt_t digitSize = 0;
     if(UseCF){
-      if(fUseBinary){
-        if(!fDoRoi){ 
+      if(fUseBinary) {
+        if(!fDoRoi) 
           if(1){     //Binary to Memory
            fFileHandler->Free();
             if(fNPatch == 1)
@@ -370,10 +372,13 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
            if(fPileUp)
              { //Read binary files which are not RLE
                digits = (AliHLTTPCDigitRowData*)fFileHandler->Allocate();
-               fFileHandler->Binary2Memory(ndigits,digits); 
+               fFileHandler->Binary2Memory(ndigits,digits, digitSize ); 
+               digitSize = fFileHandler->GetFileSize();
              }
            else //Read RLE binary files
-             digits= (AliHLTTPCDigitRowData *)fFileHandler->CompBinary2Memory(ndigits);
+               {
+               digits= (AliHLTTPCDigitRowData *)fFileHandler->CompBinary2Memory(ndigits, digitSize);
+               }
 
            fFileHandler->CloseBinaryInput(); 
           }
@@ -392,7 +397,7 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
             UInt_t datasize=memory->GetMemorySize(ndigits,comp);
             digits=(AliHLTTPCDigitRowData *)fFileHandler->Allocate(datasize);
             fBenchmark->Start("Unpacker"); 
-            fFileHandler->CompMemory2Memory(ndigits,digits,comp); 
+            fFileHandler->CompMemory2Memory(ndigits,digits,comp,digitSize); 
             fBenchmark->Stop("Unpacker");
             memory->Free();
           }
@@ -415,7 +420,7 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
             UInt_t rsize=fFileHandler->GetRandomSize();       
             digits=(AliHLTTPCDigitRowData*)fFileHandler->Allocate(dsize+rsize);
             fBenchmark->Start("Unpacker");
-            fFileHandler->CompMemory2Memory(ndigits,digits,comp); 
+            fFileHandler->CompMemory2Memory(ndigits,digits,comp,digitSize); 
             fBenchmark->Stop("Unpacker");
             memory->Free();
           }
@@ -437,7 +442,7 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
           UInt_t datasize=memory->GetMemorySize(ndigits,comp);
           digits=(AliHLTTPCDigitRowData *)fFileHandler->Allocate(datasize);
           fBenchmark->Start("Unpacker"); 
-          datasize = fFileHandler->CompMemory2Memory(ndigits,digits,comp); 
+          datasize = fFileHandler->CompMemory2Memory(ndigits,digits,comp,digitSize); 
           fBenchmark->Stop("Unpacker"); 
           memory->Free();
         }
@@ -469,7 +474,8 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
       }//end else UseBinary
 
       points = (AliHLTTPCSpacePointData *) memory->Allocate(kpointsize);
-      fClusterFinder = new AliHLTTPCClustFinderNew();
+      fClusterFinder = new AliHLTTPCClusterFinder();
+      fDigitReader = new AliHLTTPCDigitReaderUnpacked();
       fClusterFinder->InitSlice(slice,patch,fRow[patch][0],fRow[patch][1],kmaxpoints);
       fClusterFinder->SetDeconv(fClusterDeconv);
       fClusterFinder->SetXYError(fXYClusterError);
@@ -477,8 +483,10 @@ void AliHLTTPC::ProcessSlice(Int_t slice)
       if((fXYClusterError>0)&&(fZClusterError>0))
        fClusterFinder->SetCalcErr(kFALSE);
       fClusterFinder->SetOutputArray(points);
+      fClusterFinder->SetReader( fDigitReader );
       fBenchmark->Start("Cluster finder");
-      fClusterFinder->Read(ndigits,digits);
+      //fClusterFinder->Read(ndigits,digits);
+      fClusterFinder->Read( (void*)digits, (unsigned long) digitSize );
       fClusterFinder->ProcessDigits();
       fBenchmark->Stop("Cluster finder");
       npoints = fClusterFinder->GetNumberOfClusters();
index 93cbc26..54ac4fa 100644 (file)
@@ -27,7 +27,8 @@ class AliHLTTPCGlobalMerger;
 #ifndef no_root
 class TDirectory;
 #endif
-class AliHLTTPCClustFinderNew;
+class AliHLTTPCClusterFinder;
+class AliHLTTPCDigitReaderUnpacked;
 class AliHLTTPCMerger;
 class AliHLTTPCInterMerger;
 class AliHLTTPCFileHandler;
@@ -49,7 +50,8 @@ class AliHLTTPC : public TObject {
   AliHLTTPCTrackMerger *fTrackMerger; //!
   AliHLTTPCGlobalMerger *fGlobalMerger; //!
   AliHLTTPCInterMerger *fInterMerger; //!
-  AliHLTTPCClustFinderNew *fClusterFinder; //! 
+  AliHLTTPCClusterFinder *fClusterFinder; //! 
+  AliHLTTPCDigitReaderUnpacked* fDigitReader; //!
   AliHLTTPCMemHandler *fFileHandler; //!
   AliHLTTPCBenchmark *fBenchmark;//!
 
diff --git a/HLT/TPCLib/AliHLTTPCClusterFinder.cxx b/HLT/TPCLib/AliHLTTPCClusterFinder.cxx
new file mode 100644 (file)
index 0000000..1535b19
--- /dev/null
@@ -0,0 +1,543 @@
+// @(#) $Id$
+
+// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>, 
+//         Constantin Loizides <mailto:loizides@ikf.uni-frankfurt.de>
+//         Jochen Thaeder <mailto:thaeder@kip.uni-heidelberg.de>
+
+//*-- Copyright &copy ALICE HLT Group
+
+
+#include "AliHLTTPCDigitReader.h"
+#include "AliHLTTPCStandardIncludes.h"
+#include "AliHLTTPCRootTypes.h"
+#include "AliHLTTPCLogging.h"
+#include "AliHLTTPCClusterFinder.h"
+#include "AliHLTTPCDigitData.h"
+#include "AliHLTTPCTransform.h"
+#include "AliHLTTPCSpacePointData.h"
+#include "AliHLTTPCMemHandler.h"
+
+#if __GNUC__ >= 3
+using namespace std;
+#endif
+
+/** \class AliHLTTPCClusterFinder
+<pre>
+//_____________________________________________________________
+// AliHLTTPCClusterFinder
+//
+// The current cluster finder for HLT
+// (Based on STAR L3)
+// 
+// The cluster finder is initialized with the Init function, 
+// providing the slice and patch information to work on. 
+//
+// The input is a provided by the AliHLTTPCDigitReader class,
+// using the init() funktion, and the next() funktion in order 
+// to get the next bin. Either packed or unpacked data can be
+// processed, dependent if one uses AliHLTTPCDigitReaderPacked 
+// class or AliHLTTPCDigitReaderUnpacked class in the 
+// Clusterfinder Component.
+// The resulting space points will be in the
+// array given by the SetOutputArray function.
+// 
+// There are several setters which control the behaviour:
+//
+// - SetXYError(Float_t):   set fixed error in XY direction
+// - SetZError(Float_t):    set fixed error in Z  direction
+//                            (used if errors are not calculated) 
+// - SetDeconv(Bool_t):     switch on/off deconvolution
+// - SetThreshold(UInt_t):  set charge threshold for cluster
+// - SetMatchWidth(UInt_t): set the match distance in 
+//                            time for sequences to be merged 
+// - SetSTDOutput(Bool_t):  switch on/off output about found clusters   
+// - SetCalcErr(Bool_t):    switch on/off calculation of 
+//                          space point errors (or widths in raw system)
+// - SetRawSP(Bool_t):      switch on/off convertion to raw system
+//
+//
+// Example Usage:
+//
+// AliHLTTPCFileHandler *file = new AliHLTTPCFileHandler();
+// file->SetAliInput(digitfile); //give some input file
+// for(int slice=0; slice<=35; slice++){
+//   for(int patch=0; pat<6; pat++){
+//     file->Init(slice,patch);
+//     UInt_t ndigits=0;
+//     UInt_t maxclusters=100000;
+//     UInt_t pointsize = maxclusters*sizeof(AliHLTTPCSpacePointData);
+//     AliHLTTPCSpacePointData *points = (AliHLTTPCSpacePointData*)memory->Allocate(pointsize);
+//     AliHLTTPCDigitRowData *digits = (AliHLTTPCDigitRowData*)file->AliAltroDigits2Memory(ndigits,event);
+//     AliHLTTPCClusterFinder *cf = new AliHLTTPCClusterFinder();
+//     cf->SetMatchWidth(2);
+//     cf->InitSlice( slice, patch, row[0], row[1], maxPoints );
+//     cf->SetSTDOutput(kTRUE);    //Some output to standard IO
+//     cf->SetRawSP(kFALSE);       //Convert space points to local system
+//     cf->SetThreshold(5);        //Threshold of cluster charge
+//     cf->SetDeconv(kTRUE);       //Deconv in pad and time direction
+//     cf->SetCalcErr(kTRUE);      //Calculate the errors of the spacepoints
+//     cf->SetOutputArray(points); //Move the spacepoints to the array
+//     cf->Read(iter->fPtr, iter->fSize ); //give the data to the cf
+//     cf->ProcessDigits();        //process the rows given by init
+//     Int_t npoints = cf->GetNumberOfClusters();
+//     AliHLTTPCMemHandler *out= new AliHLTTPCMemHandler();
+//     out->SetBinaryOutput(fname);
+//     out->Memory2Binary(npoints,points); //store the spacepoints
+//     out->CloseBinaryOutput();
+//     delete out;
+//     file->free();
+//     delete cf;
+//   }
+// }
+</pre> 
+*/
+
+ClassImp(AliHLTTPCClusterFinder)
+
+AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
+{
+  //constructor
+  fMatch = 1;
+  fThreshold = 10;
+  fXYErr = 0.2;
+  fZErr = 0.3;
+  fDeconvPad = kTRUE;
+  fDeconvTime = kTRUE;
+  fStdout = kFALSE;
+  fCalcerr = kTRUE;
+  fRawSP = kFALSE;
+  fFirstRow=0;
+  fLastRow=0;
+  fDigitReader = 0;
+
+}
+
+AliHLTTPCClusterFinder::~AliHLTTPCClusterFinder()
+{
+  //destructor
+}
+void AliHLTTPCClusterFinder::InitSlice(Int_t slice,Int_t patch,Int_t firstrow, Int_t lastrow,Int_t nmaxpoints)
+{
+  //init slice
+  fNClusters = 0;
+  fMaxNClusters = nmaxpoints;
+  fCurrentSlice = slice;
+  fCurrentPatch = patch;
+  fFirstRow = firstrow;
+  fLastRow = lastrow;
+}
+
+void AliHLTTPCClusterFinder::InitSlice(Int_t slice,Int_t patch,Int_t nmaxpoints)
+{
+  //init slice
+  fNClusters = 0;
+  fMaxNClusters = nmaxpoints;
+  fCurrentSlice = slice;
+  fCurrentPatch = patch;
+  fFirstRow=AliHLTTPCTransform::GetFirstRow(patch);
+  fLastRow=AliHLTTPCTransform::GetLastRow(patch);
+}
+
+void AliHLTTPCClusterFinder::SetOutputArray(AliHLTTPCSpacePointData *pt)
+{
+  //set pointer to output
+  fSpacePointData = pt;
+}
+
+void AliHLTTPCClusterFinder::Read(void* ptr,unsigned long size){
+  //set input pointer
+  fPtr = (UChar_t*)ptr;
+  fSize = size;
+}
+
+void AliHLTTPCClusterFinder::ProcessDigits()
+{
+  bool readValue = true;
+  Int_t newRow = 0;    
+  Int_t rowOffset = 0;
+  UChar_t pad;
+  UShort_t time,newTime=0;
+  UInt_t charge,newPad=0;
+
+  fNClusters = 0;
+
+  // initialize block for reading packed data
+  fDigitReader->InitBlock(fPtr,fSize,fFirstRow,fLastRow);
+  readValue = fDigitReader->Next();
+
+  if (!readValue)return;
+  pad = fDigitReader->GetPad();
+  time = fDigitReader->GetTime();
+  fCurrentRow = fDigitReader->GetRow();
+
+  if ( fCurrentPatch >= 2 ) // Outer sector, patches 2, 3, 4, 5
+    rowOffset = AliHLTTPCTransform::GetFirstRow( 2 );
+
+  fCurrentRow += rowOffset;
+
+  UInt_t lastpad = 123456789;
+  AliClusterData *pad1[5000]; //2 lists for internal memory=2pads
+  AliClusterData *pad2[5000]; //2 lists for internal memory=2pads
+  AliClusterData clusterlist[10000]; //Clusterlist
+
+  AliClusterData **currentPt;  //List of pointers to the current pad
+  AliClusterData **previousPt; //List of pointers to the previous pad
+  currentPt = pad2;
+  previousPt = pad1;
+  UInt_t nprevious=0,ncurrent=0,ntotal=0;
+
+  while ( readValue ){   // Reads through all digits in block
+
+    if(pad != lastpad){
+      //This is a new pad
+      
+      //Switch the lists:
+      if(currentPt == pad2){
+       currentPt = pad1;
+       previousPt = pad2;
+      }
+      else {
+       currentPt = pad2;
+       previousPt = pad1;
+      }
+      nprevious = ncurrent;
+      ncurrent = 0;
+      if(pad != lastpad+1){
+       //this happens if there is a pad with no signal.
+       nprevious = ncurrent = 0;
+      }
+      lastpad = pad;
+    }
+
+    Bool_t newcluster = kTRUE;
+    UInt_t seqcharge=0,seqaverage=0,seqerror=0;
+    UInt_t lastcharge=0,lastwas_falling=0;
+    Int_t newbin=-1;
+
+
+    if(fDeconvTime){
+      redo: //This is a goto.
+      
+      if(newbin > -1){
+       //bin = newbin;
+       newbin = -1;
+      }
+         
+      lastcharge=0;
+      lastwas_falling = 0;
+    }
+
+
+    // LOOP OVER CURRENR SEQUENCE
+    while(1){ //Loop over current
+      charge = fDigitReader->GetSignal();
+
+      if(time >= AliHLTTPCTransform::GetNTimeBins()){
+       LOG(AliHLTTPCLog::kFatal,"AliHLTTPCClusterFinder::ProcessRow","Digits")
+         <<"Timebin out of range "<<(Int_t)time<<ENDLOG;
+       break;
+      }
+      
+      //Get the current ADC-value
+      if(fDeconvTime){
+
+       //Check if the last pixel in the sequence is smaller than this
+       if(charge > lastcharge){
+         if(lastwas_falling){
+           newbin = 1;
+           break;
+         }
+       }
+       else lastwas_falling = 1; //last pixel was larger than this
+       lastcharge = charge;
+      }
+         
+      //Sum the total charge of this sequence
+      seqcharge += charge;
+      seqaverage += time*charge;
+      seqerror += time*time*charge;
+      
+      readValue = fDigitReader->Next();
+      
+      //Check where to stop:
+      if(!readValue) break; //No more value
+
+      newPad = fDigitReader->GetPad();
+      newTime = fDigitReader->GetTime();
+      newRow = fDigitReader->GetRow() + rowOffset;
+
+      if(newPad != pad)break; //new pad
+      if(newTime != time+1) break; //end of sequence
+
+      // pad = newpad;    is equal
+      time = newTime;
+
+    }//end loop over sequence
+
+
+    //Calculate mean of sequence:
+    Int_t seqmean=0;
+    if(seqcharge)
+      seqmean = seqaverage/seqcharge;
+    else{
+      LOG(AliHLTTPCLog::kFatal,"AliHLTTPCClusterFinder::ProcessRow","Data")
+       <<"Error in data given to the cluster finder"<<ENDLOG;
+      seqmean = 1;
+      seqcharge = 1;
+    }
+
+    //Calculate mean in pad direction:
+    Int_t padmean = seqcharge*pad;
+    Int_t paderror = pad*padmean;
+
+
+    //Compare with results on previous pad:
+    for(UInt_t p=0; p<nprevious; p++){
+      
+      //dont merge sequences on the same pad twice
+      if(previousPt[p]->fLastMergedPad==pad) continue;
+
+      Int_t difference = seqmean - previousPt[p]->fMean;
+      if(difference < -fMatch) break;
+
+      if(difference <= fMatch){ //There is a match here!!
+       AliClusterData *local = previousPt[p];
+       
+       if(fDeconvPad){
+         if(seqcharge > local->fLastCharge){
+           if(local->fChargeFalling){ //The previous pad was falling
+             break; //create a new cluster
+           }               
+         }
+         else local->fChargeFalling = 1;
+         local->fLastCharge = seqcharge;
+       }
+             
+       //Don't create a new cluster, because we found a match
+       newcluster = kFALSE;
+             
+       //Update cluster on current pad with the matching one:
+       local->fTotalCharge += seqcharge;
+       local->fPad += padmean;
+       local->fPad2 += paderror;
+       local->fTime += seqaverage;
+       local->fTime2 += seqerror;
+       local->fMean = seqmean;
+       local->fFlags++; //means we have more than one pad 
+       local->fLastMergedPad = pad;
+
+       currentPt[ncurrent] = local;
+       ncurrent++;
+             
+       break;
+      } //Checking for match at previous pad
+    } //Loop over results on previous pad.
+
+
+    if(newcluster){
+      //Start a new cluster. Add it to the clusterlist, and update
+      //the list of pointers to clusters in current pad.
+      //current pad will be previous pad on next pad.
+
+      //Add to the clusterlist:
+      AliClusterData *tmp = &clusterlist[ntotal];
+      tmp->fTotalCharge = seqcharge;
+      tmp->fPad = padmean;
+      tmp->fPad2 = paderror;
+      tmp->fTime = seqaverage;
+      tmp->fTime2 = seqerror;
+      tmp->fMean = seqmean;
+      tmp->fFlags = 0;  //flags for single pad clusters
+      tmp->fLastMergedPad = pad;
+
+      if(fDeconvPad){
+       tmp->fChargeFalling = 0;
+       tmp->fLastCharge = seqcharge;
+      }
+
+      //Update list of pointers to previous pad:
+      currentPt[ncurrent] = &clusterlist[ntotal];
+      ntotal++;
+      ncurrent++;
+    }
+
+    if(fDeconvTime)
+      if(newbin >= 0) goto redo;
+  
+    // to prevent endless loop  
+    if(time >= AliHLTTPCTransform::GetNTimeBins()){
+      LOG(AliHLTTPCLog::kFatal,"AliHLTTPCClusterFinder::ProcessRow","Digits")
+       <<"Timebin out of range "<<(Int_t)time<<ENDLOG;
+      break;
+    }
+
+
+    if(!readValue) break; //No more value
+
+    if(fCurrentRow != newRow){
+      WriteClusters(ntotal,clusterlist);
+
+      lastpad = 123456789;
+
+      currentPt = pad2;
+      previousPt = pad1;
+      nprevious=0;
+      ncurrent=0;
+      ntotal=0;
+      
+      fCurrentRow = newRow;
+    }
+
+    pad = newPad;
+    time = newTime;
+  
+  } // END while(readValue)
+
+  WriteClusters(ntotal,clusterlist);
+
+  LOG(AliHLTTPCLog::kInformational,"AliHLTTPCClusterFinder::ProcessDigits","Space points") 
+    << "ClusterFinder found " << fNClusters << " clusters in slice " << fCurrentSlice << " patch " 
+    << fCurrentPatch << ENDLOG;
+
+} // ENDEND
+
+void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
+{
+  //write cluster to output pointer
+  Int_t thisrow,thissector;
+  UInt_t counter = fNClusters;
+  
+  for(int j=0; j<nclusters; j++)
+    {
+      if(!list[j].fFlags) continue; //discard single pad clusters
+      if(list[j].fTotalCharge < fThreshold) continue; //noise cluster
+
+      Float_t xyz[3];      
+      Float_t fpad =(Float_t)list[j].fPad / list[j].fTotalCharge;
+      Float_t fpad2=fXYErr*fXYErr; //fixed given error
+      Float_t ftime =(Float_t)list[j].fTime / list[j].fTotalCharge;
+      Float_t ftime2=fZErr*fZErr;  //fixed given error
+
+      if(fCalcerr) { //calc the errors, otherwice take the fixed error 
+       Int_t patch = AliHLTTPCTransform::GetPatch(fCurrentRow);
+       UInt_t q2=list[j].fTotalCharge*list[j].fTotalCharge;
+       Float_t sy2=list[j].fPad2 * list[j].fTotalCharge - list[j].fPad * list[j].fPad;
+       sy2/=q2;
+       if(sy2 < 0) {
+           LOG(AliHLTTPCLog::kError,"AliHLTTPCClusterFinder::WriteClusters","Cluster width")
+             <<"SigmaY2 negative "<<sy2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
+           continue;
+       } else {
+         if(!fRawSP){
+           fpad2 = (sy2 + 1./12)*AliHLTTPCTransform::GetPadPitchWidth(patch)*AliHLTTPCTransform::GetPadPitchWidth(patch);
+           if(sy2 != 0){
+             fpad2*=0.108; //constants are from offline studies
+             if(patch<2)
+               fpad2*=2.07;
+           }
+         } else fpad2=sy2; //take the width not the error
+       }
+       Float_t sz2=list[j].fTime2*list[j].fTotalCharge - list[j].fTime*list[j].fTime;
+       sz2/=q2;
+       if(sz2 < 0){
+         LOG(AliHLTTPCLog::kError,"AliHLTTPCClusterFinder::WriteClusters","Cluster width")
+           <<"SigmaZ2 negative "<<sz2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
+         continue;
+       } else {
+         if(!fRawSP){
+           ftime2 = (sz2 + 1./12)*AliHLTTPCTransform::GetZWidth()*AliHLTTPCTransform::GetZWidth();
+           if(sz2 != 0) {
+             ftime2 *= 0.169; //constants are from offline studies
+             if(patch<2)
+               ftime2 *= 1.77;
+           }
+         } else ftime2=sz2; //take the width, not the error
+       }
+      }
+      if(fStdout==kTRUE)
+       cout<<"WriteCluster: padrow "<<fCurrentRow<<" pad "<<fpad << " +- "<<fpad2<<" time "<<ftime<<" +- "<<ftime2<<" charge "<<list[j].fTotalCharge<<endl;
+      
+      if(!fRawSP){
+       AliHLTTPCTransform::Slice2Sector(fCurrentSlice,fCurrentRow,thissector,thisrow);
+       AliHLTTPCTransform::Raw2Local(xyz,thissector,thisrow,fpad,ftime);
+       
+       if(xyz[0]==0) LOG(AliHLTTPCLog::kError,"AliHLTTPCClustFinder","Cluster Finder")
+         <<AliHLTTPCLog::kDec<<"Zero cluster"<<ENDLOG;
+       if(fNClusters >= fMaxNClusters)
+         {
+           LOG(AliHLTTPCLog::kError,"AliHLTTPCClustFinder::WriteClusters","Cluster Finder")
+             <<AliHLTTPCLog::kDec<<"Too many clusters "<<fNClusters<<ENDLOG;
+           return;
+         }  
+       
+       fSpacePointData[counter].fX = xyz[0];
+       fSpacePointData[counter].fY = xyz[1];
+       fSpacePointData[counter].fZ = xyz[2];
+       
+      } else {
+       fSpacePointData[counter].fX = fCurrentRow;
+       fSpacePointData[counter].fY = fpad;
+       fSpacePointData[counter].fZ = ftime;
+      }
+      
+      fSpacePointData[counter].fCharge = list[j].fTotalCharge;
+      fSpacePointData[counter].fPadRow = fCurrentRow;
+      fSpacePointData[counter].fSigmaY2 = fpad2;
+      fSpacePointData[counter].fSigmaZ2  = ftime2;
+
+      Int_t patch=fCurrentPatch;
+      if(patch==-1) patch=0; //never store negative patch number
+      fSpacePointData[counter].fID = counter
+       +((fCurrentSlice&0x7f)<<25)+((patch&0x7)<<22);//Uli
+
+#ifdef do_mc
+      Int_t trackID[3];
+      GetTrackID((Int_t)rint(fpad),(Int_t)rint(ftime),trackID);
+
+      fSpacePointData[counter].fTrackID[0] = trackID[0];
+      fSpacePointData[counter].fTrackID[1] = trackID[1];
+      fSpacePointData[counter].fTrackID[2] = trackID[2];
+
+      //cout<<"padrow "<<fCurrentRow<<" pad "<<(Int_t)rint(fpad)<<" time "<<(Int_t)rint(ftime)<<" Trackid "<<trackID[0]<<endl;
+#endif
+      
+      fNClusters++;
+      counter++;
+    }
+}
+
+// STILL TO FIX  ----------------------------------------------------------------------------
+
+#ifdef do_mc
+void AliHLTTPCClusterFinder::GetTrackID(Int_t pad,Int_t time,Int_t *trackID)
+{
+  //get mc id
+  AliHLTTPCDigitRowData *rowPt = (AliHLTTPCDigitRowData*)fDigitRowData;
+  
+  trackID[0]=trackID[1]=trackID[2]=-2;
+  //cout<<"Looking for pad "<<pad<<" time "<<time<<endl;
+  for(Int_t i=fFirstRow; i<=fLastRow; i++){
+    if(rowPt->fRow < (UInt_t)fCurrentRow){
+      AliHLTTPCMemHandler::UpdateRowPointer(rowPt);
+      continue;
+    }
+    AliHLTTPCDigitData *digPt = (AliHLTTPCDigitData*)rowPt->fDigitData;
+    for(UInt_t j=0; j<rowPt->fNDigit; j++){
+      Int_t cpad = digPt[j].fPad;
+      Int_t ctime = digPt[j].fTime;
+      if(cpad != pad) continue;
+      if(ctime != time) continue;
+
+      trackID[0] = digPt[j].fTrackID[0];
+      trackID[1] = digPt[j].fTrackID[1];
+      trackID[2] = digPt[j].fTrackID[2];
+      
+      //cout<<"Reading row "<<fCurrentRow<<" pad "<<cpad<<" time "<<ctime<<" trackID "<<digPt[j].fTrackID[0]<<endl;
+      break;
+    }
+    break;
+  }
+}
+#endif
diff --git a/HLT/TPCLib/AliHLTTPCClusterFinder.h b/HLT/TPCLib/AliHLTTPCClusterFinder.h
new file mode 100644 (file)
index 0000000..984dbf7
--- /dev/null
@@ -0,0 +1,82 @@
+// @(#) $Id$
+
+#ifndef AliHLTTPC_ClusterFinder
+#define AliHLTTPC_ClusterFinder
+
+class AliHLTTPCSpacePointData;
+class AliHLTTPCDigitReader;
+
+class AliHLTTPCClusterFinder {
+
+ public:
+  struct AliClusterData
+  {
+    UInt_t fTotalCharge;   //tot charge of cluster
+    UInt_t fPad;           //pad value
+    UInt_t fTime;          //time value
+    ULong64_t fPad2;       //for error in XY direction
+    ULong64_t fTime2;      //for error in Z  direction
+    UInt_t fMean;          //mean in time
+    UInt_t fFlags;         //different flags
+    UInt_t fChargeFalling; //for deconvolution
+    UInt_t fLastCharge;    //for deconvolution
+    UInt_t fLastMergedPad; //dont merge twice per pad
+  };
+  typedef struct AliClusterData AliClusterData; //!
+
+ private: 
+  AliHLTTPCSpacePointData *fSpacePointData; //!
+  AliHLTTPCDigitReader *fDigitReader;
+
+  UChar_t* fPtr;   //pointer to packed block
+  unsigned long fSize; //packed block size
+  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
+  Bool_t fRawSP;      //store centroids in raw system
+
+
+  Int_t fFirstRow;       //first row
+  Int_t fLastRow;        //last row
+  Int_t fCurrentRow;     //current active row
+  Int_t fCurrentSlice;   //current slice
+  Int_t fCurrentPatch;   //current patch
+  Int_t fMatch;          //size of match
+  UInt_t fThreshold;     //threshold for clusters
+  Int_t fNClusters;      //number of found clusters
+  Int_t fMaxNClusters;   //max. number of clusters
+  Float_t fXYErr;        //fixed error in XY
+  Float_t fZErr;         //fixed error in Z
+
+#ifdef do_mc
+  void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
+#endif
+  
+ public:
+  AliHLTTPCClusterFinder();
+  virtual ~AliHLTTPCClusterFinder();
+
+  void Read(void* ptr,unsigned long size);
+
+  void InitSlice(Int_t slice,Int_t patch,Int_t firstrow, Int_t lastrow,Int_t maxpoints);
+  void InitSlice(Int_t slice,Int_t patch,Int_t maxpoints);
+  void ProcessDigits();
+
+  void SetOutputArray(AliHLTTPCSpacePointData *pt);
+  void WriteClusters(Int_t n_clusters,AliClusterData *list);
+
+  void SetXYError(Float_t f) {fXYErr=f;}
+  void SetZError(Float_t f) {fZErr=f;}
+  void SetDeconv(Bool_t f) {fDeconvPad=f; fDeconvTime=f;}
+  void SetThreshold(UInt_t i) {fThreshold=i;}
+  void SetMatchWidth(UInt_t i) {fMatch=i;}
+  void SetSTDOutput(Bool_t f=kFALSE) {fStdout=f;}  
+  void SetCalcErr(Bool_t f=kTRUE) {fCalcerr=f;}
+  void SetRawSP(Bool_t f=kFALSE) {fRawSP=f;}
+  void SetReader(AliHLTTPCDigitReader* f){fDigitReader = f;}
+  Int_t GetNumberOfClusters() const {return fNClusters;}
+  
+  ClassDef(AliHLTTPCClusterFinder,1) //Fast cluster finder
+};
+#endif
index b19cd6b..b258965 100644 (file)
@@ -5,6 +5,7 @@
  *                                                                        *
  * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
  *          Timm Steinbeck <timm@kip.uni-heidelberg.de>                   *
+ *          Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
  *          for The ALICE Off-line Project.                               *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 // a TPC cluster finder processing component for the HLT                     //
+// useable for packed data or unpacked data                                  //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+
 #if __GNUC__== 3
 using namespace std;
 #endif
 
 #include "AliHLTTPCClusterFinderComponent.h"
-#include "AliHLTTPCClustFinderNew.h"
+#include "AliHLTTPCDigitReaderPacked.h"
+#include "AliHLTTPCDigitReaderUnpacked.h"
+#include "AliHLTTPCClusterFinder.h"
 #include "AliHLTTPCSpacePointData.h"
 #include "AliHLTTPCRawDataFormat.h"
 #include "AliHLTTPCClusterDataFormat.h"
@@ -36,13 +41,20 @@ using namespace std;
 #include <errno.h>
 
 // this is a global object used for automatic component registration, do not use this
-AliHLTTPCClusterFinderComponent gAliHLTTPCClusterFinderComponent;
+AliHLTTPCClusterFinderComponent gAliHLTTPCClusterFinderComponentPacked(true);
+AliHLTTPCClusterFinderComponent gAliHLTTPCClusterFinderComponentUnpacked(false);
 
 ClassImp(AliHLTTPCClusterFinderComponent)
 
-AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent()
+AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(bool packed)
     {
+    // use fPackedSwitch = true for packed inputtype "gkDDLPackedRawDataType"
+    // use fPackedSwitch = false for unpacked inputtype "gkUnpackedRawDataType"
+    fPackedSwitch = packed;
+
     fClusterFinder = NULL;
+    fReaderPacked = NULL;
+    fReaderUnpacked = NULL;
     fClusterDeconv = true;
     fXYClusterError = -1;
     fZClusterError = -1;
@@ -57,13 +69,16 @@ AliHLTTPCClusterFinderComponent::~AliHLTTPCClusterFinderComponent()
 
 const char* AliHLTTPCClusterFinderComponent::GetComponentID()
     {
-    return "TPCClusterFinder";
+      if (fPackedSwitch) return "TPCClusterFinderPacked";
+      else return "TPCClusterFinderUnpacked";
     }
 
 void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponent_DataType>& list)
     {
-    list.clear();
-    list.push_back( AliHLTTPCDefinitions::gkUnpackedRawDataType );
+    list.clear(); 
+    if (fPackedSwitch) list.push_back( AliHLTTPCDefinitions::gkDDLPackedRawDataType );
+    else list.push_back( AliHLTTPCDefinitions::gkUnpackedRawDataType );
+   
     }
 
 AliHLTComponent_DataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
@@ -73,77 +88,131 @@ AliHLTComponent_DataType AliHLTTPCClusterFinderComponent::GetOutputDataType()
 
 void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
     {
-    // XXX TODO: Find more realistic values.
+    // XXX TODO: Find more realistic values.  
     constBase = 0;
-    inputMultiplier = 0.4;
+    if (fPackedSwitch)  inputMultiplier = (6 * 0.4);
+    else  inputMultiplier = 0.4;
     }
 
 AliHLTComponent* AliHLTTPCClusterFinderComponent::Spawn()
     {
-    return new AliHLTTPCClusterFinderComponent;
+    return new AliHLTTPCClusterFinderComponent(fPackedSwitch);
     }
        
 int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
     {
     if ( fClusterFinder )
        return EINPROGRESS;
-    fClusterFinder = new AliHLTTPCClustFinderNew();
+
+    fClusterFinder = new AliHLTTPCClusterFinder();
+
+    if (fPackedSwitch) {
+      fReaderPacked = new AliHLTTPCDigitReaderPacked();
+      fClusterFinder->SetReader(fReaderPacked);
+    }
+    else {
+      fReaderUnpacked = new AliHLTTPCDigitReaderUnpacked();
+      fClusterFinder->SetReader(fReaderUnpacked);
+    }
+    
+    // Variables to setup the Clusterfinder
     fClusterDeconv = true;
     fXYClusterError = -1;
     fZClusterError = -1;
+
     int i = 0;
     while ( i < argc )
        {
-       if ( !strcmp( argv[i], "pp-run" ) )
-           {
+         if ( !strcmp( argv[i], "pp-run" ) ){
            fClusterDeconv = false;
            i++;
            continue;
-           }
+         }
+
        Logging(kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] );
        return EINVAL;
        }
+
+
+    fClusterFinder->SetDeconv( fClusterDeconv );
+    fClusterFinder->SetXYError( fXYClusterError );
+    fClusterFinder->SetZError( fZClusterError );
+    if ( (fXYClusterError>0) && (fZClusterError>0) )
+      fClusterFinder->SetCalcErr( false );
+    
     return 0;
     }
 
 int AliHLTTPCClusterFinderComponent::DoDeinit()
     {
-    if ( !fClusterFinder )
-       return ECANCELED;
+
     if ( fClusterFinder )
        delete fClusterFinder;
     fClusterFinder = NULL;
+    if ( fReaderUnpacked )
+       delete fReaderUnpacked;
+    fReaderUnpacked = NULL;
+    
+    if ( fReaderPacked )
+       delete fReaderPacked;
+    fReaderPacked = NULL;
+
     return 0;
     }
 
-int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponent_EventData& evtData, const AliHLTComponent_BlockData* blocks, 
+int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponent_EventData& evtData, 
+                                             const AliHLTComponent_BlockData* blocks, 
                                              AliHLTComponent_TriggerData& trigData, AliHLTUInt8_t* outputPtr, 
-                                             AliHLTUInt32_t& size, vector<AliHLTComponent_BlockData>& outputBlocks )
+                                             AliHLTUInt32_t& size, 
+                                             vector<AliHLTComponent_BlockData>& outputBlocks )
     {
+    //  == init iter (pointer to datablock)
     const AliHLTComponent_BlockData* iter = NULL;
     unsigned long ndx;
-    AliHLTTPCUnpackedRawData* inPtr;
+
+    //  == OUTdatatype pointer
     AliHLTTPCClusterData* outPtr;
+
     AliHLTUInt8_t* outBPtr;
     UInt_t offset, mysize, nSize, tSize = 0;
+
     outBPtr = outputPtr;
     outPtr = (AliHLTTPCClusterData*)outBPtr;
+
     Int_t slice, patch, row[2];
     unsigned long maxPoints, realPoints = 0;
+
     for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
        {
        iter = blocks+ndx;
        mysize = 0;
        offset = tSize;
-       char tmp1[14], tmp2[14];
-       DataType2Text( iter->fDataType, tmp1 );
-       DataType2Text( AliHLTTPCDefinitions::gkUnpackedRawDataType, tmp2 );
-       Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Event received", 
-                "Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
-                evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
-       if ( iter->fDataType != AliHLTTPCDefinitions::gkUnpackedRawDataType )
-           continue;
-       
+
+
+       if (fPackedSwitch) {    
+         char tmp1[14], tmp2[14];
+         DataType2Text( iter->fDataType, tmp1 );
+         DataType2Text( AliHLTTPCDefinitions::gkDDLPackedRawDataType, tmp2 );
+         Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Event received", 
+                  "Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+                  evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
+
+         if ( iter->fDataType != AliHLTTPCDefinitions::gkDDLPackedRawDataType ) continue;
+
+       }
+       else {
+         char tmp1[14], tmp2[14];
+         DataType2Text( iter->fDataType, tmp1 );
+         DataType2Text( AliHLTTPCDefinitions::gkUnpackedRawDataType, tmp2 );
+         Logging( kHLTLogDebug, "HLT::TPCClusterFinder::DoEvent", "Event received", 
+                  "Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+                  evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
+
+         if ( iter->fDataType != AliHLTTPCDefinitions::gkUnpackedRawDataType ) continue;
+
+       }
+       
        slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
        patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
        row[0] = AliHLTTPCTransform::GetFirstRow( patch );
@@ -154,18 +223,12 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponent_EventData& e
                 realPoints, slice, patch, row[0], row[1] );
        
        outPtr = (AliHLTTPCClusterData*)outBPtr;
-       
-       inPtr = (AliHLTTPCUnpackedRawData*)iter->fPtr;
+
        maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
        
        fClusterFinder->InitSlice( slice, patch, row[0], row[1], maxPoints );
-       fClusterFinder->SetDeconv( fClusterDeconv );
-       fClusterFinder->SetXYError( fXYClusterError );
-       fClusterFinder->SetZError( fZClusterError );
-       if ( (fXYClusterError>0) && (fZClusterError>0) )
-           fClusterFinder->SetCalcErr( false );
        fClusterFinder->SetOutputArray( outPtr->fSpacePoints );
-       fClusterFinder->Read( maxPoints, inPtr->fDigits );
+       fClusterFinder->Read(iter->fPtr, iter->fSize );
        fClusterFinder->ProcessDigits();
        realPoints = fClusterFinder->GetNumberOfClusters();
        
@@ -206,4 +269,4 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponent_EventData& e
     return 0;
     }
 
-       
+   
index fd41c02..3529912 100644 (file)
@@ -3,6 +3,7 @@
 
 #ifndef ALIHLTTPCCLUSTERFINDERCOMPONENT_H
 #define ALIHLTTPCCLUSTERFINDERCOMPONENT_H
+
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 
 #include "AliHLTProcessor.h"
 #include "AliHLTTPCDefinitions.h"
+#include "AliHLTTPCDigitReaderPacked.h"
+#include "AliHLTTPCDigitReaderUnpacked.h"
 
-class AliHLTTPCClustFinderNew;
+class AliHLTTPCClusterFinder;
 
 class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
     {
     public:
-       AliHLTTPCClusterFinderComponent();
+       AliHLTTPCClusterFinderComponent(bool packed);
        virtual ~AliHLTTPCClusterFinderComponent();
 
        // Public functions to implement AliHLTComponent's interface.
@@ -43,13 +46,15 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
        
     private:
 
-       AliHLTTPCClustFinderNew* fClusterFinder;
-
-       bool fClusterDeconv;
-       float fXYClusterError;
-       float fZClusterError;
-       
-       ClassDef(AliHLTTPCClusterFinderComponent, 0)
+      AliHLTTPCClusterFinder* fClusterFinder;
+      AliHLTTPCDigitReaderPacked* fReaderPacked;
+      AliHLTTPCDigitReaderUnpacked* fReaderUnpacked;
+      bool fClusterDeconv;
+      float fXYClusterError;
+      float fZClusterError;
+      Int_t fPackedSwitch;
+      
+      ClassDef(AliHLTTPCClusterFinderComponent, 0)
 
     };
 #endif
diff --git a/HLT/TPCLib/AliHLTTPCDigitReader.cxx b/HLT/TPCLib/AliHLTTPCDigitReader.cxx
new file mode 100644 (file)
index 0000000..99b8aab
--- /dev/null
@@ -0,0 +1,39 @@
+// $Id$
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
+ *          Timm Steinbeck <timm@kip.uni-heidelberg.de>                   *
+ *          Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
+ *          for The ALICE Off-line 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.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// base class for reading packed and unpacked data for the HLT               //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#if __GNUC__== 3
+using namespace std;
+#endif
+
+#include "AliHLTTPCDigitReader.h"
+
+ClassImp(AliHLTTPCDigitReader)
+
+AliHLTTPCDigitReader::AliHLTTPCDigitReader(){
+}
+
+AliHLTTPCDigitReader::~AliHLTTPCDigitReader(){
+}
+
diff --git a/HLT/TPCLib/AliHLTTPCDigitReader.h b/HLT/TPCLib/AliHLTTPCDigitReader.h
new file mode 100644 (file)
index 0000000..baa902d
--- /dev/null
@@ -0,0 +1,35 @@
+// XEmacs -*-C++-*-
+// @(#) $Id$
+
+#ifndef ALIHLTTPCDIGITREADER_H
+#define ALIHLTTPCDIGITREADER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* AliHLTTPCDigitReader
+ */
+
+#include "TObject.h"
+
+class AliHLTTPCDigitReader{
+public:
+  AliHLTTPCDigitReader();
+  virtual ~AliHLTTPCDigitReader();
+  
+  virtual int InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow)=0;
+  virtual bool Next()=0;
+  virtual int GetRow()=0;
+  virtual int GetPad()=0;
+  virtual int GetSignal()=0;
+  virtual int GetTime()=0;
+
+protected:
+       
+private:
+
+  ClassDef(AliHLTTPCDigitReader, 0)
+    
+};
+#endif
+
diff --git a/HLT/TPCLib/AliHLTTPCDigitReaderPacked.cxx b/HLT/TPCLib/AliHLTTPCDigitReaderPacked.cxx
new file mode 100644 (file)
index 0000000..278cd69
--- /dev/null
@@ -0,0 +1,89 @@
+// $Id$
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
+ *          Timm Steinbeck <timm@kip.uni-heidelberg.de>                   *
+ *          Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
+ *          for The ALICE Off-line 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.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for reading packed data for the HLT                                 //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#if __GNUC__== 3
+using namespace std;
+#endif
+
+#include "AliHLTTPCDigitReaderPacked.h"
+#include "AliTPCRawStream.h"
+#include "AliRawReaderMemory.h"
+#include "AliRawDataHeader.h"
+
+#include "AliHLTTPCLogging.h"
+
+#include <stdlib.h>
+#include <errno.h>
+
+ClassImp(AliHLTTPCDigitReaderPacked)
+
+AliHLTTPCDigitReaderPacked::AliHLTTPCDigitReaderPacked(){
+  fRawMemoryReader = new AliRawReaderMemory;
+  fTPCRawStream = new AliTPCRawStream( fRawMemoryReader );
+}
+
+AliHLTTPCDigitReaderPacked::~AliHLTTPCDigitReaderPacked(){
+  if ( fRawMemoryReader )
+    delete fRawMemoryReader;
+  fRawMemoryReader = NULL;
+  if ( fTPCRawStream )
+    delete fTPCRawStream;
+  fTPCRawStream = NULL;
+}
+
+int AliHLTTPCDigitReaderPacked::InitBlock(void* ptr,unsigned long size,Int_t firstrow, Int_t lastrow){
+  fRawMemoryReader->SetMemory( reinterpret_cast<UChar_t*>( ptr ), size );
+  return 0;
+}
+
+bool AliHLTTPCDigitReaderPacked::Next(){
+  bool rreadvalue;
+  rreadvalue = fTPCRawStream->Next();
+  return rreadvalue;
+}
+
+int AliHLTTPCDigitReaderPacked::GetRow(){
+  int rrow;
+  rrow = (int)fTPCRawStream->GetRow();
+  return rrow;
+}
+
+int AliHLTTPCDigitReaderPacked::GetPad(){
+  int rpad;
+  rpad = fTPCRawStream->GetPad();
+  return rpad   ;
+}
+
+int AliHLTTPCDigitReaderPacked::GetSignal(){ 
+  int rsignal;
+  rsignal = fTPCRawStream->GetSignal();
+  return rsignal;
+}
+
+int AliHLTTPCDigitReaderPacked::GetTime(){
+  int rtime;
+  rtime = fTPCRawStream->GetTime();
+  return rtime;
+}
diff --git a/HLT/TPCLib/AliHLTTPCDigitReaderPacked.h b/HLT/TPCLib/AliHLTTPCDigitReaderPacked.h
new file mode 100644 (file)
index 0000000..0fd25ec
--- /dev/null
@@ -0,0 +1,43 @@
+// XEmacs -*-C++-*-
+// @(#) $Id$
+
+#ifndef ALIHLTTPCDIGITREADERPACKED_H
+#define ALIHLTTPCDIGITREADERPACKED_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* AliHLTTPCDigitReaderPacked
+ */
+
+#include "AliHLTTPCDigitReader.h"
+
+class AliRawReaderMemory;
+class AliTPCRawStream;
+
+class AliHLTTPCDigitReaderPacked : public AliHLTTPCDigitReader{
+public:
+  AliHLTTPCDigitReaderPacked();
+  virtual ~AliHLTTPCDigitReaderPacked();
+  
+  int InitBlock(void* ptr,unsigned long size, Int_t firstrow, Int_t lastrow);
+  bool Next();
+  int GetRow();
+  int GetPad();
+  int GetSignal();
+  int GetTime();
+  
+protected:
+
+private:
+  // Initialize AliROOT TPC raw stream parsing class
+  AliRawReaderMemory *fRawMemoryReader;
+  AliTPCRawStream *fTPCRawStream;
+  
+  ClassDef(AliHLTTPCDigitReaderPacked, 0)
+    
+};
+#endif
+
+
diff --git a/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx b/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx
new file mode 100644 (file)
index 0000000..b9fc2e1
--- /dev/null
@@ -0,0 +1,133 @@
+// $Id$
+
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
+ *          Timm Steinbeck <timm@kip.uni-heidelberg.de>                   *
+ *          Jochen Thaeder <thaeder@kip.uni-heidelberg.de>                *
+ *          for The ALICE Off-line 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.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for reading unpacked data for the HLT                               //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#if __GNUC__== 3
+using namespace std;
+#endif
+
+#include "AliHLTTPCDigitReaderUnpacked.h"
+#include "AliHLTTPCDigitData.h"
+#include "AliHLTTPCRawDataFormat.h"
+
+#include "AliHLTTPCLogging.h"
+
+#include <stdlib.h>
+#include <errno.h>
+
+ClassImp(AliHLTTPCDigitReaderUnpacked)
+
+AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked(){
+  fBin = 0;
+  fRow = 0;
+  fFirstRow = 0;
+  fLastRow = 0;
+}
+
+AliHLTTPCDigitReaderUnpacked::~AliHLTTPCDigitReaderUnpacked(){
+}
+
+int AliHLTTPCDigitReaderUnpacked::InitBlock(void* ptr,unsigned long size, Int_t firstrow, Int_t lastrow){
+  AliHLTTPCUnpackedRawData *tmpptr;
+  fPtr = ptr;
+  fSize = size;
+
+  tmpptr = (AliHLTTPCUnpackedRawData*) fPtr;
+  fDigitRowData = (AliHLTTPCDigitRowData*) tmpptr->fDigits;
+  fActRowData = (AliHLTTPCDigitRowData*) fDigitRowData;
+
+  fBin = -1;
+
+  fFirstRow = firstrow;
+  fLastRow = lastrow;
+  return 0;
+  fRow = fFirstRow; 
+
+  if ((Int_t)fActRowData->fRow != fRow){
+      LOG(AliHLTTPCLog::kWarning,"AliHLTTPCDigitReaderUnpacked::Next","Digits") << "Row number should match!" << fActRowData->fRow << " " << fRow << ENDLOG;
+  }
+}
+
+bool AliHLTTPCDigitReaderUnpacked::Next(){
+  bool rreadvalue = true;
+
+  fBin++;
+
+  if ( fBin >= (Int_t)fActRowData->fNDigit ){
+
+    fRow++;
+
+    if ((fRow >= fFirstRow) && (fRow <= fLastRow)){
+
+      //new row 
+      Byte_t *tmp = (Byte_t*) fActRowData;
+      Int_t size = sizeof(AliHLTTPCDigitRowData) + fActRowData->fNDigit*sizeof(AliHLTTPCDigitData);
+      tmp += size;
+      fActRowData = (AliHLTTPCDigitRowData*) tmp;
+     
+      if (((Byte_t*)fPtr) + fSize <= tmp){
+       rreadvalue = false;
+       return rreadvalue;
+      }
+
+      fBin = 0;
+    }
+    else {
+      rreadvalue = false;
+      return rreadvalue;
+    }
+    
+    if ((Int_t)fActRowData->fRow != fRow){
+      LOG(AliHLTTPCLog::kWarning,"AliHLTTPCDigitReaderUnpacked::Next","Digits") << "Row number should match!" << fActRowData->fRow << " " << fRow << ENDLOG;
+    }
+  }
+
+  fData = fActRowData->fDigitData;
+  return rreadvalue;
+}
+
+int AliHLTTPCDigitReaderUnpacked::GetRow(){
+  int rrow;
+  rrow = fRow;
+  return rrow;
+}
+
+int AliHLTTPCDigitReaderUnpacked::GetPad(){
+  int rpad;
+  rpad = (int)fData[fBin].fPad;
+  return rpad   ;
+}
+
+int AliHLTTPCDigitReaderUnpacked::GetSignal(){ 
+  int rsignal;
+  rsignal = (int)fData[fBin].fCharge;
+  return rsignal;
+}
+
+int AliHLTTPCDigitReaderUnpacked::GetTime(){
+  int rtime;
+  rtime = (int)fData[fBin].fTime;
+  return rtime;
+}
diff --git a/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.h b/HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.h
new file mode 100644 (file)
index 0000000..84bc8a9
--- /dev/null
@@ -0,0 +1,49 @@
+// XEmacs -*-C++-*-
+// @(#) $Id$
+
+#ifndef ALIHLTTPCDIGITREADERUNPACKED_H
+#define ALIHLTTPCDIGITREADERUNPACKED_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* AliHLTTPCDigitReaderUnpacked
+ */
+
+#include "AliHLTTPCDigitReader.h"
+#include "AliHLTTPCDigitData.h"
+
+class AliHLTTPCDigitRowData;
+
+class AliHLTTPCDigitReaderUnpacked : public AliHLTTPCDigitReader{
+public:
+  AliHLTTPCDigitReaderUnpacked();
+  virtual ~AliHLTTPCDigitReaderUnpacked();
+  
+  int InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow);
+  bool Next();
+  int GetRow();
+  int GetPad();
+  int GetSignal();
+  int GetTime();
+  
+protected:
+
+
+private:
+  AliHLTTPCDigitRowData *fDigitRowData; //!
+  AliHLTTPCDigitRowData *fActRowData; //!
+  AliHLTTPCDigitData *fData; //!
+  void* fPtr;
+  unsigned long fSize;
+  Int_t fBin;
+  Int_t fRow;
+  Int_t fFirstRow;
+  Int_t fLastRow;
+
+  ClassDef(AliHLTTPCDigitReaderUnpacked, 0)
+};
+#endif
+
+
index 201c07a..59637cc 100644 (file)
 #pragma link C++ class AliHLTTPCDataCompressorHelper;
 #pragma link C++ class AliHLTTPCDisplay;
 #pragma link C++ class AliHLTTPCClustFinderNew;
+#pragma link C++ class AliHLTTPCClusterFinder;
+#pragma link C++ class AliHLTTPCDigitReader;
+#pragma link C++ class AliHLTTPCDigitReaderPacked;
+#pragma link C++ class AliHLTTPCDigitReaderUnpacked;
 #pragma link C++ class AliHLTTPCFitter;
 /* #pragma link C++ class AliHLTTPCRawDataFileHandler; */
 /* #pragma link C++ class AliHLTTPCTPCBeamTestMemHandler; */
index 74dec2b..204ad80 100644 (file)
@@ -473,7 +473,7 @@ Bool_t AliHLTTPCMemHandler::Memory2Binary(UInt_t nrow,AliHLTTPCDigitRowData *dat
   return kTRUE;
 }
 
-Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & nrow,AliHLTTPCDigitRowData *data)
+Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & nrow,AliHLTTPCDigitRowData *data,UInt_t& sz)
 {
   //Read inputfile into memory as is, and store it in data. 
   // No run-length encoding is assumed.
@@ -513,6 +513,7 @@ Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & nrow,AliHLTTPCDigitRowData *d
     LOG(AliHLTTPCLog::kDebug,"AliHLTTPCMemHandler::Binary2Memory","Memory")
     <<AliHLTTPCLog::kDec<<"Wrote "<<outsize<<" Bytes to Memory ("
     <<rowcount<<" Rows)"<<ENDLOG;
+  sz = outsize;
   return kTRUE;
 }
 
@@ -687,7 +688,7 @@ Int_t AliHLTTPCMemHandler::Memory2CompMemory(UInt_t nrow,
 }
 
 Int_t AliHLTTPCMemHandler::CompMemory2Memory(UInt_t  nrow,
-                                        AliHLTTPCDigitRowData *data,UInt_t *comp)
+                                            AliHLTTPCDigitRowData *data,UInt_t *comp, UInt_t& sz)
 {
   //Uncompress the run-length encoded data in memory pointed to by comp, and
   //  store it in data.
@@ -745,6 +746,7 @@ Int_t AliHLTTPCMemHandler::CompMemory2Memory(UInt_t  nrow,
     outsize += size;
     rowPt = (AliHLTTPCDigitRowData *) bytePt;
   }
+  sz = outsize;
   return outsize;
 }
 
@@ -941,7 +943,7 @@ Bool_t AliHLTTPCMemHandler::CompBinary2CompMemory(UInt_t & nrow,UInt_t *comp)
   return kTRUE;
 }
 
-AliHLTTPCDigitRowData *AliHLTTPCMemHandler::CompBinary2Memory(UInt_t & nrow)
+AliHLTTPCDigitRowData *AliHLTTPCMemHandler::CompBinary2Memory(UInt_t & nrow, UInt_t& sz )
 {
   // Read the RLE inputfile, unpack it and return the pointer to it.
   AliHLTTPCMemHandler * handler = new AliHLTTPCMemHandler();
@@ -949,6 +951,7 @@ AliHLTTPCDigitRowData *AliHLTTPCMemHandler::CompBinary2Memory(UInt_t & nrow)
   UInt_t *comp =(UInt_t *)handler->Allocate();
   handler->CompBinary2CompMemory(nrow,comp);
   UInt_t size = GetMemorySize(nrow,comp);
+  sz = size;
   AliHLTTPCDigitRowData *data = (AliHLTTPCDigitRowData *)Allocate(size);
   CompMemory2Memory(nrow,data,comp);
   handler->Free();
@@ -1013,7 +1016,7 @@ Bool_t AliHLTTPCMemHandler::Transform(UInt_t npoint,AliHLTTPCSpacePointData *dat
   return kTRUE;
 }
 
-Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointData *data)
+Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointData *data, UInt_t& sz)
 {
   //Read the space points in inputfile, and store it in data.
   if(!fInBinary){
@@ -1028,6 +1031,7 @@ Bool_t AliHLTTPCMemHandler::Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointDat
   }
 
   Int_t size = GetFileSize(); 
+  sz = size;
   npoint = size/sizeof(AliHLTTPCSpacePointData);
   if(size==0) {
     LOG(AliHLTTPCLog::kWarning,"AliHLTTPCMemHandler::Binary2Memory","File")
index 7e9b183..ee3faf6 100644 (file)
@@ -63,21 +63,25 @@ class AliHLTTPCMemHandler {
 
   //Digit IO
   Bool_t Memory2Binary(UInt_t nrow,AliHLTTPCDigitRowData *data);
-  Bool_t Binary2Memory(UInt_t & nrow,AliHLTTPCDigitRowData *data);
+  Bool_t Binary2Memory(UInt_t & nrow,AliHLTTPCDigitRowData *data, UInt_t& sz);
+  Bool_t Binary2Memory(UInt_t & nrow,AliHLTTPCDigitRowData *data){UInt_t tmp;return Binary2Memory(nrow,data,tmp);};
 
   Int_t Memory2CompMemory(UInt_t nrow,AliHLTTPCDigitRowData *data,UInt_t *comp);
-  Int_t CompMemory2Memory(UInt_t nrow,AliHLTTPCDigitRowData *data,UInt_t *comp);
+  Int_t CompMemory2Memory(UInt_t nrow,AliHLTTPCDigitRowData *data,UInt_t *comp,UInt_t& sz);
+  Int_t CompMemory2Memory(UInt_t nrow,AliHLTTPCDigitRowData *data,UInt_t *comp) {UInt_t tmp;return CompMemory2Memory(nrow,data,comp,tmp);};
   Bool_t CompMemory2CompBinary(UInt_t nrow,UInt_t *comp, UInt_t size=0);
   Bool_t CompBinary2CompMemory(UInt_t & nrow,UInt_t *comp);
 
-  virtual AliHLTTPCDigitRowData *CompBinary2Memory(UInt_t & nrow);
+  virtual AliHLTTPCDigitRowData *CompBinary2Memory(UInt_t & nrow, UInt_t& sz);
+  virtual AliHLTTPCDigitRowData *CompBinary2Memory(UInt_t & nrow){UInt_t tmp;return CompBinary2Memory(nrow,tmp);};
   virtual Bool_t Memory2CompBinary(UInt_t nrow,AliHLTTPCDigitRowData *data);
   
   UInt_t GetNRow(UInt_t *comp,UInt_t size);
 
   //Point IO
   Bool_t Memory2Binary(UInt_t npoint,AliHLTTPCSpacePointData *data);
-  Bool_t Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointData *data);
+  Bool_t Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointData *data, UInt_t& sz);
+  Bool_t Binary2Memory(UInt_t & npoint,AliHLTTPCSpacePointData *data) {UInt_t tmp; return Binary2Memory(npoint,data,tmp);};
   Bool_t Transform(UInt_t npoint,AliHLTTPCSpacePointData *data,Int_t slice);
   static void UpdateRowPointer(AliHLTTPCDigitRowData *&tempPt);
   
index 886598f..d56ec40 100644 (file)
@@ -26,6 +26,10 @@ SRCS = AliHLTTPCLog.cxx \
           AliHLTTPCBenchmark.cxx \
           AliHLTTPCDDLDataFileHandler.cxx \
           AliHLTTPCClustFinderNew.cxx \
+          AliHLTTPCClusterFinder.cxx \
+          AliHLTTPCDigitReader.cxx \
+          AliHLTTPCDigitReaderPacked.cxx \
+          AliHLTTPCDigitReaderUnpacked.cxx \
           AliHLTTPCVertex.cxx \
           AliHLTTPCVertexArray.cxx \
           AliHLTTPCVertexFinder.cxx \
diff --git a/HLT/TPCLib/OnlineDisplay/GEO/alice.geom b/HLT/TPCLib/OnlineDisplay/GEO/alice.geom
new file mode 100644 (file)
index 0000000..efc7a84
Binary files /dev/null and b/HLT/TPCLib/OnlineDisplay/GEO/alice.geom differ
diff --git a/HLT/TPCLib/OnlineDisplay/HLT-OnlineDisplay-HOMER.C b/HLT/TPCLib/OnlineDisplay/HLT-OnlineDisplay-HOMER.C
new file mode 100644 (file)
index 0000000..cdf93de
--- /dev/null
@@ -0,0 +1,596 @@
+/*
+ * Requirements: Running HLT Analysis Framework
+ *               with TCP-Dump Subscribe listining on 
+ *                  - Cluster: Hostname, Port
+ *                  - Tracker: Hostname, Port
+ *                  - Controlled FilePublisher:  Hostname, Port
+ * Usage :
+ * 
+ * (1) USE the StartDisplayMacro.C , by adding 
+ *             gROOT->Macro("StartDisplayMacro.C"); 
+ *       to the rootlogon.C file      
+ *
+ * (2) IN  StartDisplayMacro.C subject to change are: 
+ * ODH_INIT("<PATH TO GEO FILE>", "<PATH TO LIBRARIES>"); 
+ *      - <PATH TO LIBRARIES> : The path where libHOMERReader_ROOT.so and libHOMERReader.so are located.
+ *      - <PATH TO GEO FILE>  : The path where alice.geom is located.
+ * ODH_CONNECT("<NODE>",<PORT>,"<NODE>",<PORT>,"<NODE>",<PORT>);
+ *      - <NODE> : The port on which the TCPDumpSubscriber is running.
+ *      - <PORT> : The port specified in the TCPDumpSubscriber in the XML configuration file. 
+ *    use first pair for Cluster Data, second for Tracks Data and third for Raw Data...
+ *    but it doesn't matter if you change it.
+ *
+ *
+ * When starting root, Display and Control Bar will pop up.
+ * Nothing will be displayed at the beginning.
+ * - In order to display the geometry. Click <Show Geometry> first.
+ *     Different sets of sectors can be selected also.
+ * - In order to dislpay event's click <Next clusters>, <Next tracks> or <Next clusters and tracks>
+ * Displaying PadRow's:
+ * - as Histogram: 
+ *         once : <Setup PadRow 20 with Histogram> 
+ *         next event : <Display PadRow>
+ * - in Geometry:
+ *         once : <Setup PadRow 20 with Geometry> 
+ *         next event : <Display PadRow>, <Display PadRow with Clusters>, <Display PadRow with Tracks> or <Display PadRow with Clusters and Tracks>
+ */
+
+
+// gROOT->GetInterpreter()->AddIncludePath( "$ALIHLT_TOPDIR/BASE" );
+// gROOT->GetInterpreter()->AddIncludePath( "$ALIHLT_TOPDIR/TPCLib" );
+
+#include "AliHLTDataTypes.h"
+#include "AliHLTTPCSpacePointData.h"
+#include "AliHLTTPCClusterDataFormat.h"
+#include "AliHLTTPCTrackletDataFormat.h"
+#include "AliHLTTPCDefinitions.h"
+#include "AliHLTTPCDigitReader.h"
+
+// include because of connecttofile()
+#include <stdio.h>
+#include <stdlib.h>
+//#include <sys/time.h>
+//#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <vector>
+// #include "MLUCString.hpp"
+// #include "MLUCCmdlineParser.hpp"
+// #include "MLUCDynamicLibrary.hpp"
+#include "AliHLTDataTypes.h"
+#include "AliHLT_C_Component_WrapperInterface.h"
+
+
+
+//#include "AliHLTTPCTrackArray.h"
+
+    void* gODH_Reader; /* really HOMERReader* */
+    void* gODH_Display; /* really AliHLTTPCDisplay* */
+
+
+/* Dummy function to work around the problem that the interpreter does not load the first function properly... */
+int ODH_Dummy() {
+    return 0;
+}
+
+// ########################################################################################################################################
+int HLT_OnlineDisplay_HOMER() {
+    gODH_Display = NULL;
+    return 0;
+}
+
+// ########################################################################################################################################
+int ODH_Init( char* path_to_geom_file, char* path_to_homer_lib = NULL ) {
+    // --- Load LIBS
+    TString lib;
+    cout << "Loading ROOT libraries (ROOTSYS has to be set)" << endl;
+
+    gSystem->Load("libPhysics");
+    gSystem->Load("libEG");
+//     if(gSystem->Load("libMC")==-1) {
+    gSystem->Load("libGeom");
+    gSystem->Load("libVMC");
+//     }
+
+    cout << "Loading ALICE TPC libraries (ALICE_ROOT & ALICE_TARGET have to be set)" << endl;
+    gSystem->Load("libESD");
+    gSystem->Load("libSTEER");
+    gSystem->Load("libRAWData");
+//     gSystem->Load("libCONTAINERS");
+//     if(gSystem->Load("libTPC")!=0) {
+    gSystem->Load("libTPCbase");
+    gSystem->Load("libTPCrec");
+    gSystem->Load("libTPCsim");
+    gSystem->Load("libTPCfast");
+//     }
+
+    cout << "Loading HLT libraries (ALIHLT_LIBDIR has to be set)" << endl;
+    gSystem->Load("$(ALIHLT_LIBDIR)/libHLTbase.so");
+    gSystem->Load("$(ALIHLT_LIBDIR)/libAliHLTTPC.so");
+    cout << "Loading HOMER library" << endl;
+
+    if ( path_to_homer_lib ) {
+       lib = path_to_homer_lib;
+       lib += "/";
+    }
+    else {
+       lib = "";
+    }
+    
+    lib += "libHOMERReader_ROOT.so";
+    gSystem->Load( lib );
+
+
+    // --- Create DISPLAY
+    cout << "Creating display" << endl;
+
+    Char_t *gfile="alice.geom"; // geometrie file
+    TString geoPath;
+    if ( path_to_geom_file ){  
+       geoPath = path_to_geom_file;
+       geoPath += "/";
+    }
+    else {
+       geoPath = "";
+    }
+    geoPath += gfile;
+
+    Int_t slices[] = { 0, 35 };
+    AliHLTTPCDisplay* display = new AliHLTTPCDisplay( slices, geoPath.Data() );
+
+    display->SetSlices();
+    display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+
+    gODH_Display = (void*)display;
+    return 0;
+}
+
+int ODH_SetSliceRange(int minslice,int maxslice){
+  // sets a range of Slices
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetSlices(minslice,maxslice);
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+int ODH_SetSliceRange(int slice){
+  // sets one slice
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetSlices(slice); 
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+int ODH_SetSliceRange(){
+  // sets all Slices
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetSlices();
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+int ODH_SetSlicePair(int slice){
+  // sets a pair of slices
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetSlicesPair(slice);
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+int ODH_SetSlicePair(int minslice, int maxslice){
+  // sets a pair of slices
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetSlicesPair(minslice,maxslice);
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+int ODH_SetInvert(){
+  // sets a pair of slices
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetInvert();
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+int ODH_SetDrawGeo(){
+  // sets a pair of slices
+  if (!gODH_Display ) return -1;
+  AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+  display->SetDrawGeo();
+  display->DisplayAll(0,kFALSE,kFALSE,kFALSE,kFALSE);
+}
+
+// ########################################################################################################################################
+int ODH_Connect( char* hostname_clusters, short port_clusters, char* hostname_tracks, short port_tracks, char* hostname_raw, short port_raw ) {
+    HOMERReader* reader;
+    char* hostnames[] = { "NULL", "NULL","NULL" };
+    unsigned short ports[] = { 0, 0, 0 };
+    int cnt=0;
+    if ( hostname_clusters ){
+       hostnames[cnt] = hostname_clusters;
+       ports[cnt] = port_clusters;
+       cnt++;
+    }
+    if ( hostname_tracks ){
+       hostnames[cnt] = hostname_tracks;
+       ports[cnt] = port_tracks;
+       cnt++;
+    }
+    if ( hostname_raw ){
+       hostnames[cnt] = hostname_raw;
+       ports[cnt] = port_raw;
+       cnt++;
+    }
+
+    reader = new HOMERReader( cnt, hostnames, ports );
+    int ret;
+    ret=reader->GetConnectionStatus();
+    if ( ret ) {
+       int ndx = reader->GetErrorConnectionNdx();
+       if ( ndx < cnt ) {
+           printf( "Error establishing connection to TCP source %s:%hu: %s (%d)\n", 
+                   hostnames[ndx], ports[ndx], 
+                   strerror(ret), ret );
+       }
+       else {      
+           printf( "Error establishing connection to unknown source with index %d: %s (%d)\n", 
+                   ndx, 
+                   strerror(ret), ret );
+       }
+       delete reader;
+       reader = NULL;
+    }
+    gODH_Reader = (void*)reader;
+    return ret;
+}
+
+// ########################################################################################################################################
+int ODH_Disconnect() {
+    if ( !gODH_Reader )
+       return 0;
+    HOMERReader* reader = (HOMERReader*)gODH_Reader;
+    delete reader;
+    gODH_Reader = NULL;
+    return 0;
+}
+
+// ########################################################################################################################################
+Int_t ODH_SetupPadRow(Int_t histswitch, Int_t slice, Int_t padrow){  
+    // PADROW 0 - 158
+    if (!gODH_Display ) return -1;
+    AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+
+    // Setup Geometry:  histswitch = 0;
+    // Setup Histogram: histswitch = 1|2|3;
+    display->SetupPadRow(histswitch,slice,padrow);
+
+    return 0;
+}
+
+// ########################################################################################################################################
+int ODH_DisplayNextEvent( Bool_t clusterswitch, Bool_t trackswitch, Bool_t padrowswitch, Float_t* clustersEtaRange = NULL ) {
+    
+    if ( !gODH_Reader || !gODH_Display ) return -1;
+    
+    // -- input datatypes , reverse
+    char* spptID="SRETSULC";
+    //char* spptID="STPECAPS";
+    char* trkID = "SGESKART";
+    //char* trkID = "SGESCART";
+    char* padrowID = "KPWR_LDD";
+
+    Int_t minHits = 0;
+    Bool_t x3don = kFALSE;
+
+    HOMERReader* reader = (HOMERReader*)gODH_Reader;
+    AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;
+    int ret = reader->ReadNextEvent();
+
+    if ( ret ) {
+       int ndx = reader->GetErrorConnectionNdx();
+       printf( "------------ TRY AGAIN --------------->Error reading event from source %d: %s (%d)\n", ndx, strerror(ret), ret );
+       ODH_DisplayNextEvent( clusterswitch, trackswitch, padrowswitch, clustersEtaRange);
+       return ret;
+    }
+
+    unsigned long blockCnt = reader->GetBlockCnt();
+    printf( "Event 0x%016LX (%Lu) with %lu blocks\n", (ULong64_t)reader->GetEventID(), (ULong64_t)reader->GetEventID(), blockCnt );
+
+    for ( unsigned long i = 0; i < blockCnt; i++ ) {
+       char tmp1[9], tmp2[5];
+       memset( tmp1, 0, 9 );
+       memset( tmp2, 0, 5 );
+       void *tmp11 = tmp1;
+       ULong64_t* tmp12 = (ULong64_t*)tmp11;
+       *tmp12 = reader->GetBlockDataType( i );
+       void *tmp21 = tmp2;
+       ULong_t* tmp22 = (ULong_t*)tmp21;
+       *tmp22 = reader->GetBlockDataOrigin( i );
+       printf( "Block %lu length: %lu - type: %s - origin: %s\n",
+               i, reader->GetBlockDataLength( i ), tmp1, tmp2 );
+    }
+    
+    display->ResetDisplay();
+
+    // -------------- CLUSTER
+    if ( clusterswitch ) {
+       unsigned long blk = reader->FindBlockNdx( spptID, " CPT",0xFFFFFFFF );
+       printf( "blk: %lu\n", blk );
+       while ( blk != ~(unsigned long)0 ) {        
+           printf( "Found clusters block %lu\n", blk );
+           const AliHLTTPCClusterData* clusterData = (const AliHLTTPCClusterData*)reader->GetBlockData( blk );
+           unsigned long dataLen = reader->GetBlockDataLength( blk );
+           
+           ULong_t spec = reader->GetBlockDataSpec( blk );
+           Int_t patch = AliHLTTPCDefinitions::GetMinPatchNr( spec );
+           Int_t slice = AliHLTTPCDefinitions::GetMinSliceNr( spec );
+           printf( "%lu Clusters found for slice %u - patch %u\n", clusterData->fSpacePointCnt, slice, patch );
+
+           void* tmp30 = clusterData;
+           Byte_t* tmp31 = (Byte_t*)tmp30;
+           unsigned long offset;
+           offset = sizeof(clusterData->fSpacePointCnt);
+           if ( offset <= reader->GetBlockTypeAlignment( blk, 1 ) )
+               offset = reader->GetBlockTypeAlignment( blk, 1 );
+           tmp31 += offset;
+           tmp30 = tmp31;
+           AliHLTTPCSpacePointData* tmp32 = (AliHLTTPCSpacePointData*)tmp30;
+
+           display->SetupClusterDataForPatch( slice, patch, clusterData->fSpacePointCnt, tmp32 );
+
+           blk = reader->FindBlockNdx( spptID, " CPT", 0xFFFFFFFF, blk+1 );
+           printf( "blk: %lu\n", blk );
+       }
+    }
+
+    // -------------- PADROW
+    if ( padrowswitch ) {
+       Int_t padrow = display->GetPadrow();
+       Int_t patch =  AliHLTTPCTransform::GetPatch(padrow);
+       Int_t maxpatch = patch;
+       AliHLTUInt8_t padslice = (AliHLTUInt8_t) display->GetSlice();
+
+       if (padrow == 30 || padrow == 90 || padrow == 139) maxpatch++;
+      
+       for (Int_t tpatch=patch;tpatch <= maxpatch;tpatch++){
+
+         
+           AliHLTUInt32_t padrowSpec = AliHLTTPCDefinitions::EncodeDataSpecification( padslice, padslice,(AliHLTUInt8_t) tpatch,(AliHLTUInt8_t) tpatch );
+           
+           unsigned long blk;
+           
+           // READ RAW DATA BLOCK
+           blk = reader->FindBlockNdx( padrowID, " CPT", padrowSpec );
+           printf( "Raw Data found for slice %u/patch %u\n", padslice, tpatch );
+           
+           unsigned long rawDataBlock = reader->GetBlockData( blk );
+           unsigned long rawDataLen = reader->GetBlockDataLength( blk );
+           
+           // READ CLUSTERS BLOCK
+           blk = reader->FindBlockNdx( spptID, " CPT", padrowSpec );
+           
+           const AliHLTTPCClusterData* clusterData = (const AliHLTTPCClusterData*)reader->GetBlockData( blk );
+           
+           printf( "%lu Clusters found for slice %u - patch %u\n", clusterData->fSpacePointCnt, padslice, tpatch );
+           
+           void* tmp30 = clusterData;
+           Byte_t* tmp31 = (Byte_t*)tmp30;
+           unsigned long offset;
+           offset = sizeof(clusterData->fSpacePointCnt);
+           if ( offset <= reader->GetBlockTypeAlignment( blk, 1 ) )
+               offset = reader->GetBlockTypeAlignment( blk, 1 );
+           tmp31 += offset;
+           tmp30 = tmp31;
+           AliHLTTPCSpacePointData* tmp32 = (AliHLTTPCSpacePointData*)tmp30;
+           
+           // DISPLAY RAW DATA AND CLUSTERS
+           display->FillPadRow( tpatch, rawDataBlock, rawDataLen, clusterData->fSpacePointCnt, tmp32);
+       }
+
+
+    }
+
+    AliHLTTPCTrackArray* trackArray = NULL;
+    trackArray = new AliHLTTPCTrackArray;
+    if ( !trackArray ) {
+       printf( "No track array\n" );
+       return -1;
+    }
+
+    // -------------- TRACKS
+    if ( trackswitch ) {
+       unsigned long blk = reader->FindBlockNdx( trkID, " CPT", 0xFFFFFFFF );
+
+       while ( blk != ~(unsigned long)0 ) {
+           printf( "Found tracks in block %lu\n", blk );
+           const AliHLTTPCTrackletData* trackData = (const AliHLTTPCTrackletData*)reader->GetBlockData( blk );
+           if ( !trackData ) {
+               printf( "No track data for block %lu\n", blk );
+               continue;
+           }
+           
+           ULong_t spec = reader->GetBlockDataSpec( blk );
+           Int_t patchmin = AliHLTTPCDefinitions::GetMinPatchNr( spec );
+           Int_t patchmax = AliHLTTPCDefinitions::GetMaxPatchNr( spec );
+           Int_t slice = AliHLTTPCDefinitions::GetMinSliceNr( spec );  
+
+           printf( "%lu tracks found for slice %u - patch %u-%u\n", trackData->fTrackletCnt, slice, patchmin, patchmax );
+
+           void* tmp40 = trackData;
+           Byte_t* tmp41 = (Byte_t*)tmp40;
+           unsigned long offset;
+
+           offset = sizeof(trackData->fTrackletCnt);
+
+           if ( offset <= reader->GetBlockTypeAlignment( blk, 1 ) ) offset = reader->GetBlockTypeAlignment( blk, 1 );
+
+           tmp41 += offset;
+           tmp40 = tmp41;
+           AliHLTTPCTrackSegmentData* tmp42 = (AliHLTTPCTrackSegmentData*)tmp40;
+
+           trackArray->FillTracks( trackData->fTrackletCnt, tmp42, slice );
+
+           blk = reader->FindBlockNdx( trkID, " CPT", 0xFFFFFFFF, blk+1 );
+       }
+
+
+    }
+
+    display->SetTracks( trackArray );
+    
+    // DISPLAY
+    display->DisplayAll( minHits, clusterswitch, trackswitch, x3don, 0. /*, clustersEtaRange */ );
+    if ( padrowswitch) display->DrawPadRow(x3don);
+    
+    if ( trackArray )  delete trackArray;   
+
+    return 0;
+}
+
+// ########################################################################################################################################
+// ########################################################################################################################################
+// ########################################################################################################################################
+int ODH_SimpleDisplay(char * infiles[7],unsigned int slice){
+    if ( !gODH_Display ) return -1;
+
+    FILE * inFH = 1;
+    AliHLTTPCDisplay* display = (AliHLTTPCDisplay*)gODH_Display;       
+    int i = 1;
+    char* error = NULL;
+    int errorArg = -1;
+    int errorParam = -1;
+
+    AliHLTComponent_DataType dataType;
+    AliHLTUInt32_t dataSpec = ~(AliHLTUInt32_t)0;
+    dataType.fStructSize = sizeof(dataType);
+    memset( dataType.fID, '*', 8 );
+    memset( dataType.fOrigin, '*', 4 );
+    AliHLTComponent_BlockData blocks[7];
+    unsigned long totalRead = 0;
+  
+    // --- get INFILE
+    for (int ii = 0;ii<7;ii++){
+
+       inFH = fopen( infiles[ii], "r");
+       if ( inFH == -1 ) {
+           error = "Unable to open input file for reading";
+           errorArg = i;
+           errorParam = i+1;
+           break;
+       }
+    
+       AliHLTComponent_BlockData newBlock;
+       newBlock.fStructSize = sizeof(AliHLTComponent_BlockData);
+
+       newBlock.fShmKey.fStructSize = sizeof(AliHLTComponent_ShmData);
+       newBlock.fShmKey.fShmType = gkAliHLTComponent_InvalidShmType;
+       newBlock.fShmKey.fShmID = gkAliHLTComponent_InvalidShmID;
+       
+       fseek( inFH, 0, SEEK_END );
+       long sz = ftell(inFH);
+       
+       fseek( inFH, 0, SEEK_SET);
+       newBlock.fPtr = new uint8[ sz ];
+       
+       if ( !newBlock.fPtr ) {
+           fprintf( stderr, "Out of memory trying to allocate memory for input file '%s' of %lu bytes.\n",
+                    infile, sz );
+           return -1;
+       }
+
+       unsigned long curSize = 0;
+       int ret=1;
+       void * tmp50 = newBlock.fPtr;
+       uint8* tmp51 = (uint8*)tmp50;
+       while ( ret>0 ) {
+           ret = fread(tmp51+curSize,1, sz-curSize,inFH);
+
+           if ( ret >= 0 ) {
+               curSize += (unsigned long)ret;
+               if ( curSize >= (unsigned long)sz ) {
+                   newBlock.fSize = sz;
+                   blocks[ii] =  newBlock;
+                   break;
+               }
+           }
+           else {
+               fprintf( stderr, "%s error reading data from input file after %lu bytes.\n", infile, curSize );
+               return -1;
+           }
+       }
+    }
+  
+    //  --- Setup CLUSTERS
+    for (int ii = 1;ii<7;ii++){
+       unsigned int patch = ii - 1;
+       const AliHLTTPCClusterData* clusterData = (const AliHLTTPCClusterData*) blocks[ii].fPtr;
+       
+       if ( !clusterData )     {
+           printf( "No ClusterData\n" );
+           return -1;
+       }
+       
+               void* tmp30 = clusterData;
+       Byte_t* tmp31 = (Byte_t*)tmp30;
+       unsigned long offset;
+       
+       offset = sizeof(clusterData->fSpacePointCnt);
+       
+       tmp31 += offset;
+       tmp30 = tmp31;
+       AliHLTTPCSpacePointData* tmp32 = (AliHLTTPCSpacePointData*)tmp30;
+       
+       display->SetupClusterDataForPatch( slice, patch, clusterData->fSpacePointCnt, tmp32 );
+    }
+
+    // --- Setup TRACKS
+    AliHLTTPCTrackArray* trackArray = NULL;
+    trackArray = new AliHLTTPCTrackArray;
+    
+    if ( !trackArray ) {
+       printf( "No track array\n" );
+       return -1;
+    }
+
+    const AliHLTTPCTrackletData* trackData = (const AliHLTTPCTrackletData*) blocks[0].fPtr;
+    if ( !trackData )
+    {
+       printf( "No track data for block %lu\n", blk );
+       continue;
+    }
+   
+    void* tmp40 = trackData;
+    Byte_t* tmp41 = (Byte_t*)tmp40;
+    unsigned long offset;
+    
+    offset = sizeof(trackData->fTrackletCnt);
+    
+    tmp41 += offset;
+    tmp40 = tmp41;
+    AliHLTTPCTrackSegmentData* tmp42 = (AliHLTTPCTrackSegmentData*)tmp40;
+    
+    trackArray->FillTracks( trackData->fTrackletCnt, tmp42, slice );
+    
+    display->SetTracks( trackArray );
+
+    // --- Display 
+    Int_t minHits = 0; 
+
+    display->SetSlices(0,4);
+    display->DisplayAll( minHits, clusterswitch, trackswitch, kFALSE, 0. /*, clustersEtaRange */ );
+    if ( trackArray ) delete trackArray;
+    
+    return 0;
+
+} // END ODH_SimpleDisplay
diff --git a/HLT/TPCLib/OnlineDisplay/StartDisplayMacro.C b/HLT/TPCLib/OnlineDisplay/StartDisplayMacro.C
new file mode 100644 (file)
index 0000000..19c0f7c
--- /dev/null
@@ -0,0 +1,65 @@
+{
+
+//gROOT->Reset();
+
+gROOT->LoadMacro("HLT-OnlineDisplay-HOMER.C");
+
+HLT_OnlineDisplay_HOMER();
+//ODH_Init("./GEO","/home/HLT/src/versions/devel/Util/HOMER/reader/lib/Linux-i686/");
+
+ODH_Init("./GEO","/home/jthaeder/HLT/AnalysisChain/lib/Linux-i686/");
+//ODH_Init("./GEO","/home/jthaeder/HLT/src/lib_jthaeder/");
+
+//ODH_Connect("e107",42002,NULL,NULL,"e107",42003);     // pprun_1_nB
+//ODH_Connect(NULL,NULL,NULL,NULL,"e107",42003);
+
+
+ODH_Connect(NULL,NULL,"eh000",42002,NULL,NULL); // --   HUGE_TEST with RAW
+//ODH_DisplayNextEvent(false,false,true,NULL);
+
+bar = new TControlBar("vertical", "HLT DISPLAY");
+
+bar->AddButton("Next clusters",".p ODH_DisplayNextEvent(true,false,false,NULL)", "Show Next Event");
+bar->AddButton("Next tracks",".p ODH_DisplayNextEvent(false,true,false,NULL)", "Show Next Event");
+bar->AddButton("Next clusters and tracks",".p ODH_DisplayNextEvent(true,true,false,NULL)", "Show Next Event");
+
+bar->AddSeparator();
+
+bar->AddButton("Show all",".p ODH_SetSliceRange()", "Show Next Event");
+
+bar->AddButton("Show Sector 0",".p ODH_SetSliceRange(0)", "Show Next Event");
+bar->AddButton("Show Sector 1",".p ODH_SetSliceRange(1)", "Show Next Event");
+bar->AddButton("Show Sector 2",".p ODH_SetSliceRange(2)", "Show Next Event");
+bar->AddButton("Show Sector 9",".p ODH_SetSliceRange(9)", "Show Next Event");
+bar->AddButton("Show Sector 10",".p ODH_SetSliceRange(10)", "Show Next Event");
+bar->AddButton("Show Sector 11",".p ODH_SetSliceRange(11)", "Show Next Event");
+
+bar->AddButton("Show Sector 0 - 2",".p ODH_SetSliceRange(0,2)", "Show Next Event");
+bar->AddButton("Show Sector 9 - 11",".p ODH_SetSliceRange(9,11)", "Show Next Event");
+bar->AddButton("Show Sector 0 - 11",".p ODH_SetSliceRange(0,11)", "Show Next Event");
+
+bar->AddButton("Show pair 0",".p ODH_SetSlicePair(0)", "Show Next Event");
+bar->AddButton("Show pair 1",".p ODH_SetSlicePair(1)", "Show Next Event");
+bar->AddButton("Show pair 2",".p ODH_SetSlicePair(2)", "Show Next Event");
+
+bar->AddButton("Show Geometry",".p ODH_SetDrawGeo()", "Show Next Event");
+
+bar->AddButton("Invert",".p ODH_SetInvert()","ccc");
+
+bar->AddSeparator();
+// PADROW 0 - 158
+
+bar->AddButton("Setup PadRow 20 with Histogram",".p ODH_SetupPadRow(1,2,20)","Setup PadRow");
+bar->AddButton("Setup PadRow 20 with Geometry",".p ODH_SetupPadRow(0,2,20)","Setup PadRow");
+
+bar->AddButton("Display PadRow",".p ODH_DisplayNextEvent(false,false,true,NULL)","Display PadRow");
+
+bar->AddButton("Display PadRow with Clusters",".p ODH_DisplayNextEvent(true,false,true,NULL)","Display PadRow");
+bar->AddButton("Display PadRow with Tracks",".p ODH_DisplayNextEvent(false,true,true,NULL)","Display PadRow");
+bar->AddButton("Display PadRow with Clusters and Tracks",".p ODH_DisplayNextEvent(true,true,true,NULL)","Display PadRow");
+
+bar->Show();
+gROOT->SaveContext();
+}
+
+
diff --git a/HLT/TPCLib/OnlineDisplay/rootlogon.C b/HLT/TPCLib/OnlineDisplay/rootlogon.C
new file mode 100644 (file)
index 0000000..dec9234
--- /dev/null
@@ -0,0 +1,10 @@
+{
+gROOT->GetInterpreter()->AddIncludePath( "$ALIHLT_TOPDIR/BASE" );
+gROOT->GetInterpreter()->AddIncludePath( "$ALIHLT_TOPDIR/TPCLib" );
+gROOT->GetInterpreter()->AddIncludePath( "$ALIHLT_TOPDIR/src" );
+
+gROOT->Macro("StartDisplayMacro.C"); 
+//gROOT->Macro("./StartSimpleDisplayMacro.C");
+
+}
+