fSearchDataType=dt;
if (classname) fClassName=classname;
else fClassName.clear();
- int idx=FindInputBlock(fSearchDataType, 0);
+ int idx=FindInputBlock(fSearchDataType, 0, 1);
HLTDebug("found block %d when searching for data type %s", idx, DataType2Text(dt).c_str());
TObject* pObj=NULL;
if (idx>=0) {
{
// see header file for function documentation
ALIHLTCOMPONENT_BASE_STOPWATCH();
- int idx=FindInputBlock(fSearchDataType, fCurrentInputBlock+1);
+ int idx=FindInputBlock(fSearchDataType, fCurrentInputBlock+1, 1);
//HLTDebug("found block %d when searching for data type %s", idx, DataType2Text(fSearchDataType).c_str());
TObject* pObj=NULL;
if (idx>=0) {
return pObj;
}
-int AliHLTComponent::FindInputBlock(const AliHLTComponentDataType& dt, int startIdx) const
+int AliHLTComponent::FindInputBlock(const AliHLTComponentDataType& dt, int startIdx, int bObject) const
{
// see header file for function documentation
int iResult=-ENOENT;
if (fpInputBlocks!=NULL) {
int idx=startIdx<0?0:startIdx;
for ( ; (UInt_t)idx<fCurrentEventData.fBlockCnt && iResult==-ENOENT; idx++) {
+ if (bObject!=0) {
+ if (fpInputBlocks[idx].fPtr==NULL) continue;
+ AliHLTUInt32_t firstWord=*((AliHLTUInt32_t*)fpInputBlocks[idx].fPtr);
+ if (firstWord!=fpInputBlocks[idx].fSize-sizeof(AliHLTUInt32_t)) continue;
+ }
if (dt == kAliHLTAnyDataType || fpInputBlocks[idx].fDataType == dt) {
iResult=idx;
}
HLTDebug("object %p type %s created", pObj, objclass->GetName());
} else {
}
- } else {
- // } else if (bForce!=0) {
+ //} else {
+ } else if (bForce!=0) {
HLTError("size missmatch: block size %d, indicated %d", fpInputBlocks[idx].fSize, firstWord+sizeof(AliHLTUInt32_t));
}
} else {
if (idx>=0) {
// check for fpInputBlocks pointer done in FindInputBlock
pBlock=&fpInputBlocks[idx];
+ fCurrentInputBlock=idx;
}
return pBlock;
}
if (idx>=0) {
// check for fpInputBlocks pointer done in FindInputBlock
pBlock=&fpInputBlocks[idx];
+ fCurrentInputBlock=idx;
}
return pBlock;
}
/**
* Find the first input block of specified data type beginning at index.
+ * Input blocks containing a TObject have the size of the object as an
+ * unsigned 32 bit number in the first 4 bytes. This has to match the block
+ * size minus 4.
* @param dt data type
* @param startIdx index to start the search
+ * @param bObject check if this is an object
* @return index of the block, -ENOENT if no block found
*
* @internal
*/
- int FindInputBlock(const AliHLTComponentDataType& dt, int startIdx=-1) const;
+ int FindInputBlock(const AliHLTComponentDataType& dt, int startIdx=-1, int bObject=0) const;
/**
* Get index in the array of input bocks.