Mantid
Loading...
Searching...
No Matches
Bk2BkExpConvPV.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
11#include "MantidCurveFitting/DllConfig.h"
12#include "MantidKernel/System.h"
13#include <complex>
14
15namespace Mantid {
16namespace CurveFitting {
17namespace Functions {
18
25class MANTID_CURVEFITTING_DLL Bk2BkExpConvPV : virtual public API::IPeakFunction, virtual public API::IFunctionMW {
26public:
28 Bk2BkExpConvPV() = default;
29
31 double centre() const override;
32 double height() const override;
33 double fwhm() const override;
34 void setCentre(const double c) override;
35 void setHeight(const double h) override;
36 void setFwhm(const double w) override;
37
39 std::string name() const override { return "Bk2BkExpConvPV"; }
40 const std::string category() const override { return "Peak"; }
41
43 // void setCalculationRange(double tof_low, double tof_upper);
45 void geneatePeak(double *out, const double *xValues, const size_t nData);
46
47 void setMatrixWorkspace(std::shared_ptr<const API::MatrixWorkspace> workspace, size_t wi, double startX,
48 double endX) override;
49
50protected:
51 void functionLocal(double *out, const double *xValues, const size_t nData) const override;
52 void functionDerivLocal(API::Jacobian *out, const double *xValues, const size_t nData) override;
53 void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) override;
54
56 void init() override;
57
58private:
60 mutable std::vector<double> m_dtt1;
61
62 double calOmega(double x, double eta, double N, double alpha, double beta, double H, double sigma2,
63 double invert_sqrt2sigma) const;
64
65 std::complex<double> E1(std::complex<double> z) const;
66
67 void calHandEta(double sigma2, double gamma, double &H, double &eta) const;
68 double expWidth() const;
69};
70
71// using TableWorkspace_sptr = std::shared_ptr<TableWorkspace>;
72
73using Bk2BkExpConvPV_sptr = std::shared_ptr<Bk2BkExpConvPV>;
74
75} // namespace Functions
76} // namespace CurveFitting
77} // namespace Mantid
double height
Definition: GetAllEi.cpp:155
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class that represents the domain of a function.
This is a specialization of IFunction for functions defined on a MatrixWorkspace.
Definition: IFunctionMW.h:30
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
Definition: IPeakFunction.h:51
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
Bk2BkExpConvPV : Peak profile as tback-to-back exponential convoluted with pseudo-Voigt.
std::complex< double > E1(std::complex< double > z) const
const std::string category() const override
The categories the Fit function belong to.
std::vector< double > m_dtt1
container for storing wavelength values for each data point
std::string name() const override
overwrite IFunction base class methods
Bk2BkExpConvPV()=default
Default constructor.
std::shared_ptr< Bk2BkExpConvPV > Bk2BkExpConvPV_sptr
Helper class which provides the Collimation Length for SANS instruments.