]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSRawStreamSDDCompressed.cxx
changes for 2D centrality QA (Alis R. Manso)
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSDDCompressed.cxx
index 9ddab4899c863008068884a64b267aa1af49554b..012742e7159cbe1957aa816b9d80e2f98d5dfd85 100644 (file)
@@ -24,7 +24,7 @@
 //   29  |                                                       //
 //   28  |-> 4 bits to identify the Carlos (0-11) inside the DDL //
 //   27 -                                                        //
-//   26 detecot side (0= left, =right)                           //
+//   26 detecor side (0= left, =right)                           //
 //   25 -                                                        //
 //   24  |                                                       //
 //   23  |                                                       //
 //    1  |                                                       //
 //    0 -                                                        //
 //                                                               //
-// Plus 2 types of control words:                                //
-// - Jitter word     = 1000                                      //
-// - End of module data (needed by the Cluster Finder)   = 1111  //
+// Plus 3 types of control words                                 //
+// identified by the the 4 most significant bits (31-28)         //
+// 1) Jitter word     = 1000                                     //
+// 2) JTAG answer     = 1100                                     //
+// 3) End of module data (needed by the Cluster Finder)   = 1111 //
 //                                                               //
 // Origin: F.Prino, Torino, prino@to.infn.it                     //
 //                                                               //
@@ -149,11 +151,11 @@ Bool_t AliITSRawStreamSDDCompressed::Next()
 // returns kTRUE and fCompletedModule=kFALSE and fCompletedDDL=kTRUE  when a DDL is completed (=jitter word)
 
 
-  UInt_t maskjit=8;    // Jitter word has the 4 most significant bits = 1000
-  UInt_t maskeom=15;   // end of module has the 4 most significant bits = 1111
+  UInt_t idJit=8;    // Jitter word has the 4 most significant bits = 1000
+  UInt_t idEom=15;   // end of module has the 4 most significant bits = 1111
+  UInt_t idJtag=12;  // end of module has the 4 most significant bits = 1100
+
   UInt_t maskmod=15;   // last 4 bits for module number in end of module word
-  //  UInt_t maskDDL=0xFF; // last 8 bits for DDL number in start of DDL word
-    
   UInt_t maskCarlos=15<<27; // 4 bits  (27-30) for CarlosId in data word
   UInt_t maskSide=1<<26;    // 1 bit   (26)    for side     in data word
   UInt_t maskAnode=255<<18; // 8 bits  (18-25) for Nanode   in data word
@@ -164,21 +166,31 @@ Bool_t AliITSRawStreamSDDCompressed::Next()
   while(kTRUE){
     if (!fRawReader->ReadNextInt(fData)) return kFALSE;  // read next word
     UInt_t mostsigbits=fData>>28; 
-    if(mostsigbits==maskeom){
+    if(fData==0xFFFFFFFF){ 
+      // CarlosRX header do nothing
+    } else if(mostsigbits==idEom){
+      // end of module word
       fCarlosId=fData&maskmod;
       fDDL=fRawReader->GetDDLID();
+      if(fDDL<0) return kFALSE;
       fModuleID = GetModuleNumber(fDDL,fCarlosId);
       fCompletedDDL=kFALSE;
       fCompletedModule=kTRUE;
       return kTRUE;
-    } else if(mostsigbits==maskjit){
+    } else if(mostsigbits==idJit){
+      // jitter word
       fJitter = fData&0x000000ff;      
       fCompletedModule=kFALSE;
       fCompletedDDL=kTRUE;
       return kTRUE;
-    }else{
+    } else if(mostsigbits==idJtag){
+      // jtag word -> skipped
+      continue;
+    }else if(mostsigbits<8){
+      // data word
       fCarlosId=(fData&maskCarlos)>>27;
       fDDL=fRawReader->GetDDLID();
+      if(fDDL<0) return kFALSE;
       fModuleID = GetModuleNumber(fDDL,fCarlosId);
       fChannel=(fData&maskSide)>>26;
       fCoord1=(fData&maskAnode)>>18;
@@ -186,7 +198,10 @@ Bool_t AliITSRawStreamSDDCompressed::Next()
       Int_t sig8bit;
       if(fADCEncoded){
        UInt_t code=fData&maskCode;
-       if (code < 2 || code > 7) AliError("Wrong ADC code value");
+       if (code < 2 || code > 7){ 
+         AliError(Form("Wrong ADC code value %d",code));
+         continue;
+       }
        UInt_t adcmask=(1<<code)-1;
        sig8bit=((fData&(adcmask<<3))>>3) + (1<<code);
       }else{