Mantid
Loading...
Searching...
No Matches
QENSFitSequential.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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
13#include "MantidCurveFitting/DllConfig.h"
15
16#include <set>
17
18namespace Mantid {
19namespace CurveFitting {
20namespace Algorithms {
21
25class MANTID_CURVEFITTING_DLL QENSFitSequential : public API::DataProcessorAlgorithm {
26public:
27 const std::string name() const override;
28 int version() const override;
29 const std::string category() const override;
30 const std::string summary() const override;
31 const std::vector<std::string> seeAlso() const override;
32
33protected:
34 std::map<std::string, std::string> validateInputs() override;
35 virtual std::vector<API::MatrixWorkspace_sptr> getWorkspaces() const;
36 virtual std::map<std::string, std::string> getAdditionalLogStrings() const;
37 virtual std::map<std::string, std::string> getAdditionalLogNumbers() const;
38 virtual API::ITableWorkspace_sptr processParameterTable(API::ITableWorkspace_sptr parameterTable);
39 virtual std::vector<std::string> getFitParameterNames() const;
40
41private:
42 void init() override;
43 void exec() override;
44 API::ITableWorkspace_sptr performFit(const std::string &input, const std::string &output);
45 void deleteTemporaryWorkspaces(const std::string &outputBaseName);
46 void addAdditionalLogs(const API::WorkspaceGroup_sptr &resultWorkspace);
47 void addAdditionalLogs(const API::Workspace_sptr &result);
48 void addFitRangeLogs(const API::Workspace_sptr &resultWorkspace, size_t itter);
49
50 virtual bool throwIfElasticQConversionFails() const;
51 virtual bool isFitParameter(const std::string &parameterName) const;
52 std::set<std::string> getUniqueParameterNames() const;
53 std::string getOutputBaseName() const;
54 std::string getInputString(const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
55 std::vector<std::size_t> getDatasetGrouping(const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
56 API::WorkspaceGroup_sptr processIndirectFitParameters(const API::ITableWorkspace_sptr &parameterWorkspace,
57 const std::vector<std::size_t> &grouping);
58
59 std::vector<API::MatrixWorkspace_sptr>
60 convertInputToElasticQ(const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
61
62 void renameWorkspaces(API::WorkspaceGroup_sptr outputGroup, std::vector<std::string> const &spectra,
63 std::string const &outputBaseName, std::string const &endOfSuffix);
64 void renameWorkspaces(API::WorkspaceGroup_sptr outputGroup, std::vector<std::string> const &spectra,
65 std::string const &outputBaseName, std::string const &endOfSuffix,
66 std::vector<std::string> const &names);
67 void renameGroupWorkspace(std::string const &currentName, std::vector<std::string> const &spectra,
68 std::string const &outputBaseName, std::string const &endOfSuffix);
69 void copyLogs(const API::WorkspaceGroup_sptr &resultWorkspaces,
70 std::vector<API::MatrixWorkspace_sptr> const &workspaces);
71 void copyLogs(const API::Workspace_sptr &resultWorkspace, std::vector<API::MatrixWorkspace_sptr> const &workspaces);
72 void copyLogs(const API::MatrixWorkspace_sptr &resultWorkspace, const API::WorkspaceGroup_sptr &resultGroup);
73 void copyLogs(const API::MatrixWorkspace_sptr &resultWorkspace, const API::Workspace_sptr &resultGroup);
74 void extractMembers(const API::WorkspaceGroup_sptr &resultGroupWs,
75 const std::vector<API::MatrixWorkspace_sptr> &workspaces, const std::string &outputWsName);
76
77 API::IAlgorithm_sptr extractMembersAlgorithm(const API::WorkspaceGroup_sptr &resultGroupWs,
78 const std::string &outputWsName) const;
79
80 std::string getTemporaryName() const;
81};
82
83} // namespace Algorithms
84} // namespace CurveFitting
85} // namespace Mantid
Data processor algorithm to be used as a parent to workflow algorithms.
QENSFitSequential - Performs a sequential QENS fit.
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.