Skip to content

Commit

Permalink
Use FakeMD helper in MDEventsTestHelper instead of algorithm
Browse files Browse the repository at this point in the history
Refs #11497
  • Loading branch information
martyngigg committed Apr 8, 2015
1 parent 7184566 commit d3b8438
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp
Expand Up @@ -11,6 +11,7 @@
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/MatrixWorkspace.h"

#include "MantidDataObjects/FakeMD.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/MDEventWorkspace.h"

Expand Down Expand Up @@ -131,16 +132,15 @@ createDiffractionEventWorkspace(int numEvents, int numPixels, int numBins) {
MDEventWorkspace3Lean::sptr makeFakeMDEventWorkspace(const std::string &wsName,
long numEvents, Kernel::SpecialCoordinateSystem coord) {
// ---------- Make a file-backed MDEventWorkspace -----------------------
std::string snEvents = boost::lexical_cast<std::string>(numEvents);
MDEventWorkspace3Lean::sptr ws1 =
MDEventsTestHelper::makeMDEW<3>(10, 0.0, 10.0, 0);
ws1->setCoordinateSystem(coord);
ws1->getBoxController()->setSplitThreshold(100);
API::AnalysisDataService::Instance().addOrReplace(
wsName, boost::dynamic_pointer_cast<Mantid::API::IMDEventWorkspace>(ws1));
FrameworkManager::Instance().exec("FakeMDEventData", 6, "InputWorkspace",
wsName.c_str(), "UniformParams",
snEvents.c_str(), "RandomizeSignal", "1");
FakeMD dataFaker(std::vector<double>(1, static_cast<double>(numEvents)),
std::vector<double>(), 0, true);
dataFaker.fill(ws1);
return boost::dynamic_pointer_cast<MDEventWorkspace3Lean>(
API::AnalysisDataService::Instance().retrieve(wsName));
}
Expand Down

0 comments on commit d3b8438

Please sign in to comment.