Mantid
Loading...
Searching...
No Matches
CreateUserDefinedBackground.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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
11#include "MantidAlgorithms/DllConfig.h"
12#include "MantidHistogramData/Histogram.h"
13namespace Mantid {
14namespace Kernel {
15class Interpolation;
16}
17namespace Algorithms {
18
24class MANTID_ALGORITHMS_DLL CreateUserDefinedBackground final : public API::Algorithm {
25public:
27 const std::string name() const override;
29 int version() const override;
30 const std::vector<std::string> seeAlso() const override {
31 return {"RemoveBackground", "CalculatePolynomialBackground"};
32 }
34 const std::string category() const override;
36 const std::string summary() const override;
37
38private:
40 void init() override;
42 void exec() override;
44 std::map<std::string, std::string> validateInputs() override;
46 void cleanUpTable(API::ITableWorkspace_sptr &table) const;
48 void extendBackgroundToData(API::ITableWorkspace_sptr &background, const API::MatrixWorkspace_const_sptr &data) const;
50 API::MatrixWorkspace_sptr createBackgroundWorkspace(const API::ITableWorkspace_const_sptr &background,
51 const API::MatrixWorkspace_const_sptr &data) const;
53 Kernel::Interpolation getInterpolator(const API::ITableWorkspace_const_sptr &background,
56 HistogramData::Histogram::YMode getBackgroundYMode(const API::MatrixWorkspace_const_sptr &data,
57 std::vector<double> &yBackground) const;
59 void multiplyByBinWidth(const API::MatrixWorkspace_const_sptr &data, std::vector<double> &yBackground) const;
61 static const std::string AUTODISTRIBUTIONKEY;
62};
63
64} // namespace Algorithms
65} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
CreateUserDefinedBackground : Given an input workspace containing data with a background and a table ...
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
void multiplyByBinWidth(const API::MatrixWorkspace_const_sptr &data, std::vector< double > &yBackground) const
Multiply y data by bin width.
static const std::string AUTODISTRIBUTIONKEY
Key name for "normalize histogram to bin width" option on plots.
HistogramData::Histogram::YMode getBackgroundYMode(const API::MatrixWorkspace_const_sptr &data, std::vector< double > &yBackground) const
Get Y storage mode for background data.
Provide interpolation over a series of points.
Definition: Interpolation.h:29
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< const ITableWorkspace > ITableWorkspace_const_sptr
shared pointer to Mantid::API::ITableWorkspace (const version)
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.