]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/test/testAliHLTReadoutList.C
ALIROOT-5420 Missing include
[u/mrichter/AliRoot.git] / HLT / BASE / test / testAliHLTReadoutList.C
index 653aada72174873d830e7526b53501a3bdfee84b..a9151f2765634ea846225585a3aefa613cfc0bef 100644 (file)
@@ -399,7 +399,8 @@ bool CheckIncorrectIDs()
 }
 
 /**
- * Tests if using incorrect DDL IDs returns zero or is ignored as expected.
+ * Tests the mapping of the AliHLTReadoutList::GetFirstWord, AliHLTReadoutList::GetWordCount
+ * and AliHLTReadoutList::GetDetectorFromWord methods.
  */
 bool CheckWordIndexAndCount()
 {
@@ -474,6 +475,23 @@ bool CheckWordIndexAndCount()
                }
        }
        
+       // Check the mapping of GetDetectorFromWord
+       for (int j = 0; j < gkAliHLTDDLListSize; ++j)
+       {
+               AliHLTReadoutList::EDetectorId det = AliHLTReadoutList::GetDetectorFromWord(j);
+               Int_t firstword = AliHLTReadoutList::GetFirstWord(det);
+               Int_t lastword = firstword + AliHLTReadoutList::GetWordCount(det);
+               if (not (firstword <= j and j < lastword))
+               {
+                       cerr << "ERROR: The function AliHLTReadoutList::GetDetectorFromWord returns "
+                               << AliHLTReadoutList::DetectorIdToString(det)
+                               << " for word " << j
+                               << " but the GetFirstWord and GetWordCount methods indicate a different range."
+                               << " The mapping is probably incorrect." << endl;
+                       return false;
+               }
+       }
+       
        return true;
 }