]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- adding the DAQ readout list block to the output of the trigger component
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 1 Aug 2009 09:45:28 +0000 (09:45 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 1 Aug 2009 09:45:28 +0000 (09:45 +0000)
- adding some comments and documentation in the ReadoutList handler
- copy only the overlapping part of the list from an AliHLTEventDDL block

HLT/BASE/AliHLTReadoutList.cxx
HLT/BASE/AliHLTReadoutList.h
HLT/trigger/AliHLTTrigger.cxx

index bd054c8fbc8ecc3108993c16a07333f7ed0357bc..33ec0215b923a83138cf3861638c89f8ff6cb265 100644 (file)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        *
  * ALICE Experiment at CERN, All rights reserved.                         *
@@ -119,8 +119,10 @@ AliHLTReadoutList::AliHLTReadoutList(const AliHLTEventDDL& list) :
 {
   // Constructor to create readout list from AliHLTEventDDL structure.
   // See header file for more details.
-  
-  memcpy(&fReadoutList, &list, sizeof(fReadoutList));
+  memset(&fReadoutList, 0, sizeof(fReadoutList));
+  // handle lists of different sizes, copy only the overlapping part of the list
+  fReadoutList.fCount=sizeof(fReadoutList.fList)/sizeof(AliHLTUInt32_t);
+  memcpy(&fReadoutList.fList, &list.fList, (fReadoutList.fCount<list.fCount?fReadoutList.fCount:list.fCount)*sizeof(AliHLTUInt32_t));
 }
 
 
@@ -170,26 +172,33 @@ bool AliHLTReadoutList::DecodeDDLID(Int_t ddlId, Int_t& wordIndex, Int_t& bitInd
   
   if (detNum < 3)
   {
+    // the 3 ITS detectors have one word each
     wordIndex = detNum;
   }
   else if (detNum == 3)
   {
+    // the TPC bitfield has in total 8 words
     wordIndex = detNum + (ddlNum >> 5);
   }
   else if (detNum == 4)
   {
+    // the TRD bitfield starts at position 11 (3 ITS + 8 TPC)
     wordIndex = detNum + 7;
   }
   else if (detNum == 5)
   {
+    // TOF has 72 DDLs, the bitfield is 3 words starting at position 12
     wordIndex = detNum + 7 + (ddlNum >> 5);
   }
   else if (detNum == 30)
   {
+    // the HLT bitfield is in the last word 
     wordIndex = 29;
   }
   else
   {
+    // all other detectors fit into one word, the offset is due to
+    // TPC and TOF
     wordIndex = detNum + 9;
   }
   
@@ -406,7 +415,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator |= (const AliHLTReadoutList& list
   // This operator performs a bitwise inclusive or operation on all DDL bits.
   // See header file for more details.
   
-  assert( fReadoutList.fCount == gkAliHLTDDLListSize );
+  assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
   for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
   {
     fReadoutList.fList[i] |= list.fReadoutList.fList[i];
@@ -420,7 +429,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator ^= (const AliHLTReadoutList& list
   // This operator performs a bitwise exclusive or (xor) operation on all DDL bits.
   // See header file for more details.
   
-  assert( fReadoutList.fCount == gkAliHLTDDLListSize );
+  assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
   for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
   {
     fReadoutList.fList[i] ^= list.fReadoutList.fList[i];
@@ -434,7 +443,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator &= (const AliHLTReadoutList& list
   // This operator performs a bitwise and operation on all DDL bits.
   // See header file for more details.
   
-  assert( fReadoutList.fCount == gkAliHLTDDLListSize );
+  assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
   for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
   {
     fReadoutList.fList[i] &= list.fReadoutList.fList[i];
@@ -448,7 +457,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator -= (const AliHLTReadoutList& list
   // This operator removes all the DDLs specified in list from this readout list.
   // See header file for more details.
   
-  assert( fReadoutList.fCount == gkAliHLTDDLListSize );
+  assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
   for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
   {
     // Effectively apply: this = this & (~ (this & list))
index aa125df1e8c755fc6e6cc3782fe47010897d2851..231ac1bdf7a17bfa51512ff5416c4dcd3ff0b22f 100644 (file)
@@ -1,5 +1,5 @@
 //-*- Mode: C++ -*-
-// $Id:$
+// $Id$
 #ifndef ALIHLTREADOUTLIST_H
 #define ALIHLTREADOUTLIST_H
 /* This file is property of and copyright by the ALICE HLT Project        *
@@ -213,6 +213,18 @@ class AliHLTReadoutList : public TObject
    * \return  Reference to the AliHLTEventDDL raw structure.
    */
   operator AliHLTEventDDL& () { return fReadoutList; }
+
+  /**
+   * Access method to the binary buffer.
+   * \return pointer to the binary buffer.
+   */
+  AliHLTEventDDL* Buffer() { return &fReadoutList; }
+
+  /**
+   * Access to the size of the binary buffer.
+   * \return size of the binary buffer
+   */
+  unsigned BufferSize() { return sizeof(fReadoutList); }
   
   /**
    * Assignment operator performs a deep copy.
index bd6ac1521a420cfc1855a1a037b450598b6784c6..1572b8fba064677228ef7ec99f23e5e8c10350fb 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "AliHLTTrigger.h"
 #include "AliHLTTriggerDecision.h"
+#include "AliHLTReadoutList.h"
 
 ClassImp(AliHLTTrigger)
 
@@ -105,9 +106,7 @@ int AliHLTTrigger::TriggerEvent(bool value)
   AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fTriggerDomain, fDescription);
   // Append the readout list if it contains anything.
   triggerResult.TriggerDomain().Add(fReadoutList);
-  fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
-  if (fTriggerEventResult == 0) fDecisionMade = true;
-  return fTriggerEventResult;
+  return TriggerEvent(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
 }
 
 
@@ -121,6 +120,10 @@ int AliHLTTrigger::TriggerEvent(
   
   if (fTriggerEventResult != 0) return fTriggerEventResult;  // Do not do anything if a previous call failed.
   fTriggerEventResult = PushBack(result, type, spec);
+  if (fTriggerEventResult) {
+    fTriggerEventResult = PushBack(result->ReadoutList().Buffer(), result->ReadoutList().BufferSize(), kAliHLTDataTypeDAQRDOUT|kAliHLTDataOriginOut);
+  }
+  
   if (fTriggerEventResult == 0) fDecisionMade = true;
   return fTriggerEventResult;
 }