/
MergeMD.h
50 lines (39 loc) · 1.67 KB
/
MergeMD.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/BoxControllerSettingsAlgorithm.h"
#include "MantidAPI/IMDEventWorkspace_fwd.h"
#include "MantidDataObjects/MDEventWorkspace.h"
#include "MantidMDAlgorithms/DllConfig.h"
namespace Mantid {
namespace MDAlgorithms {
/** Merge several MDWorkspaces into one.
@date 2012-01-17
*/
class MANTID_MDALGORITHMS_DLL MergeMD : public API::BoxControllerSettingsAlgorithm {
public:
const std::string name() const override;
/// Summary of algorithms purpose
const std::string summary() const override { return "Merge several MDWorkspaces into one."; }
int version() const override;
const std::vector<std::string> seeAlso() const override { return {"MergeMDFiles", "AccumulateMD"}; }
const std::string category() const override;
private:
void init() override;
void exec() override;
void createOutputWorkspace(std::vector<std::string> &inputs);
template <typename MDE, size_t nd> void doPlus(typename Mantid::DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
/// Vector of input MDWorkspaces
std::vector<Mantid::API::IMDEventWorkspace_sptr> m_workspaces;
/// Vector of number of experimentalInfos for each input workspace
std::vector<uint16_t> experimentInfoNo = {0};
/// Output MDEventWorkspace
Mantid::API::IMDEventWorkspace_sptr out;
};
} // namespace MDAlgorithms
} // namespace Mantid