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 virtual void setPeakRadius(const int &r);
42
43 //--------------- ThermalNeutron peak function special
44 //---------------------------------------
46 virtual void setMillerIndex(int h, int k, int l);
47
49 virtual void getMillerIndex(int &h, int &k, int &l);
50
52 virtual double getPeakParameter(const std::string &) = 0;
53
55 virtual void calculateParameters(bool explicitoutput) const = 0;
56
58 virtual void setUnitCellParameterValueChangeFlag(bool changed) { m_cellParamValueChanged = changed; }
59
62 virtual bool isPhysical() { return m_parameterValid; }
63
65 void setParameter(size_t i, const double &value, bool explicitlySet = true) override;
66
68 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
69
71 virtual bool hasProfileParameter(std::string paramname);
72
73 // void functionLocal(double* out, const double* xValues, const size_t
74 // nData)const;
75
77 using IFunction1D::function;
78 virtual void function(std::vector<double> &out, const std::vector<double> &xValues) const = 0;
79
81 virtual double getMaximumValue(const std::vector<double> &xValues, size_t &indexmax) const;
82
83protected:
85 // virtual void functionLocal(double*, const double*, int&) const = 0;
86
88 // virtual void functionLocal(vector<double> &out, const vector<double>
89 // &xValues) const = 0;
90
95
97 // void functionDerivLocal(Jacobian* out, const double* xValues, const size_t
98 // nData) const;
99
102 static int s_peakRadius;
103
105 mutable double m_centre;
107 mutable double m_dcentre;
109 mutable double m_fwhm;
110
115
117 std::vector<std::string> m_sortedProfileParameterNames;
118
121
124
126 mutable bool m_parameterValid;
127
129 mutable int mH;
130 mutable int mK;
131 mutable int mL;
132 mutable bool mHKLSet;
133
136};
137
138using IPowderDiffPeakFunction_sptr = std::shared_ptr<IPowderDiffPeakFunction>;
139
141std::complex<double> MANTID_API_DLL E1(std::complex<double> z);
142
143} // namespace API
144} // namespace Mantid
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.
Definition: ParamFunction.h:33
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.