Mantid
Loading...
Searching...
No Matches
IqtFit.cpp
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 +
8
12
13#include "MantidKernel/Logger.h"
14
15using namespace Mantid::API;
16
17namespace {
19} // namespace
20
22
23using namespace API;
24
26template <> const std::string IqtFit<QENSFitSequential>::name() const { return "IqtFitSequential"; }
27
28template <> const std::string IqtFit<QENSFitSimultaneous>::name() const { return "IqtFitSimultaneous"; }
29
30template <typename Base> const std::string IqtFit<Base>::name() const { return "IqtFit"; }
31
33template <typename Base> int IqtFit<Base>::version() const { return 1; }
34
36template <typename Base> const std::string IqtFit<Base>::category() const { return "Workflow\\MIDAS"; }
37
39template <> const std::string IqtFit<QENSFitSequential>::summary() const {
40 return "Fits data files (\\*\\_iqt) generated by I(Q, t) sequentially.";
41}
42
43template <> const std::string IqtFit<QENSFitSimultaneous>::summary() const {
44 return "Fits data files (\\*\\_iqt) generated by I(Q, t) simultaneously.";
45}
46
47template <typename Base> const std::string IqtFit<Base>::summary() const {
48 return "Fits an \\*\\_iqt file generated by I(Q, t) sequentially.";
49}
50
52template <> const std::vector<std::string> IqtFit<QENSFitSequential>::seeAlso() const { return {"QENSFitSequential"}; }
53
54template <> const std::vector<std::string> IqtFit<QENSFitSimultaneous>::seeAlso() const {
55 return {"QENSFitSimultaneous"};
56}
57
58template <typename Base> const std::vector<std::string> IqtFit<Base>::seeAlso() const { return {}; }
59
60template <> std::map<std::string, std::string> IqtFit<QENSFitSequential>::validateInputs() {
61 auto errors = QENSFitSequential::validateInputs();
62 const std::vector<double> startX = QENSFitSequential::getProperty("StartX");
63 for (const double &start : startX) {
64 if (start < 0) {
65 errors["StartX"] = "StartX must be greater than or equal to 0.";
66 }
67 }
68 return errors;
69}
70
71template <typename Base> std::map<std::string, std::string> IqtFit<Base>::validateInputs() {
72 return Base::validateInputs();
73}
74
75template <typename Base> bool IqtFit<Base>::isFitParameter(const std::string &name) const {
76 return name.rfind("A0") != std::string::npos || name.rfind("Height") != std::string::npos ||
77 name.rfind("Stretching") != std::string::npos || name.rfind("Lifetime") != std::string::npos;
78}
79
80template <typename Base> bool IqtFit<Base>::throwIfElasticQConversionFails() const { return true; }
81
82// Register the algorithms into the AlgorithmFactory
83template class IqtFit<QENSFitSequential>;
84template class IqtFit<QENSFitSimultaneous>;
85
88
91
92} // namespace Mantid::CurveFitting::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
Kernel::Logger g_log("ExperimentInfo")
static logger object