Added support for NEWIO, merged cern-hlt tree, updated to latest track candidate...
[u/mrichter/AliRoot.git] / HLT / comp / AliL3DataCompressor.h
CommitLineData
3e87ef69 1// @(#) $Id$
2
5b3f37f6 3#ifndef AliL3_DataCompressor
4#define AliL3_DataCompressor
5
3e87ef69 6class AliL3SpacePointData;
bd53cfb7 7class AliL3Benchmark;
3e87ef69 8class AliL3TrackArray;
9class AliL3Track;
10
11#ifdef use_root
12class TH2F;
13class TFile;
14#endif
15
16struct 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
25class 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
3e87ef69 37
38 UInt_t fNcl[36][6];
3e87ef69 39
40 static Int_t fNumPadBits;
41 static Int_t fNumTimeBits;
42 static Int_t fNumChargeBits;
43 static Int_t fNumShapeBits;
5b3f37f6 44
0a86fbb7 45 static Float_t fXYResidualStep1;
46 static Float_t fXYResidualStep2;
47 static Float_t fXYResidualStep3;
48 static Float_t fZResidualStep1;
49 static Float_t fZResidualStep2;
50 static Float_t fZResidualStep3;
3e87ef69 51 static Float_t fXYWidthStep;
52 static Float_t fZWidthStep;
53 static Int_t fClusterCharge;
54
55 void SelectRemainingClusters();
56 void ExpandTrackData(AliL3TrackArray *tracks);
57 void ReadUncompressedData(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints);
58 void ReadRemaining(TempCluster **clusters,Int_t *ncl,const Int_t maxpoints);
59 void QSort(TempCluster **a, Int_t first, Int_t last);
60 Int_t Compare(TempCluster *a,TempCluster *b);
61 void OpenOutputFile();
62 void CloseOutputFile();
0a86fbb7 63
64 protected:
65 Char_t fPath[1024]; //!
66 Int_t fEvent;
b2a02bce 67 Int_t fNusedClusters;
68 Int_t fNunusedClusters;
0a86fbb7 69
70 Bool_t fWriteClusterShape;
71 Bool_t fKeepRemaining;
72 Bool_t fSinglePatch;
b2a02bce 73 Bool_t fWriteIdsToFile;
0a86fbb7 74
5b3f37f6 75 public:
76 AliL3DataCompressor();
3e87ef69 77 AliL3DataCompressor(Char_t *path,Bool_t keep,Bool_t writeshape);
5b3f37f6 78 virtual ~AliL3DataCompressor();
79
0a86fbb7 80 virtual void LoadData(Int_t event,Bool_t sp=kTRUE);
81 virtual void FillData(Int_t minhits,Bool_t expand);
82 virtual void WriteRemaining(Bool_t select);
3e87ef69 83 void CompressAndExpand();
0a86fbb7 84 void RestoreData(Bool_t remaining_only=kFALSE);
bd53cfb7 85 void DoBench(Char_t *fname="benchmark");
3e87ef69 86
87 void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
0a86fbb7 88 void SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
89 void SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
3e87ef69 90
b2a02bce 91 Int_t GetNusedClusters() {return fNusedClusters;}
92 Int_t GetNunusedClusters() {return fNunusedClusters;}
93
3e87ef69 94 static const Int_t GetNPadBits() {return fNumPadBits;}
95 static const Int_t GetNTimeBits() {return fNumTimeBits;}
96 static const Int_t GetNChargeBits() {return fNumChargeBits;}
97 static const Int_t GetNShapeBits() {return fNumShapeBits;}
3e87ef69 98 static const Float_t GetXYWidthStep() {return fXYWidthStep;}
99 static const Float_t GetZWidthStep() {return fZWidthStep;}
100 static const Int_t GetClusterCharge() {return fClusterCharge;}
0a86fbb7 101 static const Float_t GetXYResidualStep(Int_t row);
102 static const Float_t GetZResidualStep(Int_t row);
103
5b3f37f6 104
105 ClassDef(AliL3DataCompressor,1)
106
107};
108
109#endif