Last changes from I. Belikov - the tracking performs track refitting
[u/mrichter/AliRoot.git] / HLT / comp / AliL3Compress.h
CommitLineData
5bf93292 1#ifndef AliL3_Compress
2#define AliL3_Compress
3
4#include "AliL3RootTypes.h"
5#include "AliL3Models.h"
029912b7 6#include "AliL3DigitData.h"
5bf93292 7
8class AliL3TrackArray;
9
10class AliL3Compress {
11
12 private:
95a00d93 13 AliL3TrackArray *fTracks; //!
029912b7 14 AliL3RandomDigitData *fDigits; //!
15 AliL3RandomDigitData **fDPt; //!
16 Int_t fNDigits;
17 Int_t fNUsed;
18 Int_t fMaxDigits;
5bf93292 19
029912b7 20 Int_t fNumPadBits;
21 Int_t fNumTimeBits;
22 Int_t fNumChargeBits;
23 Int_t fNumShapeBits;
24 Int_t fSlice;
25 Int_t fPatch;
5bf93292 26
029912b7 27 void CreateDigitArray(Int_t maxnumber);
28 void CreateDigits(Int_t row,Float_t pad,Float_t time,Int_t charge,Float_t ywidth,Float_t zwidth);
29 void QSort(AliL3RandomDigitData **a, Int_t first, Int_t last);
30 Int_t ComparePoints(Int_t row,UShort_t pad,UShort_t time);
31 Int_t CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b);
32
5bf93292 33 public:
34 AliL3Compress();
029912b7 35 AliL3Compress(Int_t slice,Int_t patch,Int_t pad=7,Int_t time=7,Int_t charge=10,Int_t shape=4);
5bf93292 36 virtual ~AliL3Compress();
37
029912b7 38 void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
95a00d93 39 void WriteFile(AliL3TrackArray *tracks,Char_t *filename);
40 void ReadFile(Char_t *filename);
41 void CompressFile(Char_t *infile,Char_t *outfile);
42 void ExpandFile(Char_t *infile,Char_t *outfile);
029912b7 43 void RestoreData(Char_t *uncompfile);
44 void WriteRestoredData(Char_t *remainfile,Char_t *restoredfile);
45 void PrintDigits();
46
95a00d93 47 AliL3TrackArray *GetTracks() {return fTracks;}
48
5bf93292 49 ClassDef(AliL3Compress,1)
50
51};
52
029912b7 53inline Int_t AliL3Compress::ComparePoints(Int_t row,UShort_t pad,UShort_t time)
54{
55
56 if(fDPt[fNUsed]->fRow != row) return 0;
57
58 if(fDPt[fNUsed]->fPad < pad) return 1;
59 if(fDPt[fNUsed]->fPad == pad && fDPt[fNUsed]->fTime < time) return 1;
60
61 return 0;
62
63}
64
65inline Int_t AliL3Compress::CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b)
66{
67 if(a->fRow < b->fRow) return -1;
68
69 if(a->fPad==b->fPad && a->fTime == b->fTime && a->fRow == b->fRow) return 0;
70
71 if(a->fPad<b->fPad && a->fRow == b->fRow) return -1;
72 if(a->fPad==b->fPad && a->fTime<b->fTime && a->fRow == b->fRow) return -1;
73
74 return 1;
75}
76
5bf93292 77#endif