]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSCompressRawDataSDD.cxx
Fixes for reading zero-suppressed data. These should be propagated to
[u/mrichter/AliRoot.git] / ITS / AliITSCompressRawDataSDD.cxx
index feae4b41903e50dd9523c574b2af07f565eb1aac..820135e2c15aff2594b1f76e0d5d14048627305d 100644 (file)
@@ -115,25 +115,20 @@ void AliITSCompressRawDataSDD::Compress(){
   }
   
   FILE *outtxt=fopen("data.txt","w");
-  Int_t oldddl=-1;
+
   UInt_t word=0;
   do{
     rd->Reset();
 
     AliITSRawStreamSDD s(rd);
+    s.SetDecompressAmbra(kFALSE);
     while(s.Next()){
-      if(rd->GetDDLID()!=oldddl){
-       word=8<<28;
-       word+=rd->GetDDLID();
-       fprintf(outtxt,"%08X\n",word);
-       oldddl=rd->GetDDLID();
-      }
       if(s.IsCompletedModule()==kFALSE){
        word=s.GetCarlosId()<<27;
        word+=s.GetChannel()<<26;
        word+=s.GetCoord1()<<18;
        word+=s.GetCoord2()<<10;
-       word+=s.GetSignal();
+       word+=s.GetEightBitSignal();
        fprintf(outtxt,"%08X\n",word);
       }
       if(s.IsCompletedModule()==kTRUE){
@@ -156,6 +151,7 @@ UInt_t AliITSCompressRawDataSDD::CompressEvent(UChar_t* inputPtr){
   siz+=32;
   UInt_t word=0;
   AliITSRawStreamSDD s(fRawReader);
+  s.SetDecompressAmbra(kFALSE);
   Int_t mask1=0xFF000000;
   Int_t mask2=0x00FF0000;
   Int_t mask3=0x0000FF00;
@@ -166,15 +162,15 @@ UInt_t AliITSCompressRawDataSDD::CompressEvent(UChar_t* inputPtr){
       word+=s.GetChannel()<<26;
       word+=s.GetCoord1()<<18;
       word+=s.GetCoord2()<<10;
-      word+=s.GetSignal();
+      word+=s.GetEightBitSignal();
       if(siz+4<fSizeInMemory){
-       *(fPointerToData)=(word&mask1)>>24;
-       ++fPointerToData;
-       *(fPointerToData)=(word&mask2)>>16;
+       *(fPointerToData)=(word&mask4);
        ++fPointerToData;
        *(fPointerToData)=(word&mask3)>>8;
        ++fPointerToData;
-       *(fPointerToData)=(word&mask4);
+       *(fPointerToData)=(word&mask2)>>16;
+       ++fPointerToData;
+       *(fPointerToData)=(word&mask1)>>24;
        ++fPointerToData;
        siz+=4;
       }
@@ -183,13 +179,13 @@ UInt_t AliITSCompressRawDataSDD::CompressEvent(UChar_t* inputPtr){
       word=15<<28;
       word+=s.GetCarlosId();
       if(siz+4<fSizeInMemory){
-       *(fPointerToData)=(word&mask1)>>24;
-       ++fPointerToData;
-       *(fPointerToData)=(word&mask2)>>16;
+       *(fPointerToData)=(word&mask4);
        ++fPointerToData;
        *(fPointerToData)=(word&mask3)>>8;
        ++fPointerToData;
-       *(fPointerToData)=(word&mask4);
+       *(fPointerToData)=(word&mask2)>>16;
+       ++fPointerToData;
+       *(fPointerToData)=(word&mask1)>>24;
        ++fPointerToData;
        siz+=4;
       }