3 #include <TStopwatch.h>
4 #include "AliTPCCompression.h"
8 This macro compress and decompress an Altro format file using Huffman technique with 5 tables
11 void AliTPCH5OptimizedTables(const char* fSource="AltroFormat.dat",const char* fDest="CompressedData.dat"){
12 cout<<"Source file: "<<fSource<<" Output file: "<<fDest<<endl;
13 static const Int_t NumTable=5;
14 AliTPCCompression *util = new AliTPCCompression();
16 //verbose level can be: 0=silent 1=few messages 2=pedantic output
21 cout<<"**** Chose the tables set **** "<<endl;
22 cout<<"1==> Create tables from the input file "<<endl;
23 cout<<"2==> Use external optimized tables (txt format)"<<endl;
24 cout<<"3==> Time gap and Bunch length tables generated using formulas "<<endl;
25 cout<<"Insert the corresponding number: ";
28 }while((choice<1)||(choice>3));
32 util->CreateTables(fSource,NumTable);
33 cout<<"Tables have been created"<<endl;
37 util->CreateTablesFromTxtFiles(NumTable);
41 Double_t beta,gamma=0;
43 cout<<"Multiplicity (suggested 20000) ==> ";
45 cout<<"Gamma (suggested 4.77) ==> ";
47 cout<<"Beta (suggested 0.37) ==> ";
49 util->CreateTables(fSource,NumTable);
50 util->CreateTableFormula(gamma,mul,300,0);
51 util->CreateTableFormula(beta,mul,445,1);
56 //BE CAREFUL, the following method must be used only for debugging and
57 //it is highly suggested to use it only for debugging files
58 //reasonably small, because otherwise the size of the txt files can reach
59 //quickly several MB wasting time and disk space.
61 //util->ReadAltroFormat("File1.txt",fSource);
63 //The source file is compressed
65 util->CompressDataOptTables(NumTable,fSource,fDest);
71 //The Compressed file is decompressed
73 util->DecompressDataOptTables(NumTable,fDest);
76 util->ReadAltroFormat("File2.txt","SourceDecompressed.dat");