X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliAltroBuffer.cxx;h=815cfd67b0e7cc7d4d5af5cbe7f32144135fbf25;hb=21027e5afdb5304e1169e10de425f826d556d368;hp=560c27935f971c7d599a1ca02e934690cf811a57;hpb=94b2b783a6066d5b9029a67b6d138af967582d28;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliAltroBuffer.cxx b/RAW/AliAltroBuffer.cxx index 560c27935f9..815cfd67b0e 100644 --- a/RAW/AliAltroBuffer.cxx +++ b/RAW/AliAltroBuffer.cxx @@ -232,10 +232,10 @@ Int_t AliAltroBuffer::WriteBunch(Int_t nTimeBins, const Int_t* adcValues, } //_____________________________________________________________________________ -void AliAltroBuffer::WriteDataHeader(Bool_t dummy, Bool_t compressed) +void AliAltroBuffer::WriteDataHeader(Bool_t dummy, Bool_t /*compressed*/) { //Write a (dummy or real) DDL data header, -//set the compression bit if compressed +//set the attributes according to the RCU version AliRawDataHeaderSim header; if (dummy) { @@ -243,20 +243,18 @@ void AliAltroBuffer::WriteDataHeader(Bool_t dummy, Bool_t compressed) fDataHeaderPos = fFile->Tellp(); fFile->WriteBuffer((char*)(&header), sizeof(header)); } else { - WriteRCUTrailer(0); + UChar_t rcuVer = WriteRCUTrailer(0); UInt_t currentFilePos = fFile->Tellp(); fFile->Seekp(fDataHeaderPos); header.fSize = 0xFFFFFFFF; // RCU can't write raw-data size so we always get an 'invalid' size field - // header.fSize = currentFilePos-fDataHeaderPos; - header.SetAttribute(0); // valid data - if (compressed) header.SetAttribute(1); + header.fAttributesSubDetectors |= (rcuVer << 24); fFile->WriteBuffer((char*)(&header), sizeof(header)); fFile->Seekp(currentFilePos); } } //_____________________________________________________________________________ -void AliAltroBuffer::WriteRCUTrailer(Int_t rcuId) +UChar_t AliAltroBuffer::WriteRCUTrailer(Int_t rcuId) { // Writes the RCU trailer // rcuId the is serial number of the corresponding @@ -267,11 +265,11 @@ void AliAltroBuffer::WriteRCUTrailer(Int_t rcuId) UInt_t currentFilePos = fFile->Tellp(); UInt_t size = currentFilePos-fDataHeaderPos; - size -= sizeof(AliRawDataHeader); + size -= sizeof(AliRawDataHeaderV3); if ((size % 5) != 0) { AliFatal(Form("The current raw data payload is not a mutiple of 5 (%d) ! Can not write the RCU trailer !",size)); - return; + return 0; } // Now put the size in unit of number of 40bit words @@ -289,7 +287,8 @@ void AliAltroBuffer::WriteRCUTrailer(Int_t rcuId) // FOr the moment the triler size is 2 32-bit words UInt_t buffer = (2 & 0x7F); buffer |= ((rcuId & 0x1FF) << 7); - buffer |= 0xAAAA << 16; + buffer |= 0xAAAAU << 16; fFile->WriteBuffer((char *)(&buffer),sizeof(UInt_t)); + return 0; }