]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
2 | ||
5b3f37f6 | 3 | #ifndef AliL3_DataCompressor |
4 | #define AliL3_DataCompressor | |
5 | ||
1f1942b8 | 6 | #include "AliL3RootTypes.h" |
7 | ||
3e87ef69 | 8 | class AliL3SpacePointData; |
bd53cfb7 | 9 | class AliL3Benchmark; |
3e87ef69 | 10 | class AliL3TrackArray; |
11 | class AliL3Track; | |
12 | ||
13 | #ifdef use_root | |
14 | class TH2F; | |
15 | class TFile; | |
16 | #endif | |
17 | ||
18 | struct TempCluster { | |
b4686276 | 19 | Float_t fPad; // Pad |
20 | Float_t fTime; // Time | |
21 | Float_t fSigmaY2; // SigmaY2 | |
22 | Float_t fSigmaZ2; // SigmaZ2 | |
23 | Int_t fCharge; // Charge | |
24 | Int_t fPadrow; // Pad row | |
3e87ef69 | 25 | }; |
5b3f37f6 | 26 | |
27 | class AliL3DataCompressor { | |
28 | ||
b4686276 | 29 | public: |
30 | AliL3DataCompressor(); | |
31 | AliL3DataCompressor(Char_t *path,Bool_t keep,Bool_t writeshape); | |
32 | virtual ~AliL3DataCompressor(); | |
33 | ||
34 | virtual void LoadData(Int_t event,Bool_t sp=kTRUE); | |
35 | virtual void FillData(Int_t minhits,Bool_t expand); | |
36 | virtual void WriteRemaining(Bool_t select); | |
37 | void DetermineMinBits(); | |
38 | void CompressAndExpand(Bool_t arithmeticCoding=kTRUE); | |
39 | void RestoreData(Bool_t remainingOnly=kFALSE); | |
40 | void DoBench(Char_t *fname="benchmark"); | |
41 | void DoNotCompress() {fNoCompression=kTRUE;} | |
42 | ||
43 | Int_t GetNusedClusters() const {return fNusedClusters;} | |
44 | Int_t GetNunusedClusters() const {return fNunusedClusters;} | |
45 | ||
46 | protected: | |
47 | Char_t fPath[1024]; //! Path to the files | |
48 | Int_t fEvent; // Current event | |
49 | Int_t fNusedClusters; // Number of used clusters | |
50 | Int_t fNunusedClusters; // Number of unused clusters | |
51 | ||
52 | Bool_t fWriteClusterShape; // Flag to write the cluster's shape | |
53 | Bool_t fKeepRemaining; // Flag to keep the remaining clusters | |
54 | Bool_t fSinglePatch; // Flag to run over single patch (?) | |
55 | Bool_t fWriteIdsToFile; // Flag (not used?) | |
56 | Bool_t fNoCompression; //Just process the data through the chain, but do not compress. (input=output). Mostly for debugging... | |
57 | ||
5b3f37f6 | 58 | private: |
b4686276 | 59 | AliL3Benchmark *fBenchmark; //! Benchmark |
60 | AliL3TrackArray *fInputTracks; //! Array of input tracks | |
61 | AliL3SpacePointData *fClusters[36][6]; //! Array of pointers to clusters | |
62 | ofstream *fCompRatioFile; //! Stream to write the ration between use and unused clusters | |
3e87ef69 | 63 | #ifdef use_root |
b4686276 | 64 | TFile *fOutputFile; //! Output file |
3e87ef69 | 65 | #else |
b4686276 | 66 | FILE *fOutputFile; // Output file |
3e87ef69 | 67 | #endif |
b4686276 | 68 | UInt_t fNcl[36][6]; // Array containing numbers of clusters |
de3c3890 | 69 | |
3e87ef69 | 70 | void SelectRemainingClusters(); |
71 | void ExpandTrackData(AliL3TrackArray *tracks); | |
72 | void ReadUncompressedData(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); | |
73 | void ReadRemaining(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); | |
74 | void QSort(TempCluster **a, Int_t first, Int_t last); | |
75 | Int_t Compare(TempCluster *a,TempCluster *b); | |
76 | void OpenOutputFile(); | |
77 | void CloseOutputFile(); | |
0a86fbb7 | 78 | |
5b3f37f6 | 79 | ClassDef(AliL3DataCompressor,1) |
80 | ||
81 | }; | |
82 | ||
83 | #endif |