Adding Empty method to readout list to check if it has all DDL bits disabled.
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Feb 2009 13:25:14 +0000 (13:25 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Feb 2009 13:25:14 +0000 (13:25 +0000)
Bug fix for the AliHLTTriggerDecision class to correctly replace the readout list rather than merge it in the setter method.
AliHLTTrigger not using AliHLTTriggerDecision setter method for readout list anymore to keep previous behaviour so that it still merges the readout list.

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

index f60ca204e90fd2fe9d8468a4e8510c71dc7f2407..fac77f4354a91e31bafebc3a5f0fc2152019bdcf 100644 (file)
@@ -139,6 +139,18 @@ AliHLTReadoutList::~AliHLTReadoutList()
 }
 
 
+bool AliHLTReadoutList::Empty() const
+{
+  // Returns true if the readout list has no DDLs enabled.
+
+  for (int i = 0; i < sizeof(fReadoutList.fList) / sizeof(fReadoutList.fList[0]); i++)
+  {
+    if (fReadoutList.fList[i] != 0x0) return false;
+  }
+  return true;
+}
+
+
 bool AliHLTReadoutList::DecodeDDLID(Int_t ddlId, Int_t& wordIndex, Int_t& bitIndex)
 {
   // Decodes the word index and bit index within that word for the readout list structure.
index 6d97d97fca137b77d238fed3d3a98a9e16aeec9f..c6517bfac0efba7e0526479991de643be57ff666 100644 (file)
@@ -104,6 +104,12 @@ class AliHLTReadoutList : public TObject
    */
   virtual ~AliHLTReadoutList();
   
+  /**
+   * Checks if the readout list is empty, i.e. all DDLs are disabled.
+   * \returns true if the readout list is empty and false otherwise.
+   */
+  bool Empty() const;
+  
   /**
    * Enables a specific DDL bit in the readout list.
    * \param ddlId  The ID number of the DDL to enable.
index c08eb2ca064655b2b2c0d6b2aeabc3dee9372da4..f7ef490f864c375353023a4cf1ad98e612343857 100644 (file)
@@ -91,7 +91,8 @@ void AliHLTTrigger::TriggerEvent(bool value)
   
   if (fTriggerEventResult != 0) return;  // Do not do anything if a previous call failed.
   AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fTriggerDomain, fDescription);
-  triggerResult.ReadoutList(fReadoutList);  // Append the readout list if it contains anything.
+  // Append the readout list if it contains anything.
+  triggerResult.TriggerDomain().Add(fReadoutList);
   fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
   if (fTriggerEventResult == 0) fDecisionMade = true;
 }
index e120bc3834811e98326b90c27f04aaa53db40ea4..3b5bd04953b16ed0dfb7aba54f68f86676839930 100644 (file)
@@ -117,7 +117,8 @@ class AliHLTTriggerDecision : public TObject
    */
   void ReadoutList(const AliHLTReadoutList& value)
   {
-    fTriggerDomain |= AliHLTTriggerDomain(value);
+    fTriggerDomain.Remove("DAQRDOUT", kAliHLTDataOriginAny);
+    fTriggerDomain.Add(value);
   }
   
   /**