X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FBASE%2Ftest%2FtestAliHLTReadoutList.C;h=a9151f2765634ea846225585a3aefa613cfc0bef;hb=91bf4f1de17e253a52c6b560e1ccc6a9e3a3569c;hp=653aada72174873d830e7526b53501a3bdfee84b;hpb=89413559ff40587d75db33204f5a9f46db932813;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/BASE/test/testAliHLTReadoutList.C b/HLT/BASE/test/testAliHLTReadoutList.C index 653aada7217..a9151f27656 100644 --- a/HLT/BASE/test/testAliHLTReadoutList.C +++ b/HLT/BASE/test/testAliHLTReadoutList.C @@ -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; }