diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h b/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h index 967087d773d14c57bb3f792fa69caea4317f80ee..f60a710f68a21cbe751c55ed16573c1e020bd342 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h @@ -63,10 +63,10 @@ private: API::MatrixWorkspace_sptr squash(const API::MatrixWorkspace_sptr &ws, const API::ITableWorkspace_sptr &phase, const std::vector<double> &n0); - size_t findName(const std::string pattern, const std::vector<std::string> &names); + int findName(const std::string pattern, const std::vector<std::string> &names); }; } // namespace Algorithms } // namespace Mantid -#endif /*MANTID_ALGORITHM_PHASEQUAD_H_*/ \ No newline at end of file +#endif /*MANTID_ALGORITHM_PHASEQUAD_H_*/ diff --git a/Framework/Algorithms/src/PhaseQuadMuon.cpp b/Framework/Algorithms/src/PhaseQuadMuon.cpp index da6db27257ab8b49221fcd9bdd01b886131e0625..43d9a5ab1de85ec9d4c56763c6caa28aff558d0c 100644 --- a/Framework/Algorithms/src/PhaseQuadMuon.cpp +++ b/Framework/Algorithms/src/PhaseQuadMuon.cpp @@ -128,14 +128,14 @@ std::map<std::string, std::string> PhaseQuadMuon::validateInputs() { return result; } -size_t PhaseQuadMuon::findName(const std::string pattern, const std::vector<std::string> &names) { +int PhaseQuadMuon::findName(const std::string pattern, const std::vector<std::string> &names) { auto it = std::find_if(names.begin(), names.end(), [pattern](const std::string& s) { if (s == pattern) { return true; } else { return false; } }); if (it == names.end()) { return -1; } - return std::distance(names.begin(), it); + return static_cast<int>(std::distance(names.begin(), it)); } diff --git a/Framework/Algorithms/test/PhaseQuadMuonTest.h b/Framework/Algorithms/test/PhaseQuadMuonTest.h index 005d3b233609841b102baf6a82b1fa822371295c..b19308f1dd8d18552cdae7d80dd9f0663a5f8aa0 100644 --- a/Framework/Algorithms/test/PhaseQuadMuonTest.h +++ b/Framework/Algorithms/test/PhaseQuadMuonTest.h @@ -13,10 +13,10 @@ using namespace Mantid::DataObjects; using namespace Mantid::API; namespace { -void populatePhaseTable(ITableWorkspace_sptr phaseTable) { - phaseTable->addColumn("int", "DetectorID"); - phaseTable->addColumn("double", "DetectorAsymmetry"); - phaseTable->addColumn("double", "DetectorPhase"); +void populatePhaseTable(ITableWorkspace_sptr phaseTable, std::vector<std::string> names) { + phaseTable->addColumn("int", names[0]); + phaseTable->addColumn("double", names[1]); + phaseTable->addColumn("double",names[2]); for (int i = 0; i < 16; i++) { TableRow phaseRow1 = phaseTable->appendRow(); phaseRow1 << i << 1. << 0.; @@ -24,7 +24,9 @@ void populatePhaseTable(ITableWorkspace_sptr phaseTable) { phaseRow2 << i << 1. << 1.57; } } - +void populatePhaseTable(ITableWorkspace_sptr phaseTable) { + populatePhaseTable(phaseTable,{"DetectorID", "Asymmetry", "Phase"}); +} IAlgorithm_sptr setupAlg(MatrixWorkspace_sptr inputWs, bool isChildAlg) { // Create and populate a detector table boost::shared_ptr<ITableWorkspace> phaseTable( @@ -103,6 +105,17 @@ public: TS_ASSERT_DELTA(specImE[20], 0.0031, 0.0001); TS_ASSERT_DELTA(specImE[50], 0.0035, 0.0001); } + // add test for no phase + + // add test for no asymm + + // add test for two phase + + // add test for two asymm + + // add test for different order + + }; class PhaseQuadMuonTestPerformance : public CxxTest::TestSuite {