Mantid
Loading...
Searching...
No Matches
BackgroundFunction.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
13#include "MantidCurveFitting/DllConfig.h"
14#include <memory>
15
16namespace mu {
17class Parser;
18}
19
20namespace Mantid {
21namespace CurveFitting {
22namespace Functions {
30class MANTID_CURVEFITTING_DLL BackgroundFunction : public API::IBackgroundFunction {
31public:
37 double centre() const override { return 0.; }
38
43 double height() const override { return 0.; }
44
46 void setCentre(const double c) override {
47 (void)c; // Avoid compiler warning
48 }
49
51 void setHeight(const double h) override {
52 (void)h; // Avoid compiler warning
53 }
54
55 void fit(const std::vector<double> &X, const std::vector<double> &Y) override;
56
58 const std::string category() const override { return "Background"; }
59};
60
61using BackgroundFunction_sptr = std::shared_ptr<BackgroundFunction>;
62
63} // namespace Functions
64} // namespace CurveFitting
65} // namespace Mantid
An interface to a background function.
double centre() const override
Returns the centre of the function, which may be something as simple as the centre of the fitting ran...
double height() const override
Returns the height of the function.
void setHeight(const double h) override
Sets the parameters such that height == h.
void setCentre(const double c) override
Sets the parameters such that centre == c.
const std::string category() const override
overwrite IFunction base class methods
std::shared_ptr< BackgroundFunction > BackgroundFunction_sptr
Helper class which provides the Collimation Length for SANS instruments.