]>
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 { | |
19 | Float_t pad; | |
20 | Float_t time; | |
21 | Float_t sigmaY2; | |
22 | Float_t sigmaZ2; | |
23 | Int_t charge; | |
24 | Int_t padrow; | |
25 | }; | |
5b3f37f6 | 26 | |
27 | class AliL3DataCompressor { | |
28 | ||
29 | private: | |
bd53cfb7 | 30 | AliL3Benchmark *fBenchmark; //! |
3e87ef69 | 31 | AliL3TrackArray *fInputTracks; //! |
32 | AliL3SpacePointData *fClusters[36][6]; //! | |
33 | ofstream *fCompRatioFile; //! | |
34 | #ifdef use_root | |
35 | TFile *fOutputFile; //! | |
36 | #else | |
37 | FILE *fOutputFile; | |
38 | #endif | |
3e87ef69 | 39 | |
40 | UInt_t fNcl[36][6]; | |
3e87ef69 | 41 | |
1f1942b8 | 42 | /* |
3e87ef69 | 43 | static Int_t fNumPadBits; |
44 | static Int_t fNumTimeBits; | |
45 | static Int_t fNumChargeBits; | |
6f388e0d | 46 | static Int_t fNumPadShapeBits; |
47 | static Int_t fNumTimeShapeBits; | |
5b3f37f6 | 48 | |
6f388e0d | 49 | static Float_t fPadResidualStep1; |
50 | static Float_t fPadResidualStep2; | |
51 | static Float_t fPadResidualStep3; | |
52 | static Float_t fTimeResidualStep1; | |
53 | static Float_t fTimeResidualStep2; | |
54 | static Float_t fTimeResidualStep3; | |
55 | static Float_t fPadSigma2Step1; | |
56 | static Float_t fPadSigma2Step2; | |
57 | static Float_t fTimeSigma2Step; | |
3e87ef69 | 58 | static Int_t fClusterCharge; |
1f1942b8 | 59 | */ |
60 | ||
3e87ef69 | 61 | void SelectRemainingClusters(); |
62 | void ExpandTrackData(AliL3TrackArray *tracks); | |
63 | void ReadUncompressedData(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); | |
64 | void ReadRemaining(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints); | |
65 | void QSort(TempCluster **a, Int_t first, Int_t last); | |
66 | Int_t Compare(TempCluster *a,TempCluster *b); | |
67 | void OpenOutputFile(); | |
68 | void CloseOutputFile(); | |
0a86fbb7 | 69 | |
70 | protected: | |
1f1942b8 | 71 | Char_t fPath[1024]; //! |
0a86fbb7 | 72 | Int_t fEvent; |
b2a02bce | 73 | Int_t fNusedClusters; |
74 | Int_t fNunusedClusters; | |
0a86fbb7 | 75 | |
76 | Bool_t fWriteClusterShape; | |
77 | Bool_t fKeepRemaining; | |
78 | Bool_t fSinglePatch; | |
b2a02bce | 79 | Bool_t fWriteIdsToFile; |
5a31e9df | 80 | Bool_t fNoCompression; //Just process the data through the chain, but do not compress. (input=output). Mostly for debugging... |
81 | ||
5b3f37f6 | 82 | public: |
83 | AliL3DataCompressor(); | |
3e87ef69 | 84 | AliL3DataCompressor(Char_t *path,Bool_t keep,Bool_t writeshape); |
5b3f37f6 | 85 | virtual ~AliL3DataCompressor(); |
86 | ||
0a86fbb7 | 87 | virtual void LoadData(Int_t event,Bool_t sp=kTRUE); |
88 | virtual void FillData(Int_t minhits,Bool_t expand); | |
89 | virtual void WriteRemaining(Bool_t select); | |
1f1942b8 | 90 | void DetermineMinBits(); |
3e87ef69 | 91 | void CompressAndExpand(); |
0a86fbb7 | 92 | void RestoreData(Bool_t remaining_only=kFALSE); |
bd53cfb7 | 93 | void DoBench(Char_t *fname="benchmark"); |
5a31e9df | 94 | void DoNotCompress() {fNoCompression=kTRUE;} |
95 | ||
1f1942b8 | 96 | /* |
6f388e0d | 97 | void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shapepad,Int_t shapetime); |
0a86fbb7 | 98 | void SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005); |
99 | void SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005); | |
1f1942b8 | 100 | */ |
b2a02bce | 101 | Int_t GetNusedClusters() {return fNusedClusters;} |
102 | Int_t GetNunusedClusters() {return fNunusedClusters;} | |
6f388e0d | 103 | |
1f1942b8 | 104 | /* |
3e87ef69 | 105 | static const Int_t GetNPadBits() {return fNumPadBits;} |
106 | static const Int_t GetNTimeBits() {return fNumTimeBits;} | |
107 | static const Int_t GetNChargeBits() {return fNumChargeBits;} | |
6f388e0d | 108 | static const Int_t GetNPadShapeBits() {return fNumPadShapeBits;} |
109 | static const Int_t GetNTimeShapeBits() {return fNumTimeShapeBits;} | |
110 | static const Float_t GetPadSigma2Step(Int_t patch) {return patch < 2 ? fPadSigma2Step1 : fPadSigma2Step2;} | |
111 | static const Float_t GetTimeSigma2Step() {return fTimeSigma2Step;} | |
3e87ef69 | 112 | static const Int_t GetClusterCharge() {return fClusterCharge;} |
6f388e0d | 113 | static const Float_t GetPadResidualStep(Int_t row); |
114 | static const Float_t GetTimeResidualStep(Int_t row); | |
1f1942b8 | 115 | */ |
5b3f37f6 | 116 | |
117 | ClassDef(AliL3DataCompressor,1) | |
118 | ||
119 | }; | |
120 | ||
121 | #endif |