]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/comp/AliL3Compress.h
First version, stand alone detector
[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;
be6ddb10 26 Char_t fPath[100];
2357bb38 27 Bool_t fWriteShape;
28
029912b7 29 void CreateDigitArray(Int_t maxnumber);
ae9fbfa1 30 void CreateDigits(Int_t row,Int_t npads,Float_t pad,Float_t time,Int_t charge,Float_t ywidth,Float_t zwidth);
029912b7 31 void QSort(AliL3RandomDigitData **a, Int_t first, Int_t last);
32 Int_t ComparePoints(Int_t row,UShort_t pad,UShort_t time);
33 Int_t CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b);
34
5bf93292 35 public:
36 AliL3Compress();
2357bb38 37 AliL3Compress(Int_t slice,Int_t patch,Char_t *path="./",Bool_t writeshape=kFALSE);
5bf93292 38 virtual ~AliL3Compress();
39
029912b7 40 void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
be6ddb10 41 void WriteFile(AliL3TrackArray *tracks);
42 void ReadFile(Char_t which);
43 void CompressFile();
44 void ExpandFile();
4a838220 45 void RestoreData(Char_t which='u');
be6ddb10 46 void WriteRestoredData();
4a838220 47 void WriteRootFile(Char_t *newrootfile);
48 void PrintDigits(Int_t padrow=-1);
92a876e2 49 void PrintCompRatio();
50
95a00d93 51 AliL3TrackArray *GetTracks() {return fTracks;}
52
5bf93292 53 ClassDef(AliL3Compress,1)
54
55};
56
029912b7 57inline Int_t AliL3Compress::ComparePoints(Int_t row,UShort_t pad,UShort_t time)
58{
be6ddb10 59 if(fNUsed >= fNDigits) return 0;
029912b7 60
61 if(fDPt[fNUsed]->fRow != row) return 0;
62
4a838220 63
029912b7 64 if(fDPt[fNUsed]->fPad < pad) return 1;
65 if(fDPt[fNUsed]->fPad == pad && fDPt[fNUsed]->fTime < time) return 1;
66
4a838220 67 //if(fDPt[fNUsed]->fPad == pad && fDPt[fNUsed]->fTime == time) return 2;
68
029912b7 69 return 0;
70
71}
72
73inline Int_t AliL3Compress::CompareDigits(AliL3RandomDigitData *a,AliL3RandomDigitData *b)
74{
75 if(a->fRow < b->fRow) return -1;
76
77 if(a->fPad==b->fPad && a->fTime == b->fTime && a->fRow == b->fRow) return 0;
78
79 if(a->fPad<b->fPad && a->fRow == b->fRow) return -1;
80 if(a->fPad==b->fPad && a->fTime<b->fTime && a->fRow == b->fRow) return -1;
81
82 return 1;
83}
84
5bf93292 85#endif