Mantid
Loading...
Searching...
No Matches
QENSFitSimultaneous.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
12#include "MantidCurveFitting/DllConfig.h"
15
16namespace Mantid {
17namespace CurveFitting {
18namespace Algorithms {
19
23class MANTID_CURVEFITTING_DLL QENSFitSimultaneous : public IFittingAlgorithm {
24public:
25 const std::string name() const override;
26 int version() const override;
27 const std::string category() const override;
28 const std::string summary() const override;
29 const std::vector<std::string> seeAlso() const override;
30
31protected:
32 virtual std::vector<API::MatrixWorkspace_sptr> getWorkspaces() const;
33 virtual bool throwIfElasticQConversionFails() const;
34 virtual bool isFitParameter(const std::string &name) const;
35 std::set<std::string> getUniqueParameterNames() const;
36 virtual std::vector<std::string> getFitParameterNames() const;
37 virtual std::map<std::string, std::string> getAdditionalLogStrings() const;
38 virtual std::map<std::string, std::string> getAdditionalLogNumbers() const;
39 virtual API::ITableWorkspace_sptr processParameterTable(API::ITableWorkspace_sptr parameterTable);
40
41private:
42 void initConcrete() override;
43 void execConcrete() override;
44 std::vector<API::MatrixWorkspace_sptr>
45 convertInputToElasticQ(const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
46 std::pair<API::ITableWorkspace_sptr, API::Workspace_sptr>
47 performFit(const std::vector<API::MatrixWorkspace_sptr> &workspaces, const std::string &output);
48 API::WorkspaceGroup_sptr processIndirectFitParameters(const API::ITableWorkspace_sptr &parameterWorkspace,
49 const std::vector<std::size_t> &grouping);
50 void copyLogs(const API::WorkspaceGroup_sptr &resultWorkspace,
51 const std::vector<API::MatrixWorkspace_sptr> &workspaces);
52 void copyLogs(const API::MatrixWorkspace_sptr &resultWorkspace, const API::WorkspaceGroup_sptr &resultGroup);
53 void extractMembers(const API::WorkspaceGroup_sptr &resultGroupWs,
54 const std::vector<API::MatrixWorkspace_sptr> &workspaces, const std::string &outputWsName);
55 void addAdditionalLogs(const API::WorkspaceGroup_sptr &group);
56 void addAdditionalLogs(const API::Workspace_sptr &result);
57
58 API::IAlgorithm_sptr extractMembersAlgorithm(const API::WorkspaceGroup_sptr &resultGroupWs,
59 const std::string &outputWsName) const;
60
61 std::string getOutputBaseName() const;
62 std::vector<std::string> getWorkspaceNames() const;
63 std::vector<std::string> getWorkspaceIndices() const;
64 void renameWorkspaces(const 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 &inputWorkspaceNames);
67 void renameWorkspaces(const API::WorkspaceGroup_sptr &outputGroup, std::vector<std::string> const &spectra,
68 std::string const &outputBaseName, std::string const &endOfSuffix);
69};
70
71} // namespace Algorithms
72} // namespace CurveFitting
73} // namespace Mantid
QENSFitSimultaneous - Algorithm for performing a simultaneous QENS fit.
A base class for fitting algorithms.
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.