Mantid
Loading...
Searching...
No Matches
RemoveBins.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 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
10#include "MantidAlgorithms/DllConfig.h"
11#include "MantidKernel/Unit.h"
12
13namespace Mantid {
14namespace HistogramData {
15class HistogramX;
16class HistogramY;
17class HistogramE;
18} // namespace HistogramData
19namespace API {
20class SpectrumInfo;
21}
22namespace Algorithms {
46class MANTID_ALGORITHMS_DLL RemoveBins final : public API::Algorithm {
47public:
49 RemoveBins();
51 const std::string name() const override { return "RemoveBins"; }
53 const std::string summary() const override { return "Used to remove data from a range of bins in a workspace."; }
54
56 int version() const override { return 1; }
57 const std::vector<std::string> seeAlso() const override { return {"CropWorkspace"}; }
59 const std::string category() const override { return "Transforms\\Splitting"; }
60
61private:
62 // Overridden Algorithm methods
63 void init() override;
64 std::map<std::string, std::string> validateInputs() override;
65 void exec() override;
66
67 void crop(const double &start, const double &end);
68 void transformRangeUnit(const int index, double &startX, double &endX);
69 int findIndex(const double &value, const HistogramData::HistogramX &vec);
70 void RemoveFromEnds(int start, int end, HistogramData::HistogramY &Y, HistogramData::HistogramE &E);
71 void RemoveFromMiddle(const int &start, const int &end, const double &startFrac, const double &endFrac,
72 HistogramData::HistogramY &Y, HistogramData::HistogramE &E);
73
76 double m_startX;
77 double m_endX;
80};
81
82} // namespace Algorithms
83} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
Removes bins from a workspace.
Definition: RemoveBins.h:46
double m_endX
The range end point.
Definition: RemoveBins.h:77
double m_startX
The range start point.
Definition: RemoveBins.h:76
const std::string summary() const override
Summary of algorithms purpose.
Definition: RemoveBins.h:53
Kernel::Unit_sptr m_rangeUnit
The unit in which the above range is given.
Definition: RemoveBins.h:78
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: RemoveBins.h:57
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: RemoveBins.h:51
API::MatrixWorkspace_const_sptr m_inputWorkspace
The input workspace.
Definition: RemoveBins.h:74
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: RemoveBins.h:56
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: RemoveBins.h:59
bool m_interpolate
Whether removed bins should be interpolated.
Definition: RemoveBins.h:79
const API::SpectrumInfo * m_spectrumInfo
Definition: RemoveBins.h:75
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< Unit > Unit_sptr
Shared pointer to the Unit base class.
Definition: Unit.h:229
Helper class which provides the Collimation Length for SANS instruments.