]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
No ios::binary on Alpha with cxx
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Mar 2003 18:03:36 +0000 (18:03 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Mar 2003 18:03:36 +0000 (18:03 +0000)
ITS/AliITSDDLRawData.cxx
TPC/AliTPCBuffer.cxx
TPC/AliTPCBuffer160.cxx
TPC/AliTPCCompression.cxx
TPC/AliTPCDDLRawData.cxx

index 52de11212f8c39ac17e9c37b340600a65564b9f4..1c2c5f09e091c72c3706f87871d9316b2004a331 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
  * 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:
 
 //This class contains all the necessary methods to create the Raw Data
 //files (slides) for the ITS data challenges for:
@@ -330,7 +330,11 @@ Int_t AliITSDDLRawData::RawDataSPD(AliITS *ITS,TTree *TD ,Int_t LDCsNumber){
   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
   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);
   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 
   ULong_t miniHeader[3];
   Int_t miniHeaderSize=sizeof(ULong_t)*3;
   Int_t version=1;          //version of the mini header 
@@ -372,7 +376,11 @@ Int_t AliITSDDLRawData::RawDataSPD(AliITS *ITS,TTree *TD ,Int_t LDCsNumber){
       sliceNumber++;
       sprintf(fileName,"SPDslice%d",sliceNumber); 
       if(i!=(kDDLsNumber-1))
       sliceNumber++;
       sprintf(fileName,"SPDslice%d",sliceNumber); 
       if(i!=(kDDLsNumber-1))
+#ifndef __DECCXX
        outfile.open(fileName,ios::binary);
        outfile.open(fileName,ios::binary);
+#else
+       outfile.open(fileName);
+#endif
       countDDL=0;
     }//end if
   }//end for
       countDDL=0;
     }//end if
   }//end for
@@ -589,7 +597,11 @@ Int_t AliITSDDLRawData::RawDataSSD(AliITS *ITS,TTree *TD ,Int_t LDCsNumber){
   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
   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);
   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 
   ULong_t miniHeader[3];
   Int_t miniHeaderSize=sizeof(ULong_t)*3;
   Int_t version=1;              //version of the mini header 
@@ -634,7 +646,11 @@ Int_t AliITSDDLRawData::RawDataSSD(AliITS *ITS,TTree *TD ,Int_t LDCsNumber){
       sliceNumber++;
       sprintf(fileName,"SSDslice%d",sliceNumber); 
       if(i!=(kDDLsNumber-1))
       sliceNumber++;
       sprintf(fileName,"SSDslice%d",sliceNumber); 
       if(i!=(kDDLsNumber-1))
+#ifndef __DECCXX
        outfile.open(fileName,ios::binary);
        outfile.open(fileName,ios::binary);
+#else
+       outfile.open(fileName);
+#endif
       countDDL=0;
     }//end if
   }//end for
       countDDL=0;
     }//end if
   }//end for
@@ -684,7 +700,11 @@ Int_t AliITSDDLRawData::RawDataSDD(AliITS *ITS,TTree *TD ,Int_t LDCsNumber){
   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
   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);
   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 
   ULong_t miniHeader[3];
   Int_t miniHeaderSize=sizeof(ULong_t)*3;
   Int_t version=1;             //version of the mini header 
@@ -729,7 +749,11 @@ Int_t AliITSDDLRawData::RawDataSDD(AliITS *ITS,TTree *TD ,Int_t LDCsNumber){
       sliceNumber++;
       sprintf(fileName,"SDDslice%d",sliceNumber); 
       if(i!=(kDDLsNumber-1))
       sliceNumber++;
       sprintf(fileName,"SDDslice%d",sliceNumber); 
       if(i!=(kDDLsNumber-1))
+#ifndef __DECCXX
        outfile.open(fileName,ios::binary);
        outfile.open(fileName,ios::binary);
+#else
+       outfile.open(fileName);
+#endif
       countDDL=0;
     }//end if
   }//end for
       countDDL=0;
     }//end if
   }//end for
@@ -824,7 +848,11 @@ void AliITSDDLRawData::TestFormat(){
   Int_t miniHeaderSize=sizeof(ULong_t)*3;
   for(Int_t i=1;i<=ldcsNumber;i++){
     sprintf(filename,"SPDslice%d",i);  
   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);
     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
     if(!f){exit(1);}
     //loop over the DDL block 
     //here the Mini Header is read
index 117cb60362a53674eff025a6f8d2ddacecf70b51..67f23c8bcf4c00b0d8cbec9c2d084a9efef2e939 100644 (file)
@@ -32,7 +32,11 @@ ClassImp(AliTPCBuffer)
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 AliTPCBuffer::AliTPCBuffer(const char* fileName){
   // Constructor
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 AliTPCBuffer::AliTPCBuffer(const char* fileName){
   // Constructor
+#ifndef __DECCXX
   f.open("AliTPCDDL.dat",ios::binary|ios::out);
   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;
   // fout=new TFile(fileName,"recreate");
   // tree=new TTree("tree","Values");
   fNumberOfDigits=0;
index 5e2aa1fed76155c4befc6ec4083d68dd08a71c89..3092af271e89efcd257a2d568d58b42959e0bfb8 100644 (file)
@@ -43,11 +43,19 @@ AliTPCBuffer160::AliTPCBuffer160(const char* fileName,Int_t flag){
     //the buffer is cleaned 
     for (Int_t i=0;i<5;i++)fBuffer[i]=0;
     //open the output file
     //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);
     f.open(fileName,ios::binary|ios::out);
+#else
+    f.open(fileName,ios::out);
+#endif
   }
   else{
     //open the input file
   }
   else{
     //open the input file
+#ifndef __DECCXX
     f.open(fileName,ios::binary|ios::in);
     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)
     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)
index 0f265c85f98d8b04849e7eb9508a0e2002dfe17a..dc031e3d13a72ec8fc67e0948cc4e403d4d5f215 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
  * 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 
 
 // This class contains the implementation of the 
 // compression and decompression algorithms 
@@ -233,8 +233,12 @@ Int_t AliTPCCompression::StoreTables(AliTPCHTable* table[],const Int_t NumTable)
   char filename[15];
   ofstream fTable;
   for(Int_t k=0;k<NumTable;k++){
   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);
     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));
     Int_t dim=table[k]->Size();
     //Table dimension is written into a file
     fTable.write((char*)(&dim),sizeof(Int_t));
@@ -357,7 +361,11 @@ Int_t AliTPCCompression::RetrieveTables(AliTPCHTable* table[],Int_t NumTable){
   for(Int_t k=0;k<NumTable;k++){
     Int_t dim;//this variable contains the table dimension
     sprintf(filename,"Table%d.dat",k); 
   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);
     fTable.open(filename,ios::binary);
+#else
+    fTable.open(filename);
+#endif
     fTable.read((char*)(&dim),sizeof(Int_t));
     if (fVerbose)
       cout<<"Table dimension: "<<dim<<endl;
     fTable.read((char*)(&dim),sizeof(Int_t));
     if (fVerbose)
       cout<<"Table dimension: "<<dim<<endl;
@@ -439,7 +447,11 @@ Int_t AliTPCCompression::CompressData(AliTPCHTable* table[],Int_t NumTable,const
   cout<<" COMPRESSION "<<endl;
   cout<<"compression of the file "<<fSource<<" Output File: "<<fDest<<endl;
   //the output file is open
   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);
   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();
   //Tables are written into the output file
   for(Int_t k=0;k<NumTable;k++){
     Int_t dim=table[k]->Size();
@@ -555,7 +567,11 @@ Int_t AliTPCCompression::CompressDataOptTables(Int_t NumTable,const char* fSourc
   AliTPCHTable **table = new AliTPCHTable*[NumTable];
   RetrieveTables(table,NumTable);
   //the output file is open
   AliTPCHTable **table = new AliTPCHTable*[NumTable];
   RetrieveTables(table,NumTable);
   //the output file is open
+#ifndef __DECCXX 
   f.open(fDest,ios::binary|ios::out);
   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
   // Source file is open
   AliTPCBuffer160 buff(fSource,0);
   //coded words are written into a file
@@ -785,7 +801,11 @@ void AliTPCCompression::CreateTreesFromFile(AliTPCHNode *RootNode[],const Int_t
     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); 
     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);
     fTable.open(filename,ios::binary);
+#else
+    fTable.open(filename);
+#endif
     fTable.read((char*)(&dim),sizeof(Int_t));
     if (fVerbose)
       cout<<"Table dimension: "<<dim<<endl;
     fTable.read((char*)(&dim),sizeof(Int_t));
     if (fVerbose)
       cout<<"Table dimension: "<<dim<<endl;
@@ -901,8 +921,12 @@ ULong_t AliTPCCompression::GetDecodedWord(AliTPCHNode* root){
 Int_t AliTPCCompression::DecompressData(Int_t NumTables,const char* fname,char* fDest){
   //Decompression method 
   cout<<"   DECOMPRESSION:"<<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);
   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
   if(!f){cout<<"File doesn't exist\n";return -1;}
   AliTPCHNode ** rootNode = new AliTPCHNode*[NumTables];
   //Creation of the Huffman trees
@@ -981,7 +1005,11 @@ Int_t AliTPCCompression::DecompressDataOptTables(Int_t NumTables,const char* fna
   AliTPCHNode ** rootNode = new AliTPCHNode*[NumTables];
   //Creation of the Huffman trees
   CreateTreesFromFile(rootNode,NumTables);
   AliTPCHNode ** rootNode = new AliTPCHNode*[NumTables];
   //Creation of the Huffman trees
   CreateTreesFromFile(rootNode,NumTables);
+#ifndef __DECCXX
   f.open(fname,ios::binary|ios::in);
   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);
   if(!f){cout<<"File doesn't exist\n";return -1;}
   //to go to the end of the file
   f.seekg(0,ios::end);
index 714bb9e42aabb0ff7f3383cf717cd387e7d6d927..5c16b16dec78c32bd3b52c71fb7a72db9fa49ca6 100644 (file)
@@ -12,7 +12,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
  * 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.
 
 //This class conteins all the methods to create raw data 
 //as par a given DDL.
@@ -54,7 +54,11 @@ void AliTPCDDLRawData::RawData(Int_t LDCsNumber){
   if (216%LDCsNumber) ddlPerFile++;
   cout<<"Number of DDL per slide: "<<ddlPerFile<<endl;
   ifstream f;
   if (216%LDCsNumber) ddlPerFile++;
   cout<<"Number of DDL per slide: "<<ddlPerFile<<endl;
   ifstream f;
+#ifndef __DECCXX
   f.open("AliTPCDDL.dat",ios::binary);
   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;
   if(!f){cout<<"File doesn't exist !!"<<endl;return;}
   struct DataPad{
     Int_t Sec;
@@ -183,11 +187,19 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
       sprintf(filename,"TPCslice%d.comp",i);
       sprintf(dest,"TPCslice%d.decomp",i);
     }
       sprintf(filename,"TPCslice%d.comp",i);
       sprintf(dest,"TPCslice%d.decomp",i);
     }
+#ifndef __DECCXX
     f.open(filename,ios::binary|ios::in);
     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;
     if(!f){cout<<"File doesn't exist \n";exit(1);}
     cout<<filename<<"  "<<dest<<endl;
     ofstream fdest;
+#ifndef __DECCXX
     fdest.open(dest,ios::binary);
     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)
     //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)
@@ -200,7 +212,11 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
       //open the temporay File
       ofstream fo;
       char temp[15]="TempFile";
       //open the temporay File
       ofstream fo;
       char temp[15]="TempFile";
+#ifndef __DECCXX
       fo.open(temp,ios::binary);
       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);
       Int_t car=0;
       for(ULong_t j=0;j<size;j++){
        f.read((char*)(&car),1);
@@ -216,7 +232,11 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
       delete util;
       //the temp compressed file is open and copied to the final file fdest
       ifstream fi;
       delete util;
       //the temp compressed file is open and copied to the final file fdest
       ifstream fi;
+#ifndef __DECCXX
       fi.open("TempCompDecomp",ios::binary);
       fi.open("TempCompDecomp",ios::binary);
+#else
+      fi.open("TempCompDecomp");
+#endif
       fi.seekg(0,ios::end);
       size=fi.tellg();
       fi.seekg(0);
       fi.seekg(0,ios::end);
       size=fi.tellg();
       fi.seekg(0);
@@ -255,7 +275,11 @@ void AliTPCDDLRawData::RawDataAltro()const{
   //It is used to debug the code and create the tables used in the compresseion phase
   Int_t offset=1;
   ifstream f;
   //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);
   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;
   if(!f){cout<<"File doesn't exist !!"<<endl;return;}
   struct DataPad{
     Int_t Sec;
@@ -344,7 +368,11 @@ void AliTPCDDLRawData::RawDataAltroDecode(Int_t LDCsNumber,Int_t Comp){
     sprintf(dest,"AltroDDLRecomposedDec.dat");
   ofstream fdest;
 
     sprintf(dest,"AltroDDLRecomposedDec.dat");
   ofstream fdest;
 
+#ifndef __DECCXX
   fdest.open(dest,ios::binary);
   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++){
   ULong_t size=0;
   //Int_t MagicWord,DDLNumber,SecNumber,SubSector,Detector,flag=0;
   for(Int_t i=1;i<=LDCsNumber;i++){
@@ -352,7 +380,11 @@ void AliTPCDDLRawData::RawDataAltroDecode(Int_t LDCsNumber,Int_t Comp){
       sprintf(filename,"TPCslice%d",i);  
     else
       sprintf(filename,"TPCslice%d.decomp",i);  
       sprintf(filename,"TPCslice%d",i);  
     else
       sprintf(filename,"TPCslice%d.decomp",i);  
+#ifndef __DECCXX
     f.open(filename,ios::binary|ios::in);
     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)
     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)