Mantid
Loading...
Searching...
No Matches
IPowderDiffPeakFunction.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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
12#include <complex>
13
14namespace Mantid {
15namespace API {
22class MANTID_API_DLL IPowderDiffPeakFunction : public virtual API::ParamFunction, public virtual API::IFunction1D {
23public:
26
28 // virtual const std::string name() = 0;
30 // virtual const std::string category(){ return "General"; }
31
33 virtual double centre() const;
35 virtual double height() const;
37 virtual double fwhm() const;
39 virtual void setHeight(const double h);
41 // cppcheck-suppress virtualCallInConstructor
42 virtual void setPeakRadius(const int &r);
43
44 //--------------- ThermalNeutron peak function special
45 //---------------------------------------
47 virtual void setMillerIndex(int h, int k, int l);
48
50 virtual void getMillerIndex(int &h, int &k, int &l);
51
53 virtual double getPeakParameter(const std::string &) = 0;
54
56 virtual void calculateParameters(bool explicitoutput) const = 0;
57
59 virtual void setUnitCellParameterValueChangeFlag(bool changed) { m_cellParamValueChanged = changed; }
60
63 virtual bool isPhysical() { return m_parameterValid; }
64
66 void setParameter(size_t i, const double &value, bool explicitlySet = true) override;
67
69 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
70
72 virtual bool hasProfileParameter(std::string paramname);
73
74 // void functionLocal(double* out, const double* xValues, const size_t
75 // nData)const;
76
78 using IFunction1D::function;
79 virtual void function(std::vector<double> &out, const std::vector<double> &xValues) const = 0;
80
82 virtual double getMaximumValue(const std::vector<double> &xValues, size_t &indexmax) const;
83
84protected:
86 // virtual void functionLocal(double*, const double*, int&) const = 0;
87
89 // virtual void functionLocal(vector<double> &out, const vector<double>
90 // &xValues) const = 0;
91
96
98 // void functionDerivLocal(Jacobian* out, const double* xValues, const size_t
99 // nData) const;
100
103 static int s_peakRadius;
104
106 mutable double m_centre;
108 mutable double m_dcentre;
110 mutable double m_fwhm;
111
116
118 std::vector<std::string> m_sortedProfileParameterNames;
119
122
125
127 mutable bool m_parameterValid;
128
130 mutable int mH;
131 mutable int mK;
132 mutable int mL;
133 mutable bool mHKLSet;
134
137};
138
139using IPowderDiffPeakFunction_sptr = std::shared_ptr<IPowderDiffPeakFunction>;
140
142std::complex<double> MANTID_API_DLL E1(std::complex<double> z);
143
144} // namespace API
145} // 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
This is a specialization of IFunction for functions of one real argument.
Definition IFunction1D.h:43
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
bool m_cellParamValueChanged
An indicator to re-calculate peak d-space position.
bool m_parameterValid
Flag to indicate whether peaks' parameters value can generate a valid peak.
virtual double getPeakParameter(const std::string &)=0
Get peak parameters.
virtual void setUnitCellParameterValueChangeFlag(bool changed)
Set up the flag to show whether (from client) cell parameter value changed.
virtual void calculateParameters(bool explicitoutput) const =0
Calculate peak parameters (alpha, beta, sigma2..)
virtual bool isPhysical()
The flag to show whether the parameters set to peak function making an valid peak.
bool m_hasNewParameterValue
Flag if any parameter value changed.
double m_dcentre
Centre of the peak in d-space.
virtual void function(std::vector< double > &out, const std::vector< double > &xValues) const =0
static int s_peakRadius
Local function for GSL minimizer.
std::vector< std::string > m_sortedProfileParameterNames
Peak profile parameters names in ascending order.
Implements the part of IFunction interface dealing with parameters.
Class to implement unit cell of crystals.
Definition UnitCell.h:44
std::complex< double > MANTID_API_DLL E1(std::complex< double > z)
Integral for Gamma.
std::shared_ptr< IPowderDiffPeakFunction > IPowderDiffPeakFunction_sptr
Helper class which provides the Collimation Length for SANS instruments.