]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCDDLRawData.cxx
Updated version of raw data code (D.Favretto)
[u/mrichter/AliRoot.git] / TPC / AliTPCDDLRawData.cxx
index 45c07ea7f3fdd75a3e43c32d9ab47b99aeac6c47..aa6adbe55e720e3145aa2df17bce76e70b0ada36 100644 (file)
@@ -35,11 +35,13 @@ ClassImp(AliTPCDDLRawData)
 
 AliTPCDDLRawData::AliTPCDDLRawData(const AliTPCDDLRawData &source){
   // Copy Constructor
+  fVerbose=source.fVerbose;
   return;
 }
 
 AliTPCDDLRawData& AliTPCDDLRawData::operator=(const AliTPCDDLRawData &source){
   //Assigment operator
+  fVerbose=source.fVerbose;
   return *this;
 }
 
@@ -193,7 +195,7 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
 #else
     f.open(filename,ios::in);
 #endif
-    if(!f){cout<<"File doesn't exist \n";exit(1);}
+    if(!f){cout<<"BE CAREFUL!! There isn't enough data to generate "<<LDCsNumber<<" slices"<<endl;break;}
     cout<<filename<<"  "<<dest<<endl;
     ofstream fdest;
 #ifndef __DECCXX
@@ -208,6 +210,7 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
     //here the Mini Header is read
     while( (f.read((char*)(miniHeader),sizeof(ULong_t)*3)) ){
       size=miniHeader[0];
+      // cout<<"Data size:"<<size<<endl;
       //Int_t dim=sizeof(ULong_t)+sizeof(Int_t)*5;
       //cout<<" Sec "<<SecNumber<<" SubSector "<<SubSector<<" size "<<size<<endl;
       //open the temporay File
@@ -226,9 +229,10 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
       fo.close();
       //The temp file is compressed or decompressed
       AliTPCCompression *util = new AliTPCCompression();
-      //      util->SetVerbose(1);
-      if(!Comp)
+      util->SetVerbose(0);
+      if(!Comp){
        util->CompressDataOptTables(kNumTables,temp,"TempCompDecomp");
+      }
       else
        util->DecompressDataOptTables(kNumTables,temp,"TempCompDecomp");
       delete util;
@@ -273,7 +277,7 @@ Int_t AliTPCDDLRawData::RawDataCompDecompress(Int_t LDCsNumber,Int_t Comp){
 /////////////////////////////////////////////////////////////////////////////////
 void AliTPCDDLRawData::RawDataAltro()const{
   //This method is used to build the Altro format from AliTPCDDL.dat
-  //It is used to debug the code and create the tables used in the compresseion phase
+  //It is used to debug the code and creates the tables used in the compresseion phase
   Int_t offset=1;
   ifstream f;
 #ifndef __DECCXX
@@ -386,14 +390,14 @@ void AliTPCDDLRawData::RawDataAltroDecode(Int_t LDCsNumber,Int_t Comp){
 #else
     f.open(filename,ios::in);
 #endif
-    if(!f){cout<<"The file doesn't exist"<<endl;exit(1);}
+    if(!f){cout<<"BE CAREFUL!! There isn't enough data to generate "<<LDCsNumber<<" slices"<<endl;break;}
     //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)
     ULong_t miniHeader[3];
     //here the Mini Header is read
+    //cout<<filename<<endl;
     while( (f.read((char*)(miniHeader),sizeof(ULong_t)*3)) ){
-      //cout<<"Mini header dimension "<<miniHeader[0]<<endl;
       Int_t car=0;
       size=miniHeader[0];
       for(ULong_t j=0;j<size;j++){