Mantid
Loading...
Searching...
No Matches
Lorentzian.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
15namespace Mantid {
16namespace CurveFitting {
17namespace Functions {
32class MANTID_CURVEFITTING_DLL Lorentzian : public API::IPeakFunction {
33public:
34 Lorentzian();
36 double centre() const override { return getParameter("PeakCentre"); }
37 double height() const override;
38 double fwhm() const override { return getParameter("FWHM"); }
39 double intensity() const override { return getParameter("Amplitude"); }
40 double intensityError() const override { return getError("Amplitude"); }
41 void setCentre(const double c) override { setParameter("PeakCentre", c); }
42 void setHeight(const double h) override;
43 void setFwhm(const double w) override;
44 void setIntensity(const double i) override { setParameter("Amplitude", i); }
45 void fixCentre(bool isDefault = false) override;
46 void unfixCentre() override;
47 void fixIntensity(bool isDefault = false) override;
48 void unfixIntensity() override;
49
51 std::string name() const override { return "Lorentzian"; }
52 const std::string category() const override { return "Peak; Muon\\MuonModelling"; }
53
54protected:
55 void functionLocal(double *out, const double *xValues, const size_t nData) const override;
56 void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override;
58 void init() override;
60 void histogram1D(double *out, double left, const double *right, const size_t nBins) const override;
62 void histogramDerivative1D(API::Jacobian *jacobian, double left, const double *right,
63 const size_t nBins) const override;
64
65private:
71};
72
73} // namespace Functions
74} // namespace CurveFitting
75} // namespace Mantid
double height
Definition: GetAllEi.cpp:155
double left
Definition: LineProfile.cpp:80
double right
Definition: LineProfile.cpp:81
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
Definition: IPeakFunction.h:51
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
Provide lorentzian peak shape function interface to IPeakFunction.
Definition: Lorentzian.h:32
double centre() const override
overwrite IPeakFunction base class methods
Definition: Lorentzian.h:36
double intensity() const override
Returns the integral intensity of the peak.
Definition: Lorentzian.h:39
double intensityError() const override
Error in the integrated intensity of the peak due to uncertainties in the values of the fit parameter...
Definition: Lorentzian.h:40
void setCentre(const double c) override
Sets the parameters such that centre == c.
Definition: Lorentzian.h:41
std::string name() const override
overwrite IFunction base class methods
Definition: Lorentzian.h:51
const std::string category() const override
The categories the Fit function belong to.
Definition: Lorentzian.h:52
double fwhm() const override
Returns the peak FWHM.
Definition: Lorentzian.h:38
bool m_amplitudeEqualHeight
When Amplitude is set via setHeight() and fwhm() == 0 height is made equal to Amplitude.
Definition: Lorentzian.h:70
void setIntensity(const double i) override
Sets the integral intensity of the peak.
Definition: Lorentzian.h:44
Helper class which provides the Collimation Length for SANS instruments.