]>
Commit | Line | Data |
---|---|---|
1 | // @(#) $Id$ | |
2 | ||
3 | #ifndef AliL3_DataCompressor | |
4 | #define AliL3_DataCompressor | |
5 | ||
6 | #include "AliL3RootTypes.h" | |
7 | ||
8 | class AliL3SpacePointData; | |
9 | class AliL3Benchmark; | |
10 | class AliL3TrackArray; | |
11 | class AliL3Track; | |
12 | ||
13 | #ifdef use_root | |
14 | class TH2F; | |
15 | class TFile; | |
16 | #endif | |
17 | ||
18 | struct TempCluster { | |
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 | |
25 | }; | |
26 | ||
27 | class AliL3DataCompressor { | |
28 | ||
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 | ||
58 | private: | |
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 | |
63 | #ifdef use_root | |
64 | TFile *fOutputFile; //! Output file | |
65 | #else | |
66 | FILE *fOutputFile; // Output file | |
67 | #endif | |
68 | UInt_t fNcl[36][6]; // Array containing numbers of clusters | |
69 | ||
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(); | |
78 | ||
79 | ClassDef(AliL3DataCompressor,1) | |
80 | ||
81 | }; | |
82 | ||
83 | #endif |