Skip to content
Snippets Groups Projects
Commit cd25aa64 authored by Anthony Lim's avatar Anthony Lim
Browse files

refs #20714 made some notes in test

parent e07ad5f7
No related merge requests found
......@@ -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_*/
......@@ -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));
}
......
......@@ -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 {
......
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