Mantid
Loading...
Searching...
No Matches
CreateMD.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
10#include "MantidAPI/Run.h"
11#include "MantidAPI/Sample.h"
16#include <Poco/Path.h>
17
18#include <utility>
19
20using namespace Mantid::Kernel;
21using namespace Mantid::API;
22using namespace Mantid::DataObjects;
23
24namespace Mantid::MDAlgorithms {
25
28
29// Box manager parameters for child algorithms
30static const std::string SPLITINTO("2");
31static const std::string SPLITTHRESHOLD("500");
32static const std::string MAXRECURSIONDEPTH("20");
33
34/*
35 * Pad the vector of parameter values to the same size as data sources
36 *
37 * @param param_vector :: a vector of parameter values to pad
38 * @param grow_to_size :: the parameter vector will be padded to this size
39 */
40void padParameterVector(std::vector<double> &param_vector, const size_t grow_to_size) {
41 if (param_vector.empty()) {
42 param_vector.resize(grow_to_size, 0.0);
43 } else if (param_vector.size() == 1) {
44 param_vector.resize(grow_to_size, param_vector[0]);
45 } else if (param_vector.size() != grow_to_size) {
46 throw std::invalid_argument("Psi, Gl, Gs and EFix must have one value per run.");
47 }
48}
49
50/*
51 * Returns true if any of the vectors in params are not empty
52 *
53 * @param params :: a vector of vectors of parameters
54 * @returns true if any the vectors of parameters contain one or more values
55 */
56bool any_given(const std::vector<std::vector<double>> &params) {
57 std::vector<double> param;
58 for (const auto &iter : params) {
59 param = iter;
60 if (!param.empty()) {
61 return true;
62 }
63 }
64 return false;
65}
66
67/*
68 * Returns true if all of the vectors in params are not empty
69 *
70 * @param params :: a vector of vectors of parameters
71 * @returns true if all of the vectors of parameters contain one or more values
72 */
73bool all_given(const std::vector<std::vector<double>> &params) {
74 std::vector<double> param;
75 for (const auto &iter : params) {
76 param = iter;
77 if (param.empty()) {
78 return false;
79 }
80 }
81 return true;
82}
83
84// Register the algorithm into the AlgorithmFactory
85DECLARE_ALGORITHM(CreateMD)
86
87//----------------------------------------------------------------------------------------------
88
89
90const std::string CreateMD::name() const { return "CreateMD"; }
91
93int CreateMD::version() const { return 1; }
94
96const std::string CreateMD::category() const { return "MDAlgorithms"; }
97
99const std::string CreateMD::summary() const { return "Creates an MDWorkspace in the Q3D, HKL frame"; }
100
101//----------------------------------------------------------------------------------------------
105
106 declareProperty(std::make_unique<WorkspaceProperty<IMDEventWorkspace>>("OutputWorkspace", "", Direction::Output),
107 "MDEventWorkspace with new data appended.");
108
109 declareProperty(
110 std::make_unique<ArrayProperty<std::string>>(
111 "DataSources", std::make_shared<MandatoryValidator<std::vector<std::string>>>(), Direction::Input),
112 "Input workspaces to process, or filenames to load and process");
113
114 declareProperty(std::make_unique<ArrayProperty<double>>("EFix", Direction::Input), "datasource energy values in meV");
115
116 std::vector<std::string> e_mode_options{"Elastic", "Direct", "Indirect"};
117
118 declareProperty("Emode", "Direct", std::make_shared<StringListValidator>(e_mode_options),
119 "Analysis mode ['Elastic', 'Direct', 'Indirect'].");
120
121 declareProperty(std::make_unique<ArrayProperty<double>>(
122 "Alatt", std::make_shared<MandatoryValidator<std::vector<double>>>(), Direction::Input),
123 "Lattice parameters");
124
125 declareProperty(std::make_unique<ArrayProperty<double>>(
126 "Angdeg", std::make_shared<MandatoryValidator<std::vector<double>>>(), Direction::Input),
127 "Lattice angles");
128
129 declareProperty(std::make_unique<ArrayProperty<double>>(
130 "u", std::make_shared<MandatoryValidator<std::vector<double>>>(), Direction::Input),
131 "Lattice vector parallel to neutron beam");
132
133 declareProperty(std::make_unique<ArrayProperty<double>>(
134 "v", std::make_shared<MandatoryValidator<std::vector<double>>>(), Direction::Input),
135 "Lattice vector perpendicular to neutron beam in the horizontal plane");
136
137 declareProperty(std::make_unique<ArrayProperty<double>>("Psi", Direction::Input),
138 "Psi rotation in degrees. Optional or one entry per run.");
139
140 declareProperty(std::make_unique<ArrayProperty<double>>("Gl", Direction::Input),
141 "gl rotation in degrees. Optional or one entry per run.");
142
143 declareProperty(std::make_unique<ArrayProperty<double>>("Gs", Direction::Input),
144 "gs rotation in degrees. Optional or one entry per run.");
145
146 declareProperty(std::make_unique<PropertyWithValue<bool>>("InPlace", true, Direction::Input),
147 "Execute conversions to MD and Merge in one-step. Less "
148 "memory overhead.");
149
150 declareProperty(std::make_unique<FileProperty>("Filename", "", FileProperty::OptionalSave, ".nxs"),
151 "The name of the Nexus file to write, as a full or relative path.\n"
152 "Only used if FileBackEnd is true.");
153 setPropertySettings("Filename", std::make_unique<EnabledWhenProperty>("FileBackEnd", IS_EQUAL_TO, "1"));
154
155 declareProperty("FileBackEnd", false,
156 "If true, Filename must also be specified. The algorithm "
157 "will create the specified file in addition to an output "
158 "workspace. The workspace will load data from the file on "
159 "demand in order to reduce memory use.");
160}
161
162//----------------------------------------------------------------------------------------------
166
167 const std::string emode = this->getProperty("Emode");
168 const std::vector<double> alatt = this->getProperty("Alatt");
169 const std::vector<double> angdeg = this->getProperty("Angdeg");
170 const std::vector<double> u = this->getProperty("u");
171 const std::vector<double> v = this->getProperty("v");
172 std::vector<double> psi = this->getProperty("Psi");
173 std::vector<double> gl = this->getProperty("Gl");
174 std::vector<double> gs = this->getProperty("Gs");
175 std::vector<double> efix = this->getProperty("Efix");
176 bool in_place = this->getProperty("InPlace");
177 const std::vector<std::string> data_sources = this->getProperty("DataSources");
178 const std::string out_filename = this->getProperty("Filename");
179 const bool fileBackEnd = this->getProperty("FileBackEnd");
180
181 const size_t entries = data_sources.size();
182
183 padParameterVector(psi, entries);
184 padParameterVector(gl, entries);
185 padParameterVector(gs, entries);
186 if (efix.empty()) {
187 efix.emplace_back(-1.0);
188 }
189 padParameterVector(efix, entries);
190
191 int counter = 0;
192 std::vector<std::string> to_merge_names;
193 std::string to_merge_name;
195 std::stringstream ws_name;
197 Progress progress(this, 0.0, 1.0, entries + 1);
198 for (unsigned long entry_number = 0; entry_number < entries; ++entry_number, ++counter) {
199 ws_name.str(std::string());
200
201 // If data source is not an existing workspace it must be a file we need to
202 // load
203 if (!AnalysisDataService::Instance().doesExist(data_sources[entry_number])) {
204 // Strip off any file extension or path to leave just the stem (base)
205 // filename
206 std::string filename_noext = Poco::Path(data_sources[entry_number]).getBaseName();
207
208 // Create workspace name of form {filename}_md_{n}
209 ws_name << filename_noext << "_md_" << counter;
210 to_merge_name = ws_name.str();
211 workspace =
212 std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(loadWs(data_sources[entry_number], to_merge_name));
213 } else {
214 workspace = std::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
215 AnalysisDataService::Instance().retrieve(data_sources[entry_number]));
216 ws_name << data_sources[entry_number] << "_md";
217 to_merge_name = ws_name.str();
218 }
219
220 // We cannot process in place until we have an output MDWorkspace to use.
221 bool do_in_place = in_place && (counter > 0);
222 run_md = single_run(workspace, emode, efix[entry_number], psi[entry_number], gl[entry_number], gs[entry_number],
223 do_in_place, alatt, angdeg, u, v, out_filename, fileBackEnd, run_md);
224
225 to_merge_names.emplace_back(to_merge_name);
226
227 // We are stuck using ADS as we can't pass workspace pointers to MergeMD
228 // There is currently no way to pass a list of workspace pointers
229 if (!do_in_place) {
230 AnalysisDataService::Instance().addOrReplace(to_merge_name, run_md);
231 }
232
233 progress.report();
234 }
235
236 Workspace_sptr output_workspace;
237 if (to_merge_names.size() > 1 && !in_place) {
238 progress.doReport("Merging loaded data into single workspace");
239 output_workspace = merge_runs(to_merge_names);
240 } else {
241 output_workspace = AnalysisDataService::Instance().retrieve(to_merge_names[0]);
242 }
243
244 progress.report();
245
246 // Clean up temporary workspaces
247 for (const auto &name : to_merge_names) {
249 }
250
251 this->setProperty("OutputWorkspace", output_workspace);
252}
253
254/*
255 * Load data from file
256 *
257 * @param filename :: the name of the file to load
258 * @param wsname :: the name of the workspace to create with the loaded data in
259 * @returns the workspace of loaded data
260 */
261Mantid::API::Workspace_sptr CreateMD::loadWs(const std::string &filename, const std::string &wsname) {
262 Algorithm_sptr load_alg = createChildAlgorithm("Load");
263
264 load_alg->setProperty("Filename", filename);
265 load_alg->setPropertyValue("OutputWorkspace", wsname);
266 load_alg->executeAsChildAlg();
267
268 return load_alg->getProperty("OutputWorkspace");
269}
270
271/*
272 * Set the sample log for the workspace
273 *
274 * @param workspace :: the workspace to add the log to
275 * @param log_name :: the name of the log
276 * @param log_number :: the value to record in the log
277 */
279 double log_number) {
280 Algorithm_sptr log_alg = createChildAlgorithm("AddSampleLog");
281
282 log_alg->setProperty("Workspace", workspace);
283 log_alg->setProperty("LogName", log_name);
284 log_alg->setProperty("LogText", boost::lexical_cast<std::string>(log_number));
285 log_alg->setProperty("LogType", "Number");
286 // Force log to be of type double, even if integer value is passed
287 log_alg->setProperty("NumberType", "Double");
288
289 log_alg->executeAsChildAlg();
290}
291
292/*
293 * Set the goniometer values for the workspace
294 *
295 * @param workspace :: the workspace to set the goniometer values in
296 */
298 Algorithm_sptr log_alg = createChildAlgorithm("SetGoniometer");
299 if (!workspace->run().getProperty("gl")) {
300 std::ostringstream temp_ss;
301 temp_ss << "Value of gl in log is: " << workspace->run().getPropertyAsSingleValue("gl");
302 throw std::invalid_argument(temp_ss.str());
303 }
304 log_alg->setProperty("Workspace", workspace);
305 log_alg->setProperty("Axis0", "gl,0,0,1,1");
306 log_alg->setProperty("Axis1", "gs,1,0,0,1");
307 log_alg->setProperty("Axis2", "psi,0,1,0,1");
308
309 log_alg->executeAsChildAlg();
310}
311
312/*
313 * Set UB for the workspace
314 *
315 * @param workspace :: the workspace to set the UB matrix in
316 * @param a :: length of crystal lattice parameter in angstroms
317 * @param b :: length of crystal lattice parameter in angstroms
318 * @param c :: length of crystal lattice parameter in angstroms
319 * @param alpha :: lattice angle
320 * @param beta :: lattice angle
321 * @param gamma :: lattice angle
322 * @param u :: lattice vector parallel to incident neutron beam
323 * @param v :: lattice vector perpendicular to u in the horizontal plane
324 */
325void CreateMD::setUB(const Mantid::API::MatrixWorkspace_sptr &workspace, double a, double b, double c, double alpha,
326 double beta, double gamma, const std::vector<double> &u, const std::vector<double> &v) {
327 Algorithm_sptr set_ub_alg = createChildAlgorithm("SetUB");
328
329 set_ub_alg->setProperty("Workspace", workspace);
330 set_ub_alg->setProperty("a", a);
331 set_ub_alg->setProperty("b", b);
332 set_ub_alg->setProperty("c", c);
333 set_ub_alg->setProperty("alpha", alpha);
334 set_ub_alg->setProperty("beta", beta);
335 set_ub_alg->setProperty("gamma", gamma);
336 set_ub_alg->setProperty("u", u);
337 set_ub_alg->setProperty("v", v);
338 set_ub_alg->executeAsChildAlg();
339}
340
341/*
342 * Convert the workspace to an MDWorkspace
343 *
344 * @param workspace :: the workspace to convert to an MDWorkspace
345 * @param analysis_mode :: the analysis mode "Direct", "Indirect" or "Elastic"
346 * @param in_place :: true if merge step should be carried out at the same time
347 * @out_mdws :: output workspace to use if merge step is carried out
348 * @returns the output converted workspace
349 */
351 const std::string &analysis_mode, bool in_place,
352 const std::string &filebackend_filename,
353 const bool filebackend,
354 const Mantid::API::IMDEventWorkspace_sptr &out_mdws) {
355 Algorithm_sptr min_max_alg = createChildAlgorithm("ConvertToMDMinMaxGlobal");
356 min_max_alg->setProperty("InputWorkspace", workspace);
357 min_max_alg->setProperty("QDimensions", "Q3D");
358 min_max_alg->setProperty("dEAnalysisMode", analysis_mode);
359 min_max_alg->executeAsChildAlg();
360 std::string min_values = min_max_alg->getPropertyValue("MinValues");
361 std::string max_values = min_max_alg->getPropertyValue("MaxValues");
362
363 Algorithm_sptr convert_alg = createChildAlgorithm("ConvertToMD");
364 convert_alg->setProperty("InputWorkspace", workspace);
365 convert_alg->setProperty("QDimensions", "Q3D");
366 convert_alg->setProperty("QConversionScales", "HKL");
367 convert_alg->setProperty("dEAnalysisMode", analysis_mode);
368 convert_alg->setPropertyValue("MinValues", min_values);
369 convert_alg->setPropertyValue("MaxValues", max_values);
370 // Use same box split settings in ConvertToMD and MergeMD
371 // Otherwise InPlace=True or False will give different results
372 convert_alg->setProperty("SplitInto", SPLITINTO);
373 convert_alg->setProperty("SplitThreshold", SPLITTHRESHOLD);
374 convert_alg->setProperty("MaxRecursionDepth", MAXRECURSIONDEPTH);
375 convert_alg->setProperty("Filename", filebackend_filename);
376 convert_alg->setProperty("FileBackEnd", filebackend);
377 // OverwriteExisting=false means events are added to the existing workspace,
378 // effectively doing the merge in place (without using MergeMD)
379 convert_alg->setProperty("OverwriteExisting", !in_place);
380 if (in_place) {
381 convert_alg->setProperty("OutputWorkspace", out_mdws);
382 } else {
383 convert_alg->setProperty("OutputWorkspace", "dummy");
384 }
385 convert_alg->executeAsChildAlg();
386
387 return convert_alg->getProperty("OutputWorkspace");
388}
389
390/*
391 * Merge input workspaces
392 *
393 * @param to_merge :: vector of workspaces to merge
394 * @returns MDEventWorkspace containing merged data of input workspaces
395 */
396Mantid::API::IMDEventWorkspace_sptr CreateMD::merge_runs(const std::vector<std::string> &to_merge) {
397 Algorithm_sptr merge_alg = createChildAlgorithm("MergeMD");
398
399 merge_alg->setProperty("InputWorkspaces", to_merge);
400 merge_alg->setPropertyValue("OutputWorkspace", "dummy");
401 // Use same box split settings in ConvertToMD and MergeMD
402 // Otherwise InPlace=True or False will give different results
403 merge_alg->setProperty("SplitInto", SPLITINTO);
404 merge_alg->setProperty("SplitThreshold", SPLITTHRESHOLD);
405 merge_alg->setProperty("MaxRecursionDepth", MAXRECURSIONDEPTH);
406 merge_alg->executeAsChildAlg();
407
408 return merge_alg->getProperty("OutputWorkspace");
409}
410
411/*
412 * Add parameter logs and convert to MD for a single run
413 *
414 * @param input_workspace :: datasource workspace
415 * @param emode :: analysis mode "Elastic", "Direct" or "Indirect"
416 * @param efix :: datasource energy values in meV
417 * @param psi :: goniometer rotation in degrees
418 * @param gl :: goniometer rotation in degrees
419 * @param gs :: goniometer rotation in degrees
420 * @param in_place :: do merge step at the same time as converting to
421 *MDWorkspace
422 * @param alatt :: length of crystal lattice parameter in angstroms
423 * @param angdeg :: lattice angle
424 * @param u :: lattice vector parallel to incident neutron beam
425 * @param v :: lattice vector perpendicular to u in the horizontal plane
426 * @param out_mdws :output workspace to use if merge step is carried out
427 */
429CreateMD::single_run(const Mantid::API::MatrixWorkspace_sptr &input_workspace, const std::string &emode, double efix,
430 double psi, double gl, double gs, bool in_place, const std::vector<double> &alatt,
431 const std::vector<double> &angdeg, const std::vector<double> &u, const std::vector<double> &v,
432 const std::string &filebackend_filename, const bool filebackend,
433 const Mantid::API::IMDEventWorkspace_sptr &out_mdws) {
434
435 std::vector<std::vector<double>> ub_params{alatt, angdeg, u, v};
436
437 if (any_given(ub_params) && !all_given(ub_params)) {
438 throw std::invalid_argument("Either specify all of alatt, angledeg, u, v or none of them");
439 } else {
440 if (input_workspace->sample().hasOrientedLattice()) {
441 g_log.warning() << "Sample already has a UB. This will not be "
442 "overwritten. Use ClearUB and re-run.\n";
443 } else {
444 setUB(input_workspace, alatt[0], alatt[1], alatt[2], angdeg[0], angdeg[1], angdeg[2], u, v);
445 }
446
447 if (efix > 0.0) {
448 addSampleLog(input_workspace, "Ei", efix);
449 }
450
451 addSampleLog(input_workspace, "gl", gl);
452 addSampleLog(input_workspace, "gs", gs);
453 addSampleLog(input_workspace, "psi", psi);
454 setGoniometer(input_workspace);
455
456 return convertToMD(input_workspace, emode, in_place, filebackend_filename, filebackend, out_mdws);
457 }
458}
459
460/*
461 * Validate input properties
462 *
463 * @returns map with keys corresponding to properties with errors and values
464 *containing the error messages
465 */
466std::map<std::string, std::string> CreateMD::validateInputs() {
467 // Create the map
468 std::map<std::string, std::string> validation_output;
469
470 // Get properties to validate
471 const std::vector<std::string> data_sources = this->getProperty("DataSources");
472 const std::vector<double> u = this->getProperty("u");
473 const std::vector<double> v = this->getProperty("v");
474 const std::vector<double> alatt = this->getProperty("Alatt");
475 const std::vector<double> angdeg = this->getProperty("Angdeg");
476 const std::vector<double> psi = this->getProperty("Psi");
477 const std::vector<double> gl = this->getProperty("Gl");
478 const std::vector<double> gs = this->getProperty("Gs");
479 const std::vector<double> efix = this->getProperty("Efix");
480 const std::string filename = this->getProperty("Filename");
481 const bool fileBackEnd = this->getProperty("FileBackEnd");
482
483 if (fileBackEnd && filename.empty()) {
484 validation_output["Filename"] = "Filename must be given if FileBackEnd is required.";
485 }
486
487 const size_t ws_entries = data_sources.size();
488 for (const auto &source : data_sources) {
489 if (!dataExists(source)) {
490 validation_output["DataSources"] = "All given data sources must exist. "
491 "For files, ensure the path is added to "
492 "Mantid's 'Data Search Directories'";
493 }
494 }
495
496 if (u.size() != 3) {
497 validation_output["u"] = "u must have 3 components";
498 }
499 if (v.size() != 3) {
500 validation_output["v"] = "v must have 3 components";
501 }
502 if (alatt.size() != 3) {
503 validation_output["Alatt"] = "Lattice parameters must have 3 components";
504 }
505 if (angdeg.size() != 3) {
506 validation_output["Angdeg"] = "Angle must have 3 components";
507 }
508 if (!psi.empty() && psi.size() != ws_entries) {
509 validation_output["Psi"] = "If Psi is given an entry "
510 "should be provided for "
511 "every input datasource";
512 }
513 if (!gl.empty() && gl.size() != ws_entries) {
514 validation_output["Gl"] = "If Gl is given an entry "
515 "should be provided for "
516 "every input datasource";
517 }
518 if (!gs.empty() && gs.size() != ws_entries) {
519 validation_output["Gs"] = "If Gs is given an entry "
520 "should be provided for "
521 "every input datasource";
522 }
523 if (efix.size() > 1 && efix.size() != ws_entries) {
524 validation_output["EFix"] = "Either specify a single EFix value, or as many "
525 "as there are input datasources";
526 }
527
528 return validation_output;
529}
530
531} // namespace Mantid::MDAlgorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
@ OptionalSave
to specify a file to write to but an empty string is
Definition: FileProperty.h:50
std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1) override
Create a Child Algorithm.
Kernel::IPropertyManager::TypedValue getProperty(const std::string &name) const override
Get the property held by this object.
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
void doReport(const std::string &msg="") override
Actually do the reporting, without changing the loop counter.
Definition: Progress.cpp:70
A property class for workspaces.
Support for a property that holds an array of values.
Definition: ArrayProperty.h:28
void warning(const std::string &msg)
Logs at warning level.
Definition: Logger.cpp:86
Validator to check that a property is not left empty.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
Definition: ProgressBase.h:51
The concrete, templated class for properties.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
CreateMD : This workflow algorithm creates MDWorkspaces in the Q3D, HKL frame using ConvertToMD.
Definition: CreateMD.h:26
void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &workspace)
Set the goniometer values in a workspace.
Definition: CreateMD.cpp:297
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
Definition: CreateMD.cpp:99
const std::string name() const override
Algorithms name for identification.
Definition: CreateMD.cpp:90
Mantid::API::IMDEventWorkspace_sptr merge_runs(const std::vector< std::string > &to_merge)
Merge input workspaces.
Definition: CreateMD.cpp:396
std::map< std::string, std::string > validateInputs() override
Validate the algorithm's input properties.
Definition: CreateMD.cpp:466
void setUB(const Mantid::API::MatrixWorkspace_sptr &workspace, double a, double b, double c, double alpha, double beta, double gamma, const std::vector< double > &u, const std::vector< double > &v)
Set the UB matrix in a workspace.
Definition: CreateMD.cpp:325
Mantid::API::IMDEventWorkspace_sptr single_run(const Mantid::API::MatrixWorkspace_sptr &input_workspace, const std::string &emode, double efix, double psi, double gl, double gs, bool in_place, const std::vector< double > &alatt, const std::vector< double > &angdeg, const std::vector< double > &u, const std::vector< double > &v, const std::string &filebackend_filename, const bool filebackend, const Mantid::API::IMDEventWorkspace_sptr &out_mdws)
Add logs and convert to MDWorkspace for a single run.
Definition: CreateMD.cpp:429
void addSampleLog(const Mantid::API::MatrixWorkspace_sptr &workspace, const std::string &log_name, double log_number)
Add a sample log to a workspace.
Definition: CreateMD.cpp:278
void init() override
Initialize the algorithm's properties.
Definition: CreateMD.cpp:104
void exec() override
Execute the algorithm.
Definition: CreateMD.cpp:165
int version() const override
Algorithm's version for identification.
Definition: CreateMD.cpp:93
Mantid::API::IMDEventWorkspace_sptr convertToMD(const Mantid::API::Workspace_sptr &workspace, const std::string &analysis_mode, bool in_place, const std::string &filebackend_filename, const bool filebackend, const Mantid::API::IMDEventWorkspace_sptr &out_mdws)
Convert a workspace to MDWorkspace.
Definition: CreateMD.cpp:350
const std::string category() const override
Algorithm's category for identification.
Definition: CreateMD.cpp:96
Mantid::API::Workspace_sptr loadWs(const std::string &filename, const std::string &wsname)
Load data from file into a workspace.
Definition: CreateMD.cpp:261
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
Definition: Algorithm.h:61
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void MANTID_MDALGORITHMS_DLL padParameterVector(std::vector< double > &param_vector, const size_t grow_to_size)
Pad vector of parameters to given length.
Definition: CreateMD.cpp:40
bool MANTID_MDALGORITHMS_DLL dataExists(const std::string &data_name)
Check if the named data source is an existing workspace or file.
static const std::string MAXRECURSIONDEPTH("20")
bool any_given(const std::vector< std::vector< double > > &params)
Definition: CreateMD.cpp:56
bool all_given(const std::vector< std::vector< double > > &params)
Definition: CreateMD.cpp:73
static const std::string SPLITINTO("2")
static const std::string SPLITTHRESHOLD("500")
STL namespace.
Describes the direction (within an algorithm) of a Property.
Definition: Property.h:50
@ Input
An input workspace.
Definition: Property.h:53
@ Output
An output workspace.
Definition: Property.h:54