* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id:*/
+/* $Id$ */
//This class contains all the necessary methods to create the Raw Data
//files (slides) for the ITS data challenges for:
ULong_t size=0; // size of the data block that follows the mini header
Int_t magicWord=0x123456; // Magic word used to distinguish between data and garbage
sprintf(fileName,"SPDslice%d",sliceNumber); //The name of the output file. There are as many slides as the number of LDC
+#ifndef __DECCXX
outfile.open(fileName,ios::binary);
+#else
+ outfile.open(fileName);
+#endif
ULong_t miniHeader[3];
Int_t miniHeaderSize=sizeof(ULong_t)*3;
Int_t version=1; //version of the mini header
sliceNumber++;
sprintf(fileName,"SPDslice%d",sliceNumber);
if(i!=(kDDLsNumber-1))
+#ifndef __DECCXX
outfile.open(fileName,ios::binary);
+#else
+ outfile.open(fileName);
+#endif
countDDL=0;
}//end if
}//end for
ULong_t size=0; // size of the data block that follows the mini header
Int_t magicWord=0x123456; // Magic word used to distinguish between data and garbage
sprintf(fileName,"SSDslice%d",sliceNumber); //The name of the output file. There are as many slides as the number of LDC
+#ifndef __DECCXX
outfile.open(fileName,ios::binary);
+#else
+ outfile.open(fileName);
+#endif
ULong_t miniHeader[3];
Int_t miniHeaderSize=sizeof(ULong_t)*3;
Int_t version=1; //version of the mini header
sliceNumber++;
sprintf(fileName,"SSDslice%d",sliceNumber);
if(i!=(kDDLsNumber-1))
+#ifndef __DECCXX
outfile.open(fileName,ios::binary);
+#else
+ outfile.open(fileName);
+#endif
countDDL=0;
}//end if
}//end for
ULong_t size=0; // size of the data block that follows the mini header
Int_t magicWord=0x123456; // Magic word used to distinguish between data and garbage
sprintf(fileName,"SDDslice%d",sliceNumber); //The name of the output file. There are as many slides as the number of LDC
+#ifndef __DECCXX
outfile.open(fileName,ios::binary);
+#else
+ outfile.open(fileName);
+#endif
ULong_t miniHeader[3];
Int_t miniHeaderSize=sizeof(ULong_t)*3;
Int_t version=1; //version of the mini header
sliceNumber++;
sprintf(fileName,"SDDslice%d",sliceNumber);
if(i!=(kDDLsNumber-1))
+#ifndef __DECCXX
outfile.open(fileName,ios::binary);
+#else
+ outfile.open(fileName);
+#endif
countDDL=0;
}//end if
}//end for
Int_t miniHeaderSize=sizeof(ULong_t)*3;
for(Int_t i=1;i<=ldcsNumber;i++){
sprintf(filename,"SPDslice%d",i);
+#ifndef __DECCXX
f.open(filename,ios::binary|ios::in);
+#else
+ f.open(filename,ios::in);
+#endif
if(!f){exit(1);}
//loop over the DDL block
//here the Mini Header is read
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
AliTPCBuffer::AliTPCBuffer(const char* fileName){
// Constructor
+#ifndef __DECCXX
f.open("AliTPCDDL.dat",ios::binary|ios::out);
+#else
+ f.open("AliTPCDDL.dat",ios::out);
+#endif
// fout=new TFile(fileName,"recreate");
// tree=new TTree("tree","Values");
fNumberOfDigits=0;
//the buffer is cleaned
for (Int_t i=0;i<5;i++)fBuffer[i]=0;
//open the output file
+#ifndef __DECCXX
f.open(fileName,ios::binary|ios::out);
+#else
+ f.open(fileName,ios::out);
+#endif
}
else{
//open the input file
+#ifndef __DECCXX
f.open(fileName,ios::binary|ios::in);
+#else
+ f.open(fileName,ios::in);
+#endif
if(!f){cout<<"File doesn't exist\n";exit(-1);}
fShift=0;
//To get the file dimension (position of the last element in term of bytes)
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id:*/
+/* $Id$ */
// This class contains the implementation of the
// compression and decompression algorithms
char filename[15];
ofstream fTable;
for(Int_t k=0;k<NumTable;k++){
- sprintf(filename,"Table%d.dat",k);
+ sprintf(filename,"Table%d.dat",k);
+#ifndef __DECCXX
fTable.open(filename,ios::binary);
+#else
+ fTable.open(filename);
+#endif
Int_t dim=table[k]->Size();
//Table dimension is written into a file
fTable.write((char*)(&dim),sizeof(Int_t));
for(Int_t k=0;k<NumTable;k++){
Int_t dim;//this variable contains the table dimension
sprintf(filename,"Table%d.dat",k);
+#ifndef __DECCXX
fTable.open(filename,ios::binary);
+#else
+ fTable.open(filename);
+#endif
fTable.read((char*)(&dim),sizeof(Int_t));
if (fVerbose)
cout<<"Table dimension: "<<dim<<endl;
cout<<" COMPRESSION "<<endl;
cout<<"compression of the file "<<fSource<<" Output File: "<<fDest<<endl;
//the output file is open
+#ifndef __DECCXX
f.open(fDest,ios::binary|ios::out);
+#else
+ f.open(fDest,ios::out);
+#endif
//Tables are written into the output file
for(Int_t k=0;k<NumTable;k++){
Int_t dim=table[k]->Size();
AliTPCHTable **table = new AliTPCHTable*[NumTable];
RetrieveTables(table,NumTable);
//the output file is open
+#ifndef __DECCXX
f.open(fDest,ios::binary|ios::out);
+#else
+ f.open(fDest,ios::out);
+#endif
// Source file is open
AliTPCBuffer160 buff(fSource,0);
//coded words are written into a file
RootNode[k]=new AliTPCHNode(); //RootNode is the root of the tree
Int_t dim=0;//this variable contains the table dimension
sprintf(filename,"Table%d.dat",k);
+#ifndef __DECCXX
fTable.open(filename,ios::binary);
+#else
+ fTable.open(filename);
+#endif
fTable.read((char*)(&dim),sizeof(Int_t));
if (fVerbose)
cout<<"Table dimension: "<<dim<<endl;
Int_t AliTPCCompression::DecompressData(Int_t NumTables,const char* fname,char* fDest){
//Decompression method
cout<<" DECOMPRESSION:"<<endl;
- cout<<"Source File "<<fname<<" Destination File "<<fDest<<endl;
+ cout<<"Source File "<<fname<<" Destination File "<<fDest<<endl;
+#ifndef __DECCXX
f.open(fname,ios::binary|ios::in);
+#else
+ f.open(fname,ios::in);
+#endif
if(!f){cout<<"File doesn't exist\n";return -1;}
AliTPCHNode ** rootNode = new AliTPCHNode*[NumTables];
//Creation of the Huffman trees
AliTPCHNode ** rootNode = new AliTPCHNode*[NumTables];
//Creation of the Huffman trees
CreateTreesFromFile(rootNode,NumTables);
+#ifndef __DECCXX
f.open(fname,ios::binary|ios::in);
+#else
+ f.open(fname,ios::in);
+#endif
if(!f){cout<<"File doesn't exist\n";return -1;}
//to go to the end of the file
f.seekg(0,ios::end);
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id:*/
+/* $Id$ */
//This class conteins all the methods to create raw data
//as par a given DDL.
if (216%LDCsNumber) ddlPerFile++;
cout<<"Number of DDL per slide: "<<ddlPerFile<<endl;
ifstream f;
+#ifndef __DECCXX
f.open("AliTPCDDL.dat",ios::binary);
+#else
+ f.open("AliTPCDDL.dat");
+#endif
if(!f){cout<<"File doesn't exist !!"<<endl;return;}
struct DataPad{
Int_t Sec;
sprintf(filename,"TPCslice%d.comp",i);
sprintf(dest,"TPCslice%d.decomp",i);
}
+#ifndef __DECCXX
f.open(filename,ios::binary|ios::in);
+#else
+ f.open(filename,ios::in);
+#endif
if(!f){cout<<"File doesn't exist \n";exit(1);}
cout<<filename<<" "<<dest<<endl;
ofstream fdest;
+#ifndef __DECCXX
fdest.open(dest,ios::binary);
+#else
+ fdest.open(dest);
+#endif
//loop over the DDL block
//Each block contains a Mini Header followed by raw data (ALTRO FORMAT)
//The number of block is ceil(216/LDCsNumber)
//open the temporay File
ofstream fo;
char temp[15]="TempFile";
+#ifndef __DECCXX
fo.open(temp,ios::binary);
+#else
+ fo.open(temp);
+#endif
Int_t car=0;
for(ULong_t j=0;j<size;j++){
f.read((char*)(&car),1);
delete util;
//the temp compressed file is open and copied to the final file fdest
ifstream fi;
+#ifndef __DECCXX
fi.open("TempCompDecomp",ios::binary);
+#else
+ fi.open("TempCompDecomp");
+#endif
fi.seekg(0,ios::end);
size=fi.tellg();
fi.seekg(0);
//It is used to debug the code and create the tables used in the compresseion phase
Int_t offset=1;
ifstream f;
+#ifndef __DECCXX
f.open("AliTPCDDL.dat",ios::binary);
+#else
+ f.open("AliTPCDDL.dat");
+#endif
if(!f){cout<<"File doesn't exist !!"<<endl;return;}
struct DataPad{
Int_t Sec;
sprintf(dest,"AltroDDLRecomposedDec.dat");
ofstream fdest;
+#ifndef __DECCXX
fdest.open(dest,ios::binary);
+#else
+ fdest.open(dest);
+#endif
ULong_t size=0;
//Int_t MagicWord,DDLNumber,SecNumber,SubSector,Detector,flag=0;
for(Int_t i=1;i<=LDCsNumber;i++){
sprintf(filename,"TPCslice%d",i);
else
sprintf(filename,"TPCslice%d.decomp",i);
+#ifndef __DECCXX
f.open(filename,ios::binary|ios::in);
+#else
+ f.open(filename,ios::in);
+#endif
if(!f){cout<<"The file doesn't exist"<<endl;exit(1);}
//loop over the DDL block
//Each block contains a Mini Header followed by raw data (ALTRO FORMAT)