int AliHLTComponent::Init( AliHLTComponentEnvironment* environ, void* environParam, int argc, const char** argv )
{
// see header file for function documentation
+ HLTLogKeyword(GetComponentID());
int iResult=0;
if (environ) {
memcpy(&fEnvironment, environ, sizeof(AliHLTComponentEnvironment));
int AliHLTComponent::Deinit()
{
// see header file for function documentation
+ HLTLogKeyword(GetComponentID());
int iResult=0;
iResult=DoDeinit();
if (fpRunDesc) {
{
// see header file for function documentation
int iResult=0;
- if (cdbPath, pHandler) {
+ if (cdbPath && pHandler) {
// I have to think about separating the library handling from the
// component handler. Requiring the component hanlder here is not
// the cleanest solution.
int AliHLTComponent::DoInit( int /*argc*/, const char** /*argv*/)
{
// default implementation, childs can overload
+ HLTLogKeyword("dummy");
return 0;
}
int AliHLTComponent::DoDeinit()
{
// default implementation, childs can overload
+ HLTLogKeyword("dummy");
return 0;
}
int AliHLTComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/)
{
// default implementation, childs can overload
+ HLTLogKeyword("dummy");
+ return 0;
+}
+
+int AliHLTComponent::ReadPreprocessorValues(const char* /*modules*/)
+{
+ // default implementation, childs can overload
+ HLTLogKeyword("dummy");
return 0;
}
return iResult;
}
-void AliHLTComponent::PrintDataTypeContent(AliHLTComponentDataType& dt, const char* format) const
+void AliHLTComponent::PrintDataTypeContent(AliHLTComponentDataType& dt, const char* format)
{
// see header file for function documentation
- const char* fmt="publisher \'%s\'";
+ const char* fmt="\'%s\'";
if (format) fmt=format;
- HLTMessage(fmt, (DataType2Text(dt)).c_str());
- HLTMessage("%x %x %x %x %x %x %x %x : %x %x %x %x",
- dt.fID[0],
- dt.fID[1],
- dt.fID[2],
- dt.fID[3],
- dt.fID[4],
- dt.fID[5],
- dt.fID[6],
- dt.fID[7],
- dt.fOrigin[0],
- dt.fOrigin[1],
- dt.fOrigin[2],
- dt.fOrigin[3]);
+ AliHLTLogging::Message(NULL, kHLTLogNone, NULL , NULL, Form(fmt, (DataType2Text(dt)).c_str()));
+ AliHLTLogging::Message(NULL, kHLTLogNone, NULL , NULL,
+ Form("%x %x %x %x %x %x %x %x : %x %x %x %x",
+ dt.fID[0],
+ dt.fID[1],
+ dt.fID[2],
+ dt.fID[3],
+ dt.fID[4],
+ dt.fID[5],
+ dt.fID[6],
+ dt.fID[7],
+ dt.fOrigin[0],
+ dt.fOrigin[1],
+ dt.fOrigin[2],
+ dt.fOrigin[3]));
}
void AliHLTComponent::FillBlockData( AliHLTComponentBlockData& blockData )
}
}
+void AliHLTComponent::SetDataType(AliHLTComponentDataType& dt, AliHLTUInt64_t id, AliHLTUInt32_t origin)
+{
+ // see header file for function documentation
+ dt.fStructSize=sizeof(AliHLTComponentDataType);
+ assert(kAliHLTComponentDataTypefIDsize==sizeof(id));
+ assert(kAliHLTComponentDataTypefOriginSize==sizeof(origin));
+ memcpy(&dt.fID, &id, kAliHLTComponentDataTypefIDsize);
+ memcpy(&dt.fOrigin, &origin, kAliHLTComponentDataTypefOriginSize);
+}
+
void AliHLTComponent::FillEventData(AliHLTComponentEventData& evtData)
{
// see header file for function documentation
}
//} else {
} else if (bForce!=0) {
- HLTError("size missmatch: block size %d, indicated %d", fpInputBlocks[idx].fSize, firstWord+sizeof(AliHLTUInt32_t));
+ HLTError("size mismatch: block size %d, indicated %d", fpInputBlocks[idx].fSize, firstWord+sizeof(AliHLTUInt32_t));
}
} else {
HLTFatal("block descriptor empty");
{
// see header file for function documentation
ALIHLTCOMPONENT_BASE_STOPWATCH();
- assert( 0 <= index and index < fCurrentEventData.fBlockCnt );
+ assert( 0 <= index and index < (int)fCurrentEventData.fBlockCnt );
return &fpInputBlocks[index];
}
AliHLTComponentEventDoneData*& edd )
{
// see header file for function documentation
+ HLTLogKeyword(GetComponentID());
ALIHLTCOMPONENT_BASE_STOPWATCH();
int iResult=0;
fCurrentEvent=evtData.fEventID;
fOutputBufferFilled=0;
fOutputBlocks.clear();
+ bool bSkipDataProcessing=false;
// find special events
if (fpInputBlocks) {
// first look for all special events and execute in the appropriate
// sequence afterwords
+ AliHLTUInt32_t eventType=gkAliEventTypeUnknown;
int indexComConfEvent=-1;
+ int indexUpdtDCSEvent=-1;
int indexSOREvent=-1;
int indexEOREvent=-1;
for (unsigned int i=0; i<evtData.fBlockCnt && iResult>=0; i++) {
// this event is most likely deprecated
} else if (fpInputBlocks[i].fDataType==kAliHLTDataTypeComConf) {
indexComConfEvent=i;
+ } else if (fpInputBlocks[i].fDataType==kAliHLTDataTypeUpdtDCS) {
+ indexUpdtDCSEvent=i;
+ } else if (fpInputBlocks[i].fDataType==kAliHLTDataTypeEvent) {
+ eventType=fpInputBlocks[i].fSpecification;
+ bSkipDataProcessing|=(fpInputBlocks[i].fSpecification==gkAliEventTypeConfiguration);
+ bSkipDataProcessing|=(fpInputBlocks[i].fSpecification==gkAliEventTypeReadPreprocessor);
}
}
if (indexSOREvent>=0) {
AliHLTRunDesc rundesc;
if ((iResult=CopyStruct(&rundesc, sizeof(AliHLTRunDesc), indexEOREvent, "AliHLTRunDesc", "SOR"))>0) {
if (fpRunDesc->fRunNo!=rundesc.fRunNo) {
- HLTWarning("run no missmatch: SOR %d, EOR %d", fpRunDesc->fRunNo, rundesc.fRunNo);
+ HLTWarning("run no mismatch: SOR %d, EOR %d", fpRunDesc->fRunNo, rundesc.fRunNo);
} else {
HLTDebug("EOR run no %d", fpRunDesc->fRunNo);
}
HLTWarning("did not receive SOR, ignoring EOR");
}
}
- if (indexComConfEvent>=0) {
+ if (indexComConfEvent>=0 || eventType==gkAliEventTypeConfiguration) {
TString cdbEntry;
- if (fpInputBlocks[indexComConfEvent].fPtr!=NULL && fpInputBlocks[indexComConfEvent].fSize>0) {
+ if (indexComConfEvent>=0 && fpInputBlocks[indexComConfEvent].fPtr!=NULL && fpInputBlocks[indexComConfEvent].fSize>0) {
cdbEntry.Append(reinterpret_cast<const char*>(fpInputBlocks[indexComConfEvent].fPtr), fpInputBlocks[indexComConfEvent].fSize);
}
HLTDebug("received component configuration command: entry %s", cdbEntry.IsNull()?"none":cdbEntry.Data());
HLTWarning("reconfiguration of component %p (%s) failed with error code %d", this, GetComponentID(), tmpResult);
}
}
+ if (indexUpdtDCSEvent>=0 || eventType==gkAliEventTypeReadPreprocessor) {
+ TString modules;
+ if (fpInputBlocks[indexUpdtDCSEvent].fPtr!=NULL && fpInputBlocks[indexUpdtDCSEvent].fSize>0) {
+ modules.Append(reinterpret_cast<const char*>(fpInputBlocks[indexUpdtDCSEvent].fPtr), fpInputBlocks[indexUpdtDCSEvent].fSize);
+ }
+ HLTDebug("received preprocessor update command: detectors %s", modules.IsNull()?"ALL":modules.Data());
+ int tmpResult=ReadPreprocessorValues(modules[0]==0?"ALL":modules.Data());
+ if (tmpResult<0) {
+ HLTWarning("preprocessor update of component %p (%s) failed with error code %d", this, GetComponentID(), tmpResult);
+ }
+ }
}
AliHLTComponentBlockDataList blockData;
ALIHLTCOMPONENT_DA_STOPWATCH();
iResult=DoProcessing(evtData, blocks, trigData, outputPtr, size, blockData, edd);
} // end of the scope of the stopwatch guard
- if (iResult>=0) {
+ if (iResult>=0 && !bSkipDataProcessing) {
if (fOutputBlocks.size()>0) {
//HLTDebug("got %d block(s) via high level interface", fOutputBlocks.size());
HLTFatal("component %s (%p): can not convert output block descriptor list", GetComponentID(), this);
}
}
- if (iResult<0) {
+ if (iResult<0 || bSkipDataProcessing) {
outputBlockCnt=0;
outputBlocks=NULL;
}
CleanupInputObjects();
- if (iResult>=0) {
+ if (iResult>=0 && !bSkipDataProcessing) {
IncrementEventCounter();
}
return iResult;
if (fpInputBlocks[iBlockNo].fPtr && fpInputBlocks[iBlockNo].fSize) {
AliHLTUInt32_t copy=*((AliHLTUInt32_t*)fpInputBlocks[iBlockNo].fPtr);
if (fpInputBlocks[iBlockNo].fSize!=copy) {
- HLTWarning("%s event: missmatch of block size (%d) and structure size (%d)", eventname, fpInputBlocks[iBlockNo].fSize, copy);
+ HLTWarning("%s event: mismatch of block size (%d) and structure size (%d)", eventname, fpInputBlocks[iBlockNo].fSize, copy);
if (copy>fpInputBlocks[iBlockNo].fSize) copy=fpInputBlocks[iBlockNo].fSize;
}
if (copy!=iStructSize) {
- HLTWarning("%s event: missmatch in %s version (data type version %d)", eventname, structname, ALIHLT_DATA_TYPES_VERSION);
+ HLTWarning("%s event: mismatch in %s version (data type version %d)", eventname, structname, ALIHLT_DATA_TYPES_VERSION);
if (copy>iStructSize) {
copy=iStructSize;
} else {