diff --git a/Framework/Crystal/src/IndexPeaks.cpp b/Framework/Crystal/src/IndexPeaks.cpp index ed20b30a09a403b06887fcbc1e912b041999b0b4..979ecdc41e4412190858861f8a77218a3b6b3cfc 100644 --- a/Framework/Crystal/src/IndexPeaks.cpp +++ b/Framework/Crystal/src/IndexPeaks.cpp @@ -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 + bool commonUB = this->getProperty(Prop::COMMONUB); + if (commonUB) { + auto &allPeaks = ws->getPeaks(); + std::unordered_map<int, int> peaksPerRun; + auto it = allPeaks.begin(); + while (peaksPerRun.size() < 2 && it != allPeaks.end()) { + 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; }