-
Notifications
You must be signed in to change notification settings - Fork 121
/
SliceMD.h
72 lines (60 loc) · 2.61 KB
/
SliceMD.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 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 "MantidDataObjects/MDEventWorkspace.h"
#include "MantidKernel/System.h"
#include "MantidMDAlgorithms/SlicingAlgorithm.h"
namespace Mantid {
namespace MDAlgorithms {
/** Algorithm that can take a slice out of an original MDEventWorkspace
* while preserving all the events contained wherein.
@author Janik Zikovsky
@date 2011-09-27
*/
class DLLExport SliceMD : public SlicingAlgorithm {
public:
//// enum describes situations, which could happen for input Box binning
// enum BoxState
//{
// boxTooSmall, // too few events in the box worth considering its vertices
// boxOutside, // box is not small but is completely out of slice
// boxWorthConsidering // box belongs to slice and its events worth
// considering for slicing
//};
/// Algorithm's name for identification
const std::string name() const override { return "SliceMD"; };
/// Summary of algorithms purpose
const std::string summary() const override {
return "Make a MDEventWorkspace containing the events in a slice of an "
"input MDEventWorkspace.";
}
/// Algorithm's version for identification
int version() const override { return 1; };
const std::vector<std::string> seeAlso() const override { return {"SliceMDHisto", "ProjectMD", "CutMD", "BinMD"}; }
/// Algorithm's category for identification
const std::string category() const override { return "MDAlgorithms\\Slicing"; }
private:
/// Initialise the properties
void init() override;
/// Run the algorithm
void exec() override;
/// Helper method
template <typename MDE, size_t nd> void doExec(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
/// Method to actually do the slice
template <typename MDE, size_t nd, typename OMDE, size_t ond>
void slice(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
protected: // for testing
/* /// Method to slice box's events if the box itself belongs to the slice
template<typename MDE, size_t nd, typename OMDE, size_t ond>
void sliceMDBox(MDBox<MDE, nd> * box, size_t * chunkMin, size_t * chunkMax);
template<typename MDE, size_t nd, typename OMDE, size_t ond>
BoxState foundBoxState(MDBox<MDE, nd> * box, size_t * chunkMin, size_t *
chunkMax);*/
};
} // namespace MDAlgorithms
} // namespace Mantid