Mantid
Loading...
Searching...
No Matches
ThermalNeutronBk2BkExpConvPVoigt.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
13#include <complex>
14
15namespace Mantid {
16namespace CurveFitting {
17namespace Functions {
18
26class MANTID_CURVEFITTING_DLL ThermalNeutronBk2BkExpConvPVoigt : public API::IPowderDiffPeakFunction {
27public:
29
31 std::string name() const override { return "ThermalNeutronBk2BkExpConvPVoigt"; }
32 const std::string category() const override { return "General"; }
33
35 /*
36 virtual double centre()const;
37
38 virtual double fwhm()const;
39 virtual void setHeight(const double h);
40 virtual void setPeakRadius(const int& r);
41 */
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 double getPeakParameter(const std::string &) override;
53
55 void calculateParameters(bool explicitoutput) const override;
56
58 // void functionLocal(vector<double>& out, const vector<double> &xValues)
59 // const;
60
62 /*
63 void setUnitCellParameterValueChangeFlag(bool changed)
64 {
65 m_cellParamValueChanged = changed;
66 }
67 */
68
70 void setParameter(size_t i, const double &value, bool explicitlySet = true) override;
71
73 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
74
76 // virtual void setHeight(const double h);
78 // virtual double height()const;
79
80 using IFunction1D::function;
81 void function(std::vector<double> &out, const std::vector<double> &xValues) const override;
82
84 void function1D(double *out, const double *xValues, const size_t nData) const override;
85
86private:
87 //----- Overwrite IFunction ------------------------------------------------
89 void functionLocal(double *out, const double *xValues, const size_t nData) const;
91 virtual void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData);
93 void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) override;
94
96 void init() override;
97
98 static int s_peakRadius;
99
100 //-------- Private Functions -----------------------------------
102 void calHandEta(double sigma2, double gamma, double &H, double &eta) const;
103
105 double calPeakCenter() const;
106
108 double calOmega(const double x, const double eta, const double N, const double alpha, const double beta,
109 const double H, const double sigma2, const double invert_sqrt2sigma,
110 const bool explicitoutput = false) const;
111
113 /*
114 virtual void setCentre(const double c);
115 virtual void setFwhm(const double w);
116 */
117
118 //------------------------------------------ Variables
119 //--------------------------------------
120
122 mutable double m_Alpha;
123 mutable double m_Beta;
124 mutable double m_Sigma2;
125 mutable double m_Gamma;
126
128 // mutable double m_fwhm;
129
131 // mutable double m_centre;
132 // mutable double m_dcentre;
133
135 mutable double m_eta;
136 mutable double m_N;
137
139
140 //----------- For Parallelization -----------------------------------------
142 void interruption_point() const;
144 mutable bool m_cancel;
148 mutable bool m_dspaceCalculated;
149
152 // mutable bool m_newValueSet;
153};
154
156using ThermalNeutronBk2BkExpConvPVoigt_sptr = std::shared_ptr<ThermalNeutronBk2BkExpConvPVoigt>;
157
158//--- Public inline function --------------------------------------------------
169
170// std::complex<double> E1X(std::complex<double> z);
171
172} // namespace Functions
173} // namespace CurveFitting
174} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
Base class that represents the domain of a function.
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
ThermalNeutronBk2BkExpConvPVoigt : Back-to-back exponential convoluted with pseudo Voigt for thermal ...
std::string name() const override
Overwrite IFunction base class methods.
void interruption_point() const
Override setting a new value to the.
bool m_parallelException
Set if an exception is thrown, and not caught, within a parallel region.
bool m_dspaceCalculated
Flag to show whether the unit cell has been calcualted.
const std::string category() const override
The categories the Fit function belong to.
std::shared_ptr< ThermalNeutronBk2BkExpConvPVoigt > ThermalNeutronBk2BkExpConvPVoigt_sptr
Shared pointer to ThermalNeutronBk2BkExpConvPVoigt peak/function.
Helper class which provides the Collimation Length for SANS instruments.