* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id: AliHLTMUONDigitPublisherComponent.cxx 26179 2008-05-29 22:27:27Z aszostak $ */
+// $Id: AliHLTMUONDigitPublisherComponent.cxx 26179 2008-05-29 22:27:27Z aszostak $
///
/// @file AliHLTMUONDigitPublisherComponent.cxx
#include "AliHLTLogging.h"
#include "AliHLTSystem.h"
#include "AliHLTDefinitions.h"
-#include "AliRawDataHeader.h"
+#include "AliRawDataHeaderV3.h"
#include "AliMUONTrackerDDLDecoderEventHandler.h"
#include "AliMUONConstants.h"
#include "AliMUONMCDataInterface.h"
#include "AliMUONRegHeader.h"
#include "AliRunLoader.h"
#include "AliCentralTrigger.h"
+#include "AliLog.h"
#include <cstring>
#include <cstdlib>
#include <cmath>
/// Returns an estimate of the expected output data size.
// estimated as max number of channels * raw data word size + max headers size.
- constBase = sizeof(AliRawDataHeader) + 65536*sizeof(UInt_t)
+ constBase = sizeof(AliRawDataHeaderV3) + 65536*sizeof(UInt_t)
+ sizeof(AliMUONBlockHeaderStruct)*2 + sizeof(AliMUONDSPHeaderStruct)*10
+ sizeof(AliMUONBusPatchHeaderStruct) * 50;
inputMultiplier = 0;
}
// Make sure we have the correct CTP trigger loaded.
-#ifndef HAVE_NOT_ALIRUNLOADER30859
AliRunLoader* runloader = AliRunLoader::Instance();
-#else
- // the old way before rev 30859
- AliRunLoader *runloader = AliRunLoader::GetRunLoader();
-#endif
if (runloader != NULL)
{
if (runloader->GetTrigger() == NULL)
blockHeader.SetDataKey(blockHeader.GetDefaultDataKey());
dspHeader.SetDataKey(dspHeader.GetDefaultDataKey());
- if (outBufferSize < sizeof(AliRawDataHeader))
+ if (outBufferSize < sizeof(AliRawDataHeaderV3))
{
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
- outBufferSize, sizeof(AliRawDataHeader)
+ outBufferSize, sizeof(AliRawDataHeaderV3)
);
return -ENOBUFS;
}
- AliRawDataHeader* header = reinterpret_cast<AliRawDataHeader*>(outBuffer);
+ AliRawDataHeaderV3* header = reinterpret_cast<AliRawDataHeaderV3*>(outBuffer);
// Fill header with default values.
- *header = AliRawDataHeader();
-#ifndef HAVE_NOT_ALIRUNLOADER30859
+ *header = AliRawDataHeaderV3();
AliRunLoader* runloader = AliRunLoader::Instance();
-#else
- // the old way before rev 30859
- AliRunLoader *runloader = AliRunLoader::GetRunLoader();
-#endif
if (runloader != NULL)
{
if (runloader->GetTrigger() != NULL)
AliCentralTrigger *aCTP = runloader->GetTrigger();
ULong64_t mask = aCTP->GetClassMask();
header->SetTriggerClass(mask);
+ mask = aCTP->GetClassMaskNext50();
+ header->SetTriggerClassNext50(mask);
}
}
Int_t* buffer = reinterpret_cast<Int_t*>(header+1);
- Int_t endOfBuffer = (outBufferSize - sizeof(AliRawDataHeader)) / sizeof(Int_t);
+ Int_t endOfBuffer = (outBufferSize - sizeof(AliRawDataHeaderV3)) / sizeof(Int_t);
// buffer size (max'ed out)
// (((43 manus max per bus patch *64 channels + 4 bus patch words) * 5 bus patch
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
outBufferSize,
- sizeof(AliRawDataHeader) + (index+length)*sizeof(UInt_t)
+ sizeof(AliRawDataHeaderV3) + (index+length)*sizeof(UInt_t)
);
return -ENOBUFS;
}
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
outBufferSize,
- sizeof(AliRawDataHeader) + (index+dspHeaderLength)*sizeof(UInt_t)
+ sizeof(AliRawDataHeaderV3) + (index+dspHeaderLength)*sizeof(UInt_t)
);
return -ENOBUFS;
}
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
outBufferSize,
- sizeof(AliRawDataHeader) + (index+busHeaderLength)*sizeof(UInt_t)
+ sizeof(AliRawDataHeaderV3) + (index+busHeaderLength)*sizeof(UInt_t)
);
return -ENOBUFS;
}
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
outBufferSize,
- sizeof(AliRawDataHeader) + (index+busLength)*sizeof(UInt_t)
+ sizeof(AliRawDataHeaderV3) + (index+busLength)*sizeof(UInt_t)
);
return -ENOBUFS;
}
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
outBufferSize,
- sizeof(AliRawDataHeader) + (index+1)*sizeof(UInt_t)
+ sizeof(AliRawDataHeaderV3) + (index+1)*sizeof(UInt_t)
);
return -ENOBUFS;
}
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
outBufferSize,
- sizeof(AliRawDataHeader) + (index+2)*sizeof(UInt_t)
+ sizeof(AliRawDataHeaderV3) + (index+2)*sizeof(UInt_t)
);
return -ENOBUFS;
}
buffer[index++] = blockHeader.GetDdlDataKey();
totalDDLLength += 2;
- header->fSize = (totalDDLLength) * sizeof(Int_t) + sizeof(AliRawDataHeader);
+ header->fSize = (totalDDLLength) * sizeof(Int_t) + sizeof(AliRawDataHeaderV3);
outBufferSize = header->fSize;
return 0;
AliMpDDLStore* ddlStore = AliMpDDLStore::Instance();
assert(ddlStore != NULL);
- if (outBufferSize < sizeof(AliRawDataHeader))
+ if (outBufferSize < sizeof(AliRawDataHeaderV3))
{
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
- outBufferSize, sizeof(AliRawDataHeader)
+ outBufferSize, sizeof(AliRawDataHeaderV3)
);
return -ENOBUFS;
}
- AliRawDataHeader* header = reinterpret_cast<AliRawDataHeader*>(outBuffer);
+ AliRawDataHeaderV3* header = reinterpret_cast<AliRawDataHeaderV3*>(outBuffer);
// Fill header with default values.
- *header = AliRawDataHeader();
-#ifndef HAVE_NOT_ALIRUNLOADER30859
+ *header = AliRawDataHeaderV3();
AliRunLoader* runloader = AliRunLoader::Instance();
-#else
- // the old way before rev 30859
- AliRunLoader *runloader = AliRunLoader::GetRunLoader();
-#endif
if (runloader != NULL)
{
if (runloader->GetTrigger() != NULL)
UInt_t word;
Int_t* buffer = reinterpret_cast<Int_t*>(header+1);
Int_t index;
- Int_t locCard;
+ //Int_t locCard;
UChar_t locDec, trigY, posY, posX, regOut;
UInt_t regInpLpt;
UInt_t regInpHpt;
}
if(scalarEvent)
{
- if (outBufferSize < sizeof(AliRawDataHeader) + kScalerBufferSize)
+ if (outBufferSize < sizeof(AliRawDataHeaderV3) + kScalerBufferSize)
{
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
- outBufferSize, sizeof(AliRawDataHeader) + kScalerBufferSize
+ outBufferSize, sizeof(AliRawDataHeaderV3) + kScalerBufferSize
);
return -ENOBUFS;
}
}
else
{
- if (outBufferSize < sizeof(AliRawDataHeader) + kBufferSize)
+ if (outBufferSize < sizeof(AliRawDataHeaderV3) + kBufferSize)
{
HLTError("The output buffer size is too small to write output."
" It is only %d bytes, but we need at least %d bytes.",
- outBufferSize, sizeof(AliRawDataHeader) + kBufferSize
+ outBufferSize, sizeof(AliRawDataHeaderV3) + kBufferSize
);
return -ENOBUFS;
}
// crate info
AliMpTriggerCrate* crate = ddlStore->GetTriggerCrate(iDDL, iReg);
- if (!crate)
+ if (!crate)
+ {
AliWarning(Form("Missing crate number %d in DDL %d\n", iReg, iDDL));
-
+ continue;
+ }
+
// regional info tree, make sure that no reg card missing
AliMUONRegionalTrigger* regTrg = triggerStore->FindRegional(crate->GetId());
- if (!regTrg)
+ if (!regTrg)
+ {
AliError(Form("Missing regional board %d in trigger Store\n", crate->GetId()));
-
+ continue;
+ }
+
// Regional card header
word = 0;
if (localBoard->IsNotified()) {// if notified board
AliMUONLocalTrigger* locTrg = triggerStore->FindLocal(localBoardId);
- locCard = locTrg->LoCircuit();
+ //locCard = locTrg->LoCircuit();
locDec = locTrg->GetLoDecision();
trigY = locTrg->LoTrigY();
posY = locTrg->LoStripY();
} // local card
// fill regional header with local output
regHeader.SetInput(regInpHpt, 0);
- regHeader.SetInput(regInpHpt, 1);
+ regHeader.SetInput(regInpLpt, 1);
memcpy(&buffer[indexReg],regHeader.GetHeader(),kRegHeaderLength*4);
} // Regional card
- header->fSize = index * sizeof(Int_t) + sizeof(AliRawDataHeader);
+ header->fSize = index * sizeof(Int_t) + sizeof(AliRawDataHeaderV3);
outBufferSize = header->fSize;
return 0;