]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/comp/AliHLTDataCompressor.h
Bogdan: new version of MUON visualization.
[u/mrichter/AliRoot.git] / HLT / comp / AliHLTDataCompressor.h
CommitLineData
3e87ef69 1// @(#) $Id$
2
4aa41877 3#ifndef AliHLT_DataCompressor
4#define AliHLT_DataCompressor
5b3f37f6 5
4aa41877 6#include "AliHLTRootTypes.h"
1f1942b8 7
4aa41877 8class AliHLTSpacePointData;
9class AliHLTBenchmark;
10class AliHLTTrackArray;
11class AliHLTTrack;
3e87ef69 12
13#ifdef use_root
14class TH2F;
15class TFile;
16#endif
17
18struct 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
4aa41877 27class AliHLTDataCompressor {
5b3f37f6 28
b4686276 29 public:
4aa41877 30 AliHLTDataCompressor();
31 AliHLTDataCompressor(Char_t *path,Bool_t keep,Bool_t writeshape);
32 virtual ~AliHLTDataCompressor();
b4686276 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:
4aa41877 59 AliHLTBenchmark *fBenchmark; //! Benchmark
60 AliHLTTrackArray *fInputTracks; //! Array of input tracks
61 AliHLTSpacePointData *fClusters[36][6]; //! Array of pointers to clusters
b4686276 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();
4aa41877 71 void ExpandTrackData(AliHLTTrackArray *tracks);
3e87ef69 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
4aa41877 79 ClassDef(AliHLTDataCompressor,1)
5b3f37f6 80
81};
82
4aa41877 83typedef AliHLTDataCompressor AliL3DataCompressor; // for backward compatibility
84
5b3f37f6 85#endif