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#include "MantidKernel/System.h"
12
13namespace Mantid {
14namespace CurveFitting {
15namespace Functions {
16
36class MANTID_CURVEFITTING_DLL PseudoVoigt : public API::IPeakFunction {
37public:
38 double centre() const override { return getParameter("PeakCentre"); }
39 double intensity() const override { return getParameter("Intensity"); }
40 double intensityError() const override { return getError("Intensity"); }
41 double height() const override;
42 double fwhm() const override { return getParameter("FWHM"); }
43
44 void setCentre(const double c) override { setParameter("PeakCentre", c); }
45 void setHeight(const double h) override;
46 void setFwhm(const double w) override;
47 void setIntensity(const double newIntensity) override { setParameter("Intensity", newIntensity); }
48
49 std::string name() const override { return "PseudoVoigt"; }
50 const std::string category() const override { return "Peak"; }
51
53 void setParameter(size_t i, const double &value, bool explicitlySet = true) override;
55 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
56
57protected:
58 void functionLocal(double *out, const double *xValues, const size_t nData) const override;
59
60 void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override;
61
62 void init() override;
63
64private:
66 std::vector<size_t> m_set_history_distances;
67 void update_set_history(size_t set_index);
70 size_t get_parameter_to_calculate_from_set();
71 bool estimate_parameter_value();
72
73 double m_height;
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
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
double fwhm() const override
Returns the peak FWHM.
Definition: PseudoVoigt.h:42
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:38
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:40
const std::string category() const override
The categories the Fit function belong to.
Definition: PseudoVoigt.h:50
double intensity() const override
Returns the integral intensity of the peak.
Definition: PseudoVoigt.h:39
std::string name() const override
Returns the function's name.
Definition: PseudoVoigt.h:49
void setCentre(const double c) override
Sets the parameters such that centre == c.
Definition: PseudoVoigt.h:44
std::vector< size_t > m_set_history_distances
historty of the order to be set
Definition: PseudoVoigt.h:66
void setIntensity(const double newIntensity) override
Sets the integral intensity of the peak.
Definition: PseudoVoigt.h:47
Helper class which provides the Collimation Length for SANS instruments.