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
15namespace Mantid {
16namespace MDAlgorithms {
17
30class MANTID_MDALGORITHMS_DLL ConvertToMD : public ConvertToMDParent {
31public:
33 const std::string name() const override;
35 const std::string summary() const override {
36 return "Create a MDEventWorkspace with selected dimensions, e.g. the "
37 "reciprocal space of momentums (Qx, Qy, Qz) or momentums modules "
38 "mod(Q), energy transfer dE if available and any other user "
39 "specified log values which can be treated as dimensions.";
40 }
41
43 int version() const override;
44 const std::vector<std::string> seeAlso() const override {
45 return {"ConvertToDiffractionMDWorkspace", "ConvertToMDMinMaxGlobal", "ConvertToMDMinMaxLocal", "CreateMDWorkspace",
46 "SetSpecialCoordinates"};
47 }
48
49private:
50 std::map<std::string, std::string> validateInputs() override;
51 void exec() override;
52 void init() override;
54 std::unique_ptr<API::Progress> m_Progress;
55
56 void setupFileBackend(const std::string &filebackPath, const API::IMDEventWorkspace_sptr &outputWS);
57
58 //------------------------------------------------------------------------------------------------------------------------------------------
59protected: // for testing, otherwise private:
62 // TODO: This will eventually go. ///The pointer to class which keeps output
63 // MD workspace and is responsible for adding data to N-dimensional workspace;
64 std::shared_ptr<MDAlgorithms::MDEventWSWrapper> m_OutWSWrapper;
65
66 // Workflow helpers:
69 bool doWeNeedNewTargetWorkspace(const API::IMDEventWorkspace_sptr &spws);
71 API::IMDEventWorkspace_sptr createNewMDWorkspace(const MDAlgorithms::MDWSDescription &targWSDescr,
72 const bool filebackend, const std::string &filename);
73
74 bool buildTargetWSDescription(const API::IMDEventWorkspace_sptr &spws, const std::string &QModReq,
75 const std::string &dEModReq, const std::vector<std::string> &otherDimNames,
76 std::vector<double> &dimMin, std::vector<double> &dimMax, const std::string &QFrame,
77 const std::string &convertTo_, MDAlgorithms::MDWSDescription &targWSDescr);
78
81 void addExperimentInfo(API::IMDEventWorkspace_sptr &mdEventWS, MDAlgorithms::MDWSDescription &targWSDescr) const;
82
85 void copyMetaData(API::IMDEventWorkspace_sptr &mdEventWS) const;
86
87 void findMinMax(const Mantid::API::MatrixWorkspace_sptr &inWS, const std::string &QMode, const std::string &dEMode,
88 const std::string &QFrame, const std::string &ConvertTo, const std::vector<std::string> &otherDim,
89 std::vector<double> &minVal, std::vector<double> &maxVal);
90
92 void setupTopLevelSplitting(const Mantid::API::BoxController_sptr &bc);
93};
94
95} // namespace MDAlgorithms
96} // 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:30
Mantid::API::MatrixWorkspace_sptr m_InWS2D
pointer to the input workspace;
Definition ConvertToMD.h:61
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:44
std::shared_ptr< MDAlgorithms::MDEventWSWrapper > m_OutWSWrapper
Definition ConvertToMD.h:64
std::unique_ptr< API::Progress > m_Progress
progress reporter
Definition ConvertToMD.h:54
const std::string summary() const override
Summary of algorithms purpose.
Definition ConvertToMD.h:35
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.