Mantid
Loading...
Searching...
No Matches
ConvertToMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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 +
7#pragma once
8
12
14
15#include <boost/scoped_ptr.hpp>
16
17namespace Mantid {
18namespace MDAlgorithms {
19
32class MANTID_MDALGORITHMS_DLL ConvertToMD : public ConvertToMDParent {
33public:
35 const std::string name() const override;
37 const std::string summary() const override {
38 return "Create a MDEventWorkspace with selected dimensions, e.g. the "
39 "reciprocal space of momentums (Qx, Qy, Qz) or momentums modules "
40 "mod(Q), energy transfer dE if available and any other user "
41 "specified log values which can be treated as dimensions.";
42 }
43
45 int version() const override;
46 const std::vector<std::string> seeAlso() const override {
47 return {"ConvertToDiffractionMDWorkspace", "ConvertToMDMinMaxGlobal", "ConvertToMDMinMaxLocal", "CreateMDWorkspace",
48 "SetSpecialCoordinates"};
49 }
50
51private:
52 std::map<std::string, std::string> validateInputs() override;
53 void exec() override;
54 void init() override;
56 boost::scoped_ptr<API::Progress> m_Progress;
57
58 void setupFileBackend(const std::string &filebackPath, const API::IMDEventWorkspace_sptr &outputWS);
59
60 //------------------------------------------------------------------------------------------------------------------------------------------
61protected: // for testing, otherwise private:
64 // TODO: This will eventually go. ///The pointer to class which keeps output
65 // MD workspace and is responsible for adding data to N-dimensional workspace;
66 std::shared_ptr<MDAlgorithms::MDEventWSWrapper> m_OutWSWrapper;
67
68 // Workflow helpers:
71 bool doWeNeedNewTargetWorkspace(const API::IMDEventWorkspace_sptr &spws);
73 API::IMDEventWorkspace_sptr createNewMDWorkspace(const MDAlgorithms::MDWSDescription &targWSDescr,
74 const bool filebackend, const std::string &filename);
75
76 bool buildTargetWSDescription(const API::IMDEventWorkspace_sptr &spws, const std::string &QModReq,
77 const std::string &dEModReq, const std::vector<std::string> &otherDimNames,
78 std::vector<double> &dimMin, std::vector<double> &dimMax, const std::string &QFrame,
79 const std::string &convertTo_, MDAlgorithms::MDWSDescription &targWSDescr);
80
83 void addExperimentInfo(API::IMDEventWorkspace_sptr &mdEventWS, MDAlgorithms::MDWSDescription &targWSDescr) const;
84
87 void copyMetaData(API::IMDEventWorkspace_sptr &mdEventWS) const;
88
89 void findMinMax(const Mantid::API::MatrixWorkspace_sptr &inWS, const std::string &QMode, const std::string &dEMode,
90 const std::string &QFrame, const std::string &ConvertTo, const std::vector<std::string> &otherDim,
91 std::vector<double> &minVal, std::vector<double> &maxVal);
92
94 void setupTopLevelSplitting(const Mantid::API::BoxController_sptr &bc);
95};
96
97} // namespace MDAlgorithms
98} // namespace Mantid
std::string name
Definition Run.cpp:60
ConvertToMDParent : Main part of two algorithms which use ConvertToMD factory to transform points fro...
ConvertToMD : Transform a workspace into MD workspace with components defined by user.
Definition ConvertToMD.h:32
Mantid::API::MatrixWorkspace_sptr m_InWS2D
pointer to the input workspace;
Definition ConvertToMD.h:63
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition ConvertToMD.h:46
boost::scoped_ptr< API::Progress > m_Progress
progress reporter
Definition ConvertToMD.h:56
std::shared_ptr< MDAlgorithms::MDEventWSWrapper > m_OutWSWrapper
Definition ConvertToMD.h:66
const std::string summary() const override
Summary of algorithms purpose.
Definition ConvertToMD.h:37
helper class describes the properties of target MD workspace, which should be obtained as the result ...
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< BoxController > BoxController_sptr
Shared ptr to BoxController.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.