-
Notifications
You must be signed in to change notification settings - Fork 122
/
Bk2BkExpConvPV.h
77 lines (60 loc) · 2.72 KB
/
Bk2BkExpConvPV.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/IFunctionMW.h"
#include "MantidAPI/IPeakFunction.h"
#include "MantidCurveFitting/DllConfig.h"
#include "MantidKernel/System.h"
#include <complex>
namespace Mantid {
namespace CurveFitting {
namespace Functions {
/** Bk2BkExpConvPV : Peak profile as tback-to-back exponential convoluted with
pseudo-Voigt.
It is peak profile No. 10 in Fullprof.
@date 2012-06-06
*/
class MANTID_CURVEFITTING_DLL Bk2BkExpConvPV : virtual public API::IPeakFunction, virtual public API::IFunctionMW {
public:
/// Default constructor.
Bk2BkExpConvPV() = default;
/// overwrite IPeakFunction base class methods
double centre() const override;
double height() const override;
double fwhm() const override;
void setCentre(const double c) override;
void setHeight(const double h) override;
void setFwhm(const double w) override;
/// overwrite IFunction base class methods
std::string name() const override { return "Bk2BkExpConvPV"; }
const std::string category() const override { return "Peak"; }
/// Set up the range of peak calculation for higher efficiency
// void setCalculationRange(double tof_low, double tof_upper);
/// Calculate peak
void geneatePeak(double *out, const double *xValues, const size_t nData);
void setMatrixWorkspace(std::shared_ptr<const API::MatrixWorkspace> workspace, size_t wi, double startX,
double endX) override;
protected:
void functionLocal(double *out, const double *xValues, const size_t nData) const override;
void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override;
void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) override;
/// overwrite IFunction base class method, which declare function parameters
void init() override;
private:
/// container for storing wavelength values for each data point
mutable std::vector<double> m_dtt1;
double calOmega(double x, double eta, double N, double alpha, double beta, double H, double sigma2,
double invert_sqrt2sigma) const;
std::complex<double> E1(std::complex<double> z) const;
void calHandEta(double sigma2, double gamma, double &H, double &eta) const;
double expWidth() const;
};
// using TableWorkspace_sptr = std::shared_ptr<TableWorkspace>;
using Bk2BkExpConvPV_sptr = std::shared_ptr<Bk2BkExpConvPV>;
} // namespace Functions
} // namespace CurveFitting
} // namespace Mantid