]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliAltroBuffer.cxx
In AliMUONQADataMakerRec:
[u/mrichter/AliRoot.git] / RAW / AliAltroBuffer.cxx
index a06927f834ff1ac5a0aec5488633290fe48f6166..0b9071cd989d61ac916b6850cbf04e810b4bf47b 100644 (file)
@@ -31,7 +31,7 @@
 ClassImp(AliAltroBuffer)
 
 //_____________________________________________________________________________
-AliAltroBuffer::AliAltroBuffer(const char* fileName, const AliAltroMapping *mapping):
+AliAltroBuffer::AliAltroBuffer(const char* fileName, AliAltroMapping *mapping):
   fShift(0),
   fCurrentCell(0),
   fFreeCellBuffer(16),
@@ -199,7 +199,7 @@ void AliAltroBuffer::WriteChannel(Int_t padNumber, Int_t rowNumber,
   //Write all ADC values and the trailer of a channel
   Int_t nWords = WriteBunch(nTimeBins,adcValues,threshold);
   // write the trailer
-  WriteTrailer(nWords, padNumber, rowNumber, secNumber);
+  if (nWords) WriteTrailer(nWords, padNumber, rowNumber, secNumber);
 }
 
 //_____________________________________________________________________________
@@ -210,7 +210,7 @@ void AliAltroBuffer::WriteChannel(Short_t hwAddress,
   //Write all ADC values and the trailer of a channel
   Int_t nWords = WriteBunch(nTimeBins,adcValues,threshold);
   // write the trailer
-  WriteTrailer(nWords, hwAddress);
+  if (nWords) WriteTrailer(nWords, hwAddress);
 }
 
 //_____________________________________________________________________________
@@ -305,8 +305,9 @@ void AliAltroBuffer::WriteRCUTrailer(Int_t rcuId)
   
   //  Now the RCU identifier and size of the trailer
   //  FOr the moment the triler size is 2 32-bit words
-  UInt_t buffer = 2;
-  buffer |= ((rcuId & 0x3FF) << 22);
+  UInt_t buffer = (2 & 0x7F);
+  buffer |= ((rcuId & 0x1FF) << 7);
+  buffer |= 0xAAAA << 16;
   fFile->WriteBuffer((char *)(&buffer),sizeof(UInt_t));
 
 }