Mantid
Loading...
Searching...
No Matches
ConvolutionFunctionModel.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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
9#include "DllOption.h"
10#include "FunctionModel.h"
11
12#include <memory>
13#include <optional>
14#include <vector>
15
16namespace MantidQt {
17namespace MantidWidgets {
18
19using namespace Mantid::API;
20
22public:
23 void setFunction(IFunction_sptr) override;
24 void setModel(const std::string &background, const std::string &workspace, int workspaceIndex,
25 const std::string &peaks, bool hasDeltaFunction);
26 void setModel(const std::string &background, const std::vector<std::pair<std::string, size_t>> &resolutionWorkspaces,
27 const std::string &lorentzianPeaks, const std::string &fitType, bool hasDeltaFunction,
28 const std::vector<double> &qValues, const bool isQDependent, bool hasTempCorrection, double tempValue);
29 std::optional<std::string> backgroundPrefix() const { return m_backgroundPrefix; }
30 std::optional<std::string> convolutionPrefix() const { return m_convolutionPrefix; }
31 std::optional<std::string> deltaFunctionPrefix() const { return m_deltaFunctionPrefix; }
32 std::optional<std::string> tempFunctionPrefix() const { return m_tempFunctionPrefix; }
33 std::optional<std::vector<std::string>> peakPrefixes() const { return m_peakPrefixes; }
34 std::optional<std::string> fitTypePrefix() const { return m_fitTypePrefix; }
35
36 const std::string &resolutionWorkspace() const { return m_resolutionWorkspace; }
37 int resolutionWorkspaceIndex() const { return m_resolutionWorkspaceIndex; }
38
39private:
40 void findComponentPrefixes();
41 void iterateThroughFunction(IFunction const *func, std::string const &prefix);
42 void setPrefix(IFunction const *func, std::string const &prefix);
43
44 CompositeFunction_sptr createInnerFunction(const std::string &lorentzianPeaks, const std::string &fitType,
45 bool hasDeltaFunction, bool isQDependent, double q, bool hasTempCorrection,
46 double tempValue);
47 CompositeFunction_sptr addTempCorrection(const CompositeFunction_sptr &peaksFunction, double tempValue);
48 IFunction_sptr createTemperatureCorrection(double correction);
49 CompositeFunction_sptr createConvolutionFunction(IFunction_sptr resolutionFunction,
50 const IFunction_sptr &innerFunction);
51 IFunction_sptr createResolutionFunction(const std::string &workspaceName, size_t workspaceIndex);
52 CompositeFunction_sptr addBackground(CompositeFunction_sptr domainFunction, const std::string &background);
53 std::optional<std::string> m_backgroundPrefix;
54 std::optional<std::string> m_convolutionPrefix;
55 std::optional<std::string> m_deltaFunctionPrefix;
56 std::optional<std::string> m_tempFunctionPrefix;
57 std::optional<std::string> m_fitTypePrefix;
58 std::optional<std::vector<std::string>> m_peakPrefixes;
61};
62
63} // namespace MantidWidgets
64} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
IPeaksWorkspace_sptr workspace
std::optional< std::string > deltaFunctionPrefix() const
std::optional< std::vector< std::string > > peakPrefixes() const
std::optional< std::vector< std::string > > m_peakPrefixes
std::optional< std::string > backgroundPrefix() const
std::optional< std::string > convolutionPrefix() const
std::optional< std::string > tempFunctionPrefix() const
This is an interface to a fitting function - a semi-abstarct class.
Definition IFunction.h:166
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition IFunction.h:743
std::shared_ptr< CompositeFunction > CompositeFunction_sptr
shared pointer to the composite function base class