Skip to content
Snippets Groups Projects
Unverified Commit e72a7541 authored by Nick Draper's avatar Nick Draper Committed by GitHub
Browse files

Merge pull request #28433 from...

Merge pull request #28433 from mantidproject/27146_IndexPeaks_not_indexing_some_peaks_when_CommonUBforAll

Add validation for input CommonUBForAll in IndexPeaks
parents 56c9d2c7 a29fdaf5
No related branches found
No related tags found
No related merge requests found
......@@ -412,6 +412,23 @@ std::map<std::string, std::string> IndexPeaks::validateInputs() {
helpMsgs[Prop::PEAKSWORKSPACE] = exc.what();
}
// get all runs which have peaksin the table
const bool commonUB = this->getProperty(Prop::COMMONUB);
if (commonUB) {
const auto &allPeaks = ws->getPeaks();
std::unordered_map<int, int> peaksPerRun;
auto it = allPeaks.cbegin();
while (peaksPerRun.size() < 2 && it != allPeaks.cend()) {
peaksPerRun[it->getRunNumber()] = 1;
++it;
};
if (peaksPerRun.size() < 2) {
helpMsgs[Prop::COMMONUB] =
"CommonUBForAll can only be True if there are peaks from more "
"than one run present in the peaks worksapce";
};
};
return helpMsgs;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment