]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDRawStream.cxx
e THnSparse structure to store MC residuals
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDRawStream.cxx
index fa0f0e5f80900027a33230e008527f3c4ffaa069..1471477105e82928a5ac501005390cbf0f548273 100644 (file)
@@ -104,6 +104,7 @@ AliHMPIDRawStream::AliHMPIDRawStream() :
   for(Int_t iddl=0;iddl<kNDDL;iddl++) 
     for(Int_t ierr=0; ierr < kSumErr; ierr++) fNumOfErr[iddl][ierr]=0;               //reset errors  
 
+  
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 AliHMPIDRawStream::~AliHMPIDRawStream()
@@ -205,6 +206,12 @@ Bool_t AliHMPIDRawStream::Next()
   Bool_t status=kFALSE;
   fRawDataSize=0;        
   fDDLNumber = fRawReader->GetDDLID();
+  
+  if(fDDLNumber<0) {
+    AliWarning(Form("fDDLNumber not a acceptable value %i",fDDLNumber));
+    return kFALSE;
+  }
+    
   if(fRawReader->GetType() == 7 || fRawReader->GetType() == 8 )  {           //New: Select Physics events, Old: Raw data size is not 0 and not 47148 (pedestal)
     fnDDLInStream[fDDLNumber]=1; fnDDLOutStream[fDDLNumber]=0;
     
@@ -221,7 +228,7 @@ Bool_t AliHMPIDRawStream::Next()
    
     if(status) AliDebug(1,Form("Event DDL %i successfully decoded!.",fDDLNumber));
     else AliDebug(1,Form("Event DDL %i ERROR in decoding!.",fDDLNumber));
-//      DumpData(fRawReader->GetDataSize());
+    //DumpData(fRawReader->GetDataSize());
   
    
     }
@@ -241,6 +248,7 @@ void AliHMPIDRawStream::InitVars(Int_t n)
   fPad = new Int_t[n];
   //for debug purpose
   fPos = new Int_t[4*n+4];                     //reset debug
+  for(Int_t ie = 0 ; ie < 4*n+4; ie++) fPos[ie] = 0; //initialize for 0, otherwise the position is considered filled and will not be updated for the dump
   fiPos = 0;
 }    
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -277,8 +285,7 @@ Bool_t AliHMPIDRawStream::ReadHMPIDRawData()
   cnt--;
 
   
-  while (cnt>0) {
-    
+  while (cnt>20) { //counter limit is changed from 0 to 20 to take into account (skipp) the 5 extra words in the equipment header
     nwSeg = (fWord >> kbit8) & 0xfff;
     if(!CheckSegment()) return kFALSE;
     if(!ReadSegment(cntSegment)) return kFALSE;