]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/rec/AliHLTOUTHomerCollection.cxx
activating individual HLT simulations from digits and raw data
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTOUTHomerCollection.cxx
index f6c9f189cfa5f1e7fc6cefa516753d6f695397f4..323ae6ddcd2de12d79acdf9c105f7120ae300d0e 100644 (file)
@@ -69,7 +69,7 @@ int AliHLTOUTHomerCollection::GenerateIndex()
     // and from v4-10-Release (Rev-02). For the moment we select directly
     // to support older AliRoot versions
     //Select("HLT");
-    SelectEquipment(0,7680, 7689);
+    SelectEquipment(-1,7680, 7689);
     UChar_t* pSrc=NULL;
     while (ReadNextData(pSrc) && pSrc!=NULL && iResult>=0) {
       AliHLTUInt32_t id=(GetEquipmentId());
@@ -148,9 +148,12 @@ AliHLTHOMERReader* AliHLTOUTHomerCollection::OpenReader(UChar_t* pSrc, unsigned
   AliHLTOUTEventHeader* pHLTHeader=reinterpret_cast<AliHLTOUTEventHeader*>(pSrc);
 
   // consistency check for the block size
-  if (pHLTHeader->fLength!=size) {
-    HLTWarning("can not treat HLT data block %d: size mismatch, header %d, but buffer is %d", id, pHLTHeader->fLength, size);
+  if (pHLTHeader->fLength>size) {
+    HLTError("can not treat HLT data block %d: size mismatch, header %d, but buffer is %d", id, pHLTHeader->fLength, size);
     return NULL;
+  } else if (pHLTHeader->fLength<size-3) {
+    // data payload is aligned to 32bit, so there can be a difference by at most 3 bytes
+    HLTWarning("size mismatch in HLT data block %d: header %d, but buffer is %d", id, pHLTHeader->fLength, size);
   }
 
   // determine the offset of the homer block
@@ -175,7 +178,7 @@ AliHLTHOMERReader* AliHLTOUTHomerCollection::OpenReader(UChar_t* pSrc, unsigned
   if (!(statusFlags&(0x1<<kCDHFlagsHLTPayload))) return NULL;
 
   // continue if there is no data left in the buffer
-  if (offset>=size) {
+  if (offset>=pHLTHeader->fLength) {
     HLTWarning("no HLT payload available, but bit is set, skipping ...");
     return NULL;
   }
@@ -188,7 +191,11 @@ AliHLTHOMERReader* AliHLTOUTHomerCollection::OpenReader(UChar_t* pSrc, unsigned
     return NULL;
   }
 
-  return fpManager->OpenReaderBuffer(pSrc+offset, size-offset);
+  AliHLTUInt64_t eventId=pHLTHeader->fEventIDHigh;
+  eventId = eventId<<32;
+  eventId|=pHLTHeader->fEventIDLow;
+  SetEventId(eventId);
+  return fpManager->OpenReaderBuffer(pSrc+offset, pHLTHeader->fLength-offset);
 }
 
 int AliHLTOUTHomerCollection::WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd) const