ClassImp(AliMUONDarcHeader)
/// \endcond
- const Int_t AliMUONDarcHeader::fgkHeaderLength = 8;
- const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 6;
+ const Int_t AliMUONDarcHeader::fgkDarcHeaderLength = 1;
+ const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength = 5;
+ const Int_t AliMUONDarcHeader::fgkDarcScalerLength = 6;
const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
const UInt_t AliMUONDarcHeader::fgkEndOfDarc = 0xDEADFACE;
void SetGlobalInput(Int_t in, Int_t n) {fGlobalInput[n] = in;}
void SetGlobalOutput(Int_t out) {fGlobalOutput = out;}
- Int_t GetHeaderLength() const {return fgkHeaderLength;}
+ Int_t GetDarcHeaderLength() const {return fgkDarcHeaderLength;}
+ Int_t GetGlobalHeaderLength() const {return fgkGlobalHeaderLength;}
UInt_t* GetHeader() {return &fWord;}
Int_t* GetGlobalInput() {return &fGlobalInput[0];}
Int_t fGlobalInput[4]; ///< global input
Int_t fGlobalOutput; ///< global ouput
- static const Int_t fgkHeaderLength; ///< header length
+ static const Int_t fgkDarcHeaderLength; ///< darc header length
+ static const Int_t fgkGlobalHeaderLength; ///< global header length
// global card scalers
//______________________________________________________
Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
{
- // reading tracker DDL
- // store buspatch info into Array
- // store only non-empty structures (buspatch info with datalength !=0)
+ // decode trigger DDL
+ // store only non-empty structures (TrigY ==0)
// reading DDL for trigger
AliMUONDarcHeader* darcHeader = fDDLTrigger->GetDarcHeader();
- Int_t kDarcHeaderSize = darcHeader->GetHeaderLength();
- Int_t kRegHeaderSize = fRegHeader->GetHeaderLength() ;
- Bool_t scalerEvent = kFALSE;
+ static Int_t kGlobalHeaderSize = darcHeader->GetGlobalHeaderLength();
+ static Int_t kDarcHeaderSize = darcHeader->GetDarcHeaderLength();
+ static Int_t kRegHeaderSize = fRegHeader->GetHeaderLength();
+
+ Bool_t scalerEvent = kFALSE;
Int_t index = 0;
- darcHeader->SetWord(buffer[index++]);
+
+ memcpy(darcHeader->GetHeader(), &buffer[index], (kDarcHeaderSize)*4);
+ index += kDarcHeaderSize;
if(darcHeader->GetEventType() == 2) {
scalerEvent = kTRUE;
AliWarning(Form("Wrong end of Darc word %x instead of %x\n",buffer[index-1], darcHeader->GetEndOfDarc()));
// 4 words of global board input + Global board output
- memcpy(darcHeader->GetGlobalInput(), &buffer[index], (kDarcHeaderSize-1)*4);
- index += kDarcHeaderSize- 1; // kind tricky cos scaler info in-between Darc header
+ memcpy(darcHeader->GetGlobalInput(), &buffer[index], (kGlobalHeaderSize)*4);
+ index += kGlobalHeaderSize;
if(scalerEvent) {
// 10 Global scaler words
}
if (buffer[index++] != darcHeader->GetEndOfGlobal())
- AliWarning(Form("Wrong end of Global word %d instead of %d\n",buffer[index-1], darcHeader->GetEndOfGlobal()));
+ AliWarning(Form("Wrong end of Global word %x instead of %x\n",buffer[index-1], darcHeader->GetEndOfGlobal()));
// 8 regional boards
for (Int_t iReg = 0; iReg < fMaxReg; iReg++) { //loop over regeonal card
AliBitPacking::PackWord((UInt_t)globalFlag,word,8,11);
fDarcHeader->SetWord(word);
- buffer[index++] = word;
+
+ memcpy(&buffer[index], fDarcHeader->GetHeader(), (fDarcHeader->GetDarcHeaderLength())*4);
+ index += fDarcHeader->GetDarcHeaderLength();
if (iDDL == 0)
fDarcHeader->SetGlobalOutput(gloTrigPat);// no global input for the moment....
buffer[index++] = fDarcHeader->GetEndOfDarc();
// 4 words of global board input + Global board output
- memcpy(&buffer[index], fDarcHeader->GetGlobalInput(), (fDarcHeader->GetHeaderLength()-1)*4);
- index += fDarcHeader->GetHeaderLength() - 1; // kind tricky cos scaler info in-between Darc header
+ memcpy(&buffer[index], fDarcHeader->GetGlobalInput(), (fDarcHeader->GetGlobalHeaderLength())*4);
+ index += fDarcHeader->GetGlobalHeaderLength();
if (fScalerEvent) {
// 10 Global scaler words