Mantid
Loading...
Searching...
No Matches
FitMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include <utility>
13
15#include "MantidMDAlgorithms/DllConfig.h"
16
17namespace Mantid {
18
19namespace API {
20class FunctionDomain;
21class FunctionDomainMD;
22class IMDWorkspace;
23class IMDEventWorkspace;
24class IMDHistoWorkspace;
25} // namespace API
26
27namespace MDAlgorithms {
34class MANTID_MDALGORITHMS_DLL FitMD : public API::IDomainCreator {
35public:
37 FitMD();
39 FitMD(Kernel::IPropertyManager *fit, const std::string &workspacePropertyName, DomainType domainType = Simple);
41 FitMD(DomainType domainType)
42 : API::IDomainCreator(nullptr, std::vector<std::string>(), domainType), m_startIndex(0), m_count(0) {}
44 void initialize(Kernel::IPropertyManager *pm, const std::string &workspacePropertyName,
45 DomainType domainType) override;
46
49 void declareDatasetProperties(const std::string &suffix = "", bool addProp = true) override;
51 void createDomain(std::shared_ptr<API::FunctionDomain> &, std::shared_ptr<API::FunctionValues> &, size_t i0) override;
52 std::shared_ptr<API::Workspace>
53 createOutputWorkspace(const std::string &baseName, API::IFunction_sptr function,
54 std::shared_ptr<API::FunctionDomain> domain, std::shared_ptr<API::FunctionValues> values,
55 const std::string &outputWorkspacePropertyName = "OutputWorkspace") override;
56
58 size_t getDomainSize() const override;
60 void setWorkspace(std::shared_ptr<API::IMDWorkspace> IMDWorkspace) { m_IMDWorkspace = std::move(IMDWorkspace); }
62 void setRange(size_t startIndex, size_t count);
65 void setMaxSize(size_t maxSize) { m_maxSize = maxSize; }
66
67protected:
69 void setParameters() const;
71 std::shared_ptr<API::Workspace> createEventOutputWorkspace(const std::string &baseName,
72 const API::IMDEventWorkspace &inputWorkspace,
73 const API::FunctionValues &values,
74 const std::string &outputWorkspacePropertyName);
76 std::shared_ptr<API::Workspace>
77 createHistoOutputWorkspace(const std::string &baseName, const API::IFunction_sptr &function,
78 const std::shared_ptr<const API::IMDHistoWorkspace> &inputWorkspace,
79 const std::string &outputWorkspacePropertyName);
80
86 mutable std::shared_ptr<API::IMDWorkspace> m_IMDWorkspace;
88 mutable size_t m_maxSize;
92 size_t m_count;
93};
94
95} // namespace MDAlgorithms
96} // namespace Mantid
int count
counter
Definition: Matrix.cpp:37
A class to store values calculated by a function.
An base class for domain creators for use in Fit.
DomainType
Type of domain to create.
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
Basic MD Workspace Abstract Class.
Definition: IMDWorkspace.h:40
Interface to PropertyManager.
Creates FunctionDomainMD from an IMDWorkspace.
Definition: FitMD.h:34
std::string m_maxSizePropertyName
Store maxSize property name.
Definition: FitMD.h:84
size_t m_maxSize
Max size for seq domain.
Definition: FitMD.h:88
size_t m_count
Size of the domain if part of the workspace is used.
Definition: FitMD.h:92
std::string m_workspacePropertyName
Store workspace property name.
Definition: FitMD.h:82
void setMaxSize(size_t maxSize)
Set max size for Sequantial and Parallel domains.
Definition: FitMD.h:65
size_t m_startIndex
Starting index.
Definition: FitMD.h:90
std::shared_ptr< API::IMDWorkspace > m_IMDWorkspace
The input IMDWorkspace.
Definition: FitMD.h:86
void setWorkspace(std::shared_ptr< API::IMDWorkspace > IMDWorkspace)
Set the workspace.
Definition: FitMD.h:60
FitMD(DomainType domainType)
Constructor.
Definition: FitMD.h:41
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.