]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/comp/AliL3Compress.h
Moved to the latest version of the HLT code in Bergen.
[u/mrichter/AliRoot.git] / HLT / comp / AliL3Compress.h
index e5a6e1d48fa12a33c4c9c6a6ded83e763b02a37b..31b40e95288ada6a4273e8db3e139b68e43a6f56 100644 (file)
@@ -1,77 +1,40 @@
+// @(#) $Id$
+
 #ifndef AliL3_Compress
 #define AliL3_Compress
 
 #include "AliL3RootTypes.h"
-#include "AliL3Models.h"
-#include "AliL3DigitData.h"
-
-class AliL3TrackArray;
+#include "AliL3DataCompressor.h"
 
 class AliL3Compress {
   
  private:
   AliL3TrackArray *fTracks; //!
-  AliL3RandomDigitData *fDigits; //!
-  AliL3RandomDigitData **fDPt; //!
-  Int_t fNDigits;
-  Int_t fNUsed;
-  Int_t fMaxDigits;
-  
-  Int_t fNumPadBits;
-  Int_t fNumTimeBits;
-  Int_t fNumChargeBits;
-  Int_t fNumShapeBits;
+
   Int_t fSlice;
   Int_t fPatch;
-  
-  void CreateDigitArray(Int_t maxnumber);
-  void CreateDigits(Int_t row,Float_t pad,Float_t time,Int_t charge,Float_t ywidth,Float_t zwidth);
-  void QSort(AliL3RandomDigitData **a, Int_t first, Int_t last);
-  Int_t ComparePoints(Int_t row,UShort_t pad,UShort_t time);
-  Int_t CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b);
+  Char_t fPath[100];
+  Bool_t fWriteShape;
+  Int_t fEvent;
 
  public:
   AliL3Compress();
-  AliL3Compress(Int_t slice,Int_t patch,Int_t pad=7,Int_t time=7,Int_t charge=10,Int_t shape=4);
+  AliL3Compress(Int_t slice,Int_t patch,Char_t *path="./",Bool_t writeshape=kFALSE,Int_t event=-1);
   virtual ~AliL3Compress();
   
-  void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
-  void WriteFile(AliL3TrackArray *tracks,Char_t *filename);
-  void ReadFile(Char_t *filename);
-  void CompressFile(Char_t *infile,Char_t *outfile);
-  void ExpandFile(Char_t *infile,Char_t *outfile);
-  void RestoreData(Char_t *uncompfile);
-  void WriteRestoredData(Char_t *remainfile,Char_t *restoredfile);
-  void PrintDigits();
-
+  Bool_t WriteFile(AliL3TrackArray *tracks,Char_t *filename=0);
+  Bool_t ReadFile(Char_t which,Char_t *filename=0);
+  Bool_t CompressFile();
+  Bool_t ExpandFile();
+  void CompressRemaining(AliL3SpacePointData *points[36][6],UInt_t npoints[36][6]);
+  void ExpandRemaining(TempCluster **clusters,Int_t *ncl,Int_t maxclusters);
+  void PrintCompRatio(ofstream *outfile=0);
+  void GetEntropy(Float_t &pad_entropy,Float_t &time_entropy);
+  
   AliL3TrackArray *GetTracks() {return fTracks;}
   
   ClassDef(AliL3Compress,1) 
 
 };
 
-inline Int_t  AliL3Compress::ComparePoints(Int_t row,UShort_t pad,UShort_t time)
-{
-  
-  if(fDPt[fNUsed]->fRow != row) return 0;
-  
-  if(fDPt[fNUsed]->fPad < pad) return 1;
-  if(fDPt[fNUsed]->fPad == pad && fDPt[fNUsed]->fTime < time) return 1;
-  
-  return 0;
-
-}
-
-inline Int_t AliL3Compress::CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b)
-{
-  if(a->fRow < b->fRow) return -1;
-    
-  if(a->fPad==b->fPad && a->fTime == b->fTime && a->fRow == b->fRow) return 0;
-  
-  if(a->fPad<b->fPad && a->fRow == b->fRow) return -1;
-  if(a->fPad==b->fPad && a->fTime<b->fTime && a->fRow == b->fRow) return -1;
-  
-  return 1;
-}
-
 #endif