Mantid
Loading...
Searching...
No Matches
ImportMDHistoWorkspaceBase.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
11#include "MantidMDAlgorithms/DllConfig.h"
12#include <vector>
13
14namespace Mantid {
15namespace MDAlgorithms {
16
22class MANTID_MDALGORITHMS_DLL ImportMDHistoWorkspaceBase : public API::Algorithm {
23public:
24 std::map<std::string, std::string> validateInputs() override;
25
26protected:
29 std::vector<int> nbins;
31 DataObjects::MDHistoWorkspace_sptr createEmptyOutputWorkspace();
34 void initGenericImportProps();
36 size_t getBinProduct() const { return m_bin_product; }
37
38private:
39 // Product of the bins across all dimensions.
40 size_t m_bin_product = 0;
41 Mantid::Geometry::MDFrame_uptr createMDFrame(const std::string &frame, const std::string &unit);
42 bool checkIfFrameValid(const std::string &frame, const std::vector<std::string> &targetFrames);
43 std::vector<std::string> parseNames(const std::string &names_string);
44};
45
46} // namespace MDAlgorithms
47} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
ImportMDHistoWorkspaceBase : Base class for algorithms Importing data as MDHistoWorkspaces.
std::vector< int > nbins
Vector containing the number of bins in each dimension.
size_t getBinProduct() const
Getter for the number of bins (product accross all dimensions)
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
std::unique_ptr< MDFrame > MDFrame_uptr
Definition: MDFrame.h:36
std::vector< std::string > MANTID_MDALGORITHMS_DLL parseNames(const std::string &names_string)
Helper class which provides the Collimation Length for SANS instruments.