/
AccumulateMD.h
111 lines (87 loc) · 4.15 KB
/
AccumulateMD.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef MANTID_MDALGORITHMS_ACCUMULATEMD_H_
#define MANTID_MDALGORITHMS_ACCUMULATEMD_H_
#include "MantidMDAlgorithms/DllConfig.h"
#include "MantidKernel/System.h"
#include "MantidAPI/DataProcessorAlgorithm.h"
#include "MantidAPI/WorkspaceHistory.h"
#include "MantidAPI/IMDEventWorkspace.h"
#include <set>
namespace {}
namespace Mantid {
namespace API {
class IMDHistoWorkspace;
}
namespace MDAlgorithms {
/// Reduce the vector of input data to only data files and workspaces which can
/// be found
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);
/// Check if the named data source is an existing workspace or file
bool MANTID_MDALGORITHMS_DLL dataExists(const std::string &data_name);
/// Reduce the vector of input data to only data files and workspaces which are
/// not found in the vector of data currently in the workspace
std::string MANTID_MDALGORITHMS_DLL
filterToNew(std::vector<std::string> &input_data,
std::vector<std::string> ¤t_data, std::vector<double> &psi,
std::vector<double> &gl, std::vector<double> &gs,
std::vector<double> &efix);
/// Check if the named data source is in the vector of data currently in the
/// workspace
bool appearsInCurrentData(const std::string &data_source,
std::vector<std::string> ¤t_data);
/// Return a vector of the names of files and workspaces which have been
/// previously added to the workspace
std::vector<std::string>
getHistoricalDataSources(const API::WorkspaceHistory &ws_history,
const std::string &create_alg_name,
const std::string &accumulate_alg_name);
/// Extract names of data sources from workspace history and form a set of
/// historical data sources
void MANTID_MDALGORITHMS_DLL
insertDataSources(const std::string &data_sources,
std::unordered_set<std::string> &historical_data_sources);
/// Test if a file with the given full path name exists
bool fileExists(const std::string &filename);
/// Pad vector of parameters to given length
extern void MANTID_MDALGORITHMS_DLL
padParameterVector(std::vector<double> ¶m_vector,
const size_t grow_to_size);
/** AccumulateMD : Algorithm for appending new data to a MDHistoWorkspace
Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport AccumulateMD : public API::DataProcessorAlgorithm {
public:
const std::string name() const override;
int version() const override;
const std::string category() const override;
const std::string summary() const override;
private:
void init() override;
void exec() override;
/// Use the CreateMD algorithm to create an MD workspace
Mantid::API::IMDEventWorkspace_sptr createMDWorkspace(
const std::vector<std::string> &data_sources,
const std::vector<double> &psi, const std::vector<double> &gl,
const std::vector<double> &gs, const std::vector<double> &efix,
const std::string &filename, const bool filebackend);
std::map<std::string, std::string> validateInputs() override;
};
} // namespace MDAlgorithms
} // namespace Mantid
#endif /* MANTID_MDALGORITHMS_ACCUMULATEMD_H_ */