]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
2 | ||
5b3f37f6 | 3 | #ifndef AliL3_DataCompressor |
4 | #define AliL3_DataCompressor | |
5 | ||
3e87ef69 | 6 | class AliL3SpacePointData; |
bd53cfb7 | 7 | class AliL3Benchmark; |
3e87ef69 | 8 | class AliL3TrackArray; |
9 | class AliL3Track; | |
10 | ||
11 | #ifdef use_root | |
12 | class TH2F; | |
13 | class TFile; | |
14 | #endif | |
15 | ||
16 | struct TempCluster { | |
17 | Float_t pad; | |
18 | Float_t time; | |
19 | Float_t sigmaY2; | |
20 | Float_t sigmaZ2; | |
21 | Int_t charge; | |
22 | Int_t padrow; | |
23 | }; | |
5b3f37f6 | 24 | |
25 | class AliL3DataCompressor { | |
26 | ||
27 | private: | |
bd53cfb7 | 28 | AliL3Benchmark *fBenchmark; //! |
3e87ef69 | 29 | AliL3TrackArray *fInputTracks; //! |
30 | AliL3SpacePointData *fClusters[36][6]; //! | |
31 | ofstream *fCompRatioFile; //! | |
32 | #ifdef use_root | |
33 | TFile *fOutputFile; //! | |
34 | #else | |
35 | FILE *fOutputFile; | |
36 | #endif | |
37 | Char_t fPath[1024]; //! | |
38 | ||
39 | UInt_t fNcl[36][6]; | |
40 | Bool_t fKeepRemaining; | |
41 | Bool_t fWriteClusterShape; | |
42 | Int_t fEvent; | |
43 | Bool_t fSinglePatch; | |
44 | ||
45 | static Int_t fNumPadBits; | |
46 | static Int_t fNumTimeBits; | |
47 | static Int_t fNumChargeBits; | |
48 | static Int_t fNumShapeBits; | |
5b3f37f6 | 49 | |
3e87ef69 | 50 | static Float_t fXYResidualStep; |
51 | static Float_t fZResidualStep; | |
52 | static Float_t fXYWidthStep; | |
53 | static Float_t fZWidthStep; | |
54 | static Int_t fClusterCharge; | |
55 | ||
56 | void SelectRemainingClusters(); | |
57 | void ExpandTrackData(AliL3TrackArray *tracks); | |
58 | void ReadUncompressedData(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); | |
59 | void ReadRemaining(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); | |
60 | void QSort(TempCluster **a, Int_t first, Int_t last); | |
61 | Int_t Compare(TempCluster *a,TempCluster *b); | |
62 | void OpenOutputFile(); | |
63 | void CloseOutputFile(); | |
5b3f37f6 | 64 | |
65 | public: | |
66 | AliL3DataCompressor(); | |
3e87ef69 | 67 | AliL3DataCompressor(Char_t *path,Bool_t keep,Bool_t writeshape); |
5b3f37f6 | 68 | virtual ~AliL3DataCompressor(); |
69 | ||
3e87ef69 | 70 | void LoadData(Int_t event,Bool_t sp=kTRUE); |
71 | void FillData(Int_t minhits,Bool_t expand); | |
72 | void LoadOfflineData(Int_t event); | |
73 | void CompressAndExpand(); | |
74 | void WriteRemaining(Bool_t select); | |
5b3f37f6 | 75 | void RestoreData(); |
bd53cfb7 | 76 | void DoBench(Char_t *fname="benchmark"); |
3e87ef69 | 77 | |
78 | void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape); | |
79 | void SetResolutions(Float_t xyresidual,Float_t zresidual,Int_t clustercharge,Float_t xywidth=0.005,Float_t zwidth=0.005); | |
80 | ||
81 | static const Int_t GetNPadBits() {return fNumPadBits;} | |
82 | static const Int_t GetNTimeBits() {return fNumTimeBits;} | |
83 | static const Int_t GetNChargeBits() {return fNumChargeBits;} | |
84 | static const Int_t GetNShapeBits() {return fNumShapeBits;} | |
85 | static const Float_t GetXYResidualStep() {return fXYResidualStep;} | |
86 | static const Float_t GetZResidualStep() {return fZResidualStep;} | |
87 | static const Float_t GetXYWidthStep() {return fXYWidthStep;} | |
88 | static const Float_t GetZWidthStep() {return fZWidthStep;} | |
89 | static const Int_t GetClusterCharge() {return fClusterCharge;} | |
5b3f37f6 | 90 | |
91 | ClassDef(AliL3DataCompressor,1) | |
92 | ||
93 | }; | |
94 | ||
95 | #endif |