]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bugfix: generating the event done data filter list correctly. The number of entries
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Aug 2009 10:49:55 +0000 (10:49 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Aug 2009 10:49:55 +0000 (10:49 +0000)
was set to the total number of domain entries, while some of them are filtered out.

HLT/trigger/AliHLTTrigger.cxx

index 5ea977fe27ebd04bbde1e6c02843b6dd4c9e8895..e911c62a30a3666a83bb385b5ff24e4adad0d4ac 100644 (file)
@@ -159,13 +159,13 @@ int AliHLTTrigger::CreateEventDoneReadoutFilter(const AliHLTTriggerDomain& domai
 {
   // add a readout filter to the EventDoneData
   int iResult=0;
-  unsigned entries=domain.GetNofEntries();
+  unsigned nofEntries=domain.GetNofEntries();
   // we need:
   //   1 word eventually for the monitor event command
   //   1 word for the readout filter command
   //   1 word for the readout filter size
   // 4*n words for the filter list
-  if ((iResult=ReserveEventDoneData((entries*4 + 3) * sizeof(AliHLTUInt32_t)))<0) return iResult;
+  if ((iResult=ReserveEventDoneData((nofEntries*4 + 3) * sizeof(AliHLTUInt32_t)))<0) return iResult;
   AliHLTUInt32_t eddbuffer[4];
   if (type==4) {
     // in the case of the monitoring filter we also add the monitor event command
@@ -176,17 +176,25 @@ int AliHLTTrigger::CreateEventDoneReadoutFilter(const AliHLTTriggerDomain& domai
   // now the readout list command and the block count
   eddbuffer[0]=type;
   if ((iResult=PushEventDoneData(eddbuffer[0]))<0) return iResult;
-  eddbuffer[0]=entries;
-  if ((iResult=PushEventDoneData(eddbuffer[0]))<0) return iResult;
 
-  for (unsigned block=0; block<entries; block++) {
+  // find the valid entries
+  unsigned block=0;
+  vector<const AliHLTDomainEntry*> entries;
+  for (block=0; block<nofEntries; block++) {
     // skip all DAQ readout entries as they are handled by the readout list
     if (domain[block]==AliHLTDomainEntry(kAliHLTDataTypeDAQRDOUT)) continue;
     if (domain[block].Exclusive()) {
       HLTWarning("exclusive trigger domain entries are currently not handled, skipping entry %s", domain[block].AsString().Data());
       continue;
     }
-    domain[block].AsBinary(eddbuffer);
+    entries.push_back(&(domain[block]));
+  }
+  eddbuffer[0]=entries.size();
+  if ((iResult=PushEventDoneData(eddbuffer[0]))<0) return iResult;
+
+  for (vector<const AliHLTDomainEntry*>::iterator entry=entries.begin();
+       entry!=entries.end(); entry++) {
+    (*entry)->AsBinary(eddbuffer);
     for (int n=0; n<4; n++)
       if ((iResult=PushEventDoneData(eddbuffer[n]))<0) return iResult;
   }