Mantid
Loading...
Searching...
No Matches
AccumulateMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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#include "MantidMDAlgorithms/DllConfig.h"
13#include <set>
14
15namespace {}
16
17namespace Mantid {
18namespace API {
19class IMDHistoWorkspace;
20}
21
22namespace MDAlgorithms {
23
26std::string MANTID_MDALGORITHMS_DLL filterToExistingSources(std::vector<std::string> &input_data,
27 std::vector<double> &psi, std::vector<double> &gl,
28 std::vector<double> &gs, std::vector<double> &efix);
29
31bool MANTID_MDALGORITHMS_DLL dataExists(const std::string &data_name);
32
35std::string MANTID_MDALGORITHMS_DLL filterToNew(std::vector<std::string> &input_data,
36 std::vector<std::string> &current_data, std::vector<double> &psi,
37 std::vector<double> &gl, std::vector<double> &gs,
38 std::vector<double> &efix);
39
42bool appearsInCurrentData(const std::string &data_source, std::vector<std::string> &current_data);
43
46std::vector<std::string> getHistoricalDataSources(const API::WorkspaceHistory &ws_history,
47 const std::string &create_alg_name,
48 const std::string &accumulate_alg_name);
49
52void MANTID_MDALGORITHMS_DLL insertDataSources(const std::string &data_sources,
53 std::unordered_set<std::string> &historical_data_sources);
54
56bool fileExists(const std::string &filename);
57
59extern void MANTID_MDALGORITHMS_DLL padParameterVector(std::vector<double> &param_vector, const size_t grow_to_size);
60
63class MANTID_MDALGORITHMS_DLL AccumulateMD : public API::DataProcessorAlgorithm {
64public:
65 const std::string name() const override;
66 int version() const override;
67 const std::vector<std::string> seeAlso() const override { return {"MergeMD"}; }
68 const std::string category() const override;
69 const std::string summary() const override;
70
71private:
72 void init() override;
73 void exec() override;
74
76 Mantid::API::IMDEventWorkspace_sptr createMDWorkspace(const std::vector<std::string> &data_sources,
77 const std::vector<double> &psi, const std::vector<double> &gl,
78 const std::vector<double> &gs, const std::vector<double> &efix,
79 const std::string &filename, const bool filebackend);
80
81 std::map<std::string, std::string> validateInputs() override;
82};
83
84} // namespace MDAlgorithms
85} // namespace Mantid
Data processor algorithm to be used as a parent to workflow algorithms.
This class stores information about the Workspace History used by algorithms on a workspace and the e...
AccumulateMD : Algorithm for appending new data to a MDHistoWorkspace.
Definition: AccumulateMD.h:63
const std::vector< std::string > seeAlso() const override
Definition: AccumulateMD.h:67
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
void MANTID_MDALGORITHMS_DLL insertDataSources(const std::string &data_sources, std::unordered_set< std::string > &historical_data_sources)
Extract names of data sources from workspace history and form a set of historical data sources.
std::string MANTID_MDALGORITHMS_DLL filterToNew(std::vector< std::string > &input_data, std::vector< std::string > &current_data, std::vector< double > &psi, std::vector< double > &gl, std::vector< double > &gs, std::vector< double > &efix)
Reduce the vector of input data to only data files and workspaces which are not found in the vector o...
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.
bool fileExists(const std::string &filename)
Test if a file with the given full path name exists.
bool appearsInCurrentData(const std::string &data_source, std::vector< std::string > &current_data)
Check if the named data source is in the vector of data currently in the workspace.
std::vector< std::string > getHistoricalDataSources(const API::WorkspaceHistory &ws_history, const std::string &create_alg_name, const std::string &accumulate_alg_name)
Return a vector of the names of files and workspaces which have been previously added to the workspac...
std::string MANTID_MDALGORITHMS_DLL filterToExistingSources(std::vector< std::string > &input_data, std::vector< double > &psi, std::vector< double > &gl, std::vector< double > &gs, std::vector< double > &efix)
Reduce the vector of input data to only data files and workspaces which can be found.
Helper class which provides the Collimation Length for SANS instruments.