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#include <boost/optional.hpp>
12#include <memory>
13#include <vector>
14
15namespace MantidQt {
16namespace MantidWidgets {
17
18using namespace Mantid::API;
19
21public:
22 void setFunction(IFunction_sptr) override;
23 void setModel(const std::string &background, const std::string &workspace, int workspaceIndex,
24 const std::string &peaks, bool hasDeltaFunction);
25 void setModel(const std::string &background, const std::vector<std::pair<std::string, size_t>> &resolutionWorkspaces,
26 const std::string &lorentzianPeaks, const std::string &fitType, bool hasDeltaFunction,
27 const std::vector<double> &qValues, const bool isQDependent, bool hasTempCorrection, double tempValue);
28 boost::optional<QString> backgroundPrefix() const { return m_backgroundPrefix; }
29 boost::optional<QString> convolutionPrefix() const { return m_convolutionPrefix; }
30 boost::optional<QString> deltaFunctionPrefix() const { return m_deltaFunctionPrefix; }
31 boost::optional<QString> tempFunctionPrefix() const { return m_tempFunctionPrefix; }
32 boost::optional<QStringList> peakPrefixes() const { return m_peakPrefixes; }
33 boost::optional<QString> fitTypePrefix() const { return m_fitTypePrefix; }
34
35 std::string resolutionWorkspace() const { return m_resolutionWorkspace; }
36 int resolutionWorkspaceIndex() const { return m_resolutionWorkspaceIndex; }
37
38private:
39 void findComponentPrefixes();
40 void iterateThroughFunction(IFunction *func, const QString &prefix);
41 void setPrefix(IFunction *func, const QString &prefix);
42
43 CompositeFunction_sptr createInnerFunction(const std::string &lorentzianPeaks, const std::string &fitType,
44 bool hasDeltaFunction, bool isQDependent, double q, bool hasTempCorrection,
45 double tempValue);
46 CompositeFunction_sptr addTempCorrection(const CompositeFunction_sptr &peaksFunction, double tempValue);
47 IFunction_sptr createTemperatureCorrection(double correction);
48 CompositeFunction_sptr createConvolutionFunction(IFunction_sptr resolutionFunction,
49 const IFunction_sptr &innerFunction);
50 IFunction_sptr createResolutionFunction(const std::string &workspaceName, size_t workspaceIndex);
51 CompositeFunction_sptr addBackground(CompositeFunction_sptr domainFunction, const std::string &background);
52 boost::optional<QString> m_backgroundPrefix;
53 boost::optional<QString> m_convolutionPrefix;
54 boost::optional<QString> m_deltaFunctionPrefix;
55 boost::optional<QString> m_tempFunctionPrefix;
56 boost::optional<QString> m_fitTypePrefix;
57 boost::optional<QStringList> m_peakPrefixes;
60};
61
62} // namespace MantidWidgets
63} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
boost::optional< QString > deltaFunctionPrefix() const
boost::optional< QStringList > peakPrefixes() const
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
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:732
std::shared_ptr< CompositeFunction > CompositeFunction_sptr
shared pointer to the composite function base class