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