Mantid
Loading...
Searching...
No Matches
PseudoVoigt.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 "MantidCurveFitting/DllConfig.h"
11
12namespace Mantid {
13namespace CurveFitting {
14namespace Functions {
15
35class MANTID_CURVEFITTING_DLL PseudoVoigt : public API::IPeakFunction {
36public:
37 double centre() const override { return getParameter("PeakCentre"); }
38 double intensity() const override { return getParameter("Intensity"); }
39 double intensityError() const override { return getError("Intensity"); }
40 double height() const override;
41 double fwhm() const override { return getParameter("FWHM"); }
42
43 void setCentre(const double c) override { setParameter("PeakCentre", c); }
44 void setHeight(const double h) override;
45 void setFwhm(const double w) override;
46 void setIntensity(const double newIntensity) override { setParameter("Intensity", newIntensity); }
47
48 std::string name() const override { return "PseudoVoigt"; }
49 const std::string category() const override { return "Peak"; }
50
52 void setParameter(size_t i, const double &value, bool explicitlySet = true) override;
54 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
55
56protected:
57 void functionLocal(double *out, const double *xValues, const size_t nData) const override;
58
59 void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override;
60
61 void init() override;
62
63private:
65 std::vector<size_t> m_set_history_distances;
66 void update_set_history(size_t set_index);
69 size_t get_parameter_to_calculate_from_set();
70 bool estimate_parameter_value();
71
72 double m_height;
73};
74
75} // namespace Functions
76} // namespace CurveFitting
77} // namespace Mantid
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
double height
Definition GetAllEi.cpp:155
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
double fwhm() const override
Returns the peak FWHM.
Definition PseudoVoigt.h:41
double centre() const override
Returns the centre of the function, which may be something as simple as the centre of the fitting ran...
Definition PseudoVoigt.h:37
double intensityError() const override
Error in the integrated intensity of the peak due to uncertainties in the values of the fit parameter...
Definition PseudoVoigt.h:39
const std::string category() const override
The categories the Fit function belong to.
Definition PseudoVoigt.h:49
double intensity() const override
Returns the integral intensity of the peak.
Definition PseudoVoigt.h:38
std::string name() const override
Returns the function's name.
Definition PseudoVoigt.h:48
void setCentre(const double c) override
Sets the parameters such that centre == c.
Definition PseudoVoigt.h:43
std::vector< size_t > m_set_history_distances
historty of the order to be set
Definition PseudoVoigt.h:65
void setIntensity(const double newIntensity) override
Sets the integral intensity of the peak.
Definition PseudoVoigt.h:46
Helper class which provides the Collimation Length for SANS instruments.