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
12#include <complex>
13
14namespace Mantid {
15namespace CurveFitting {
16namespace Functions {
17
25class MANTID_CURVEFITTING_DLL ThermalNeutronBk2BkExpConvPVoigt : public API::IPowderDiffPeakFunction {
26public:
28
30 std::string name() const override { return "ThermalNeutronBk2BkExpConvPVoigt"; }
31 const std::string category() const override { return "General"; }
32
34 /*
35 virtual double centre()const;
36
37 virtual double fwhm()const;
38 virtual void setHeight(const double h);
39 virtual void setPeakRadius(const int& r);
40 */
41
42 //--------------- ThermalNeutron peak function special
43 //---------------------------------------
45 // virtual void setMillerIndex(int h, int k, int l);
46
48 // virtual void getMillerIndex(int& h, int &k, int &l);
49
51 double getPeakParameter(const std::string &) override;
52
54 void calculateParameters(bool explicitoutput) const override;
55
57 // void functionLocal(vector<double>& out, const vector<double> &xValues)
58 // const;
59
61 /*
62 void setUnitCellParameterValueChangeFlag(bool changed)
63 {
64 m_cellParamValueChanged = changed;
65 }
66 */
67
69 void setParameter(size_t i, const double &value, bool explicitlySet = true) override;
70
72 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
73
75 // virtual void setHeight(const double h);
77 // virtual double height()const;
78
79 using IFunction1D::function;
80 void function(std::vector<double> &out, const std::vector<double> &xValues) const override;
81
83 void function1D(double *out, const double *xValues, const size_t nData) const override;
84
85private:
86 //----- Overwrite IFunction ------------------------------------------------
88 void functionLocal(double *out, const double *xValues, const size_t nData) const;
90 virtual void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData);
92 void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) override;
93
95 void init() override;
96
97 static int s_peakRadius;
98
99 //-------- Private Functions -----------------------------------
101 void calHandEta(double sigma2, double gamma, double &H, double &eta) const;
102
104 double calPeakCenter() const;
105
107 double calOmega(const double x, const double eta, const double N, const double alpha, const double beta,
108 const double H, const double sigma2, const double invert_sqrt2sigma,
109 const bool explicitoutput = false) const;
110
112 /*
113 virtual void setCentre(const double c);
114 virtual void setFwhm(const double w);
115 */
116
117 //------------------------------------------ Variables
118 //--------------------------------------
119
121 mutable double m_Alpha;
122 mutable double m_Beta;
123 mutable double m_Sigma2;
124 mutable double m_Gamma;
125
127 // mutable double m_fwhm;
128
130 // mutable double m_centre;
131 // mutable double m_dcentre;
132
134 mutable double m_eta;
135 mutable double m_N;
136
138
139 //----------- For Parallelization -----------------------------------------
141 void interruption_point() const;
143 mutable bool m_cancel;
147 mutable bool m_dspaceCalculated;
148
151 // mutable bool m_newValueSet;
152};
153
155using ThermalNeutronBk2BkExpConvPVoigt_sptr = std::shared_ptr<ThermalNeutronBk2BkExpConvPVoigt>;
156
157//--- Public inline function --------------------------------------------------
168
169// std::complex<double> E1X(std::complex<double> z);
170
171} // namespace Functions
172} // namespace CurveFitting
173} // namespace Mantid
std::string name
Definition Run.cpp:60
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.