-
Notifications
You must be signed in to change notification settings - Fork 122
/
MaskBins.h
76 lines (66 loc) · 2.5 KB
/
MaskBins.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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2009 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/DistributedAlgorithm.h"
#include "MantidAlgorithms/DllConfig.h"
#include "MantidDataObjects/EventList.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidIndexing/SpectrumIndexSet.h"
namespace Mantid {
namespace Histogram {
class BinEdges;
}
namespace Algorithms {
/** Masks bins in a workspace. Bins falling within the range given (even
partially) are
masked, i.e. their data and error values are set to zero and the bin is
added to the
list of masked bins. This range is masked for all spectra in the workspace
(though the
workspace does not have to have common X values in all spectra).
Required Properties:
<UL>
<LI> InputWorkspace - The name of the Workspace to take as input. </LI>
<LI> OutputWorkspace - The name of the Workspace containing the masked bins.
</LI>
<LI> XMin - The value to start masking from.</LI>
<LI> XMax - The value to end masking at.</LI>
</UL>
@author Russell Taylor, Tessella plc
@date 29/04/2009
*/
class MANTID_ALGORITHMS_DLL MaskBins : public API::DistributedAlgorithm {
public:
/// Algorithm's name
const std::string name() const override { return "MaskBins"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Marks bins in a workspace as being masked.";
}
/// Algorithm's version
int version() const override { return (1); }
const std::vector<std::string> seeAlso() const override {
return {"MaskBinsIf", "MaskBinsFromTable", "MaskNonOverlappingBins"};
}
/// Algorithm's category for identification
const std::string category() const override { return "Transforms\\Masking"; }
private:
/// Initialisation code
void init() override;
/// Execution code
void exec() override;
void execEvent();
void findIndices(const HistogramData::BinEdges &X,
MantidVec::difference_type &startBin,
MantidVec::difference_type &endBin);
double m_startX{0.0}; ///< The range start point
double m_endX{0.0}; ///< The range end point
Indexing::SpectrumIndexSet
indexSet; ///< the list of Spectra (workspace index) to load
};
} // namespace Algorithms
} // namespace Mantid