Mantid
Loading...
Searching...
No Matches
Gaussian.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 <cmath>
15
16namespace Mantid {
17namespace CurveFitting {
18namespace Functions {
36class MANTID_CURVEFITTING_DLL Gaussian : public API::IPeakFunction {
37public:
38 Gaussian();
40 double centre() const override;
41 std::string getWidthParameterName() const override { return "Sigma"; }
42 double height() const override;
43 double fwhm() const override;
44 double intensity() const override;
45 double intensityError() const override;
46 void setCentre(const double c) override;
47 void setHeight(const double h) override;
48 void setFwhm(const double w) override;
49 void setIntensity(const double i) override;
50
51 void fixCentre(bool isDefault = false) override;
52 void unfixCentre() override;
53 void fixIntensity(bool isDefault = false) override;
54 void unfixIntensity() override;
55
57 std::string name() const override { return "Gaussian"; }
58 const std::string category() const override { return "Peak; Muon\\MuonModelling"; }
59 void setActiveParameter(size_t i, double value) override;
60 double activeParameter(size_t i) const override;
61
62protected:
63 void functionLocal(double *out, const double *xValues, const size_t nData) const override;
64 void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override;
66 void init() override;
68 void histogram1D(double *out, double left, const double *right, const size_t nBins) const override;
70 void histogramDerivative1D(API::Jacobian *jacobian, double left, const double *right,
71 const size_t nBins) const override;
73 mutable double m_intensityCache;
74};
75
76} // namespace Functions
77} // namespace CurveFitting
78} // namespace Mantid
double value
The value of the point.
Definition FitMW.cpp:51
double height
Definition GetAllEi.cpp:155
double left
double right
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
Represents the Jacobian in IFitFunction::functionDeriv.
Definition Jacobian.h:22
Provide gaussian peak shape function interface to IPeakFunction.
Definition Gaussian.h:36
const std::string category() const override
The categories the Fit function belong to.
Definition Gaussian.h:58
std::string name() const override
overwrite IFunction base class methods
Definition Gaussian.h:57
double m_intensityCache
Intensity cache to help recover form Sigma==0 situation.
Definition Gaussian.h:73
std::string getWidthParameterName() const override
Get the name of the parameter that is changed when the fwhm is changed.
Definition Gaussian.h:41
Helper class which provides the Collimation Length for SANS instruments.