Mantid
|
Creates FunctionDomainMD from an IMDWorkspace. More...
#include <FitMD.h>
Public Member Functions | |
void | createDomain (std::shared_ptr< API::FunctionDomain > &, std::shared_ptr< API::FunctionValues > &, size_t i0) override |
Create a domain from the input workspace. More... | |
std::shared_ptr< API::Workspace > | createOutputWorkspace (const std::string &baseName, API::IFunction_sptr function, std::shared_ptr< API::FunctionDomain > domain, std::shared_ptr< API::FunctionValues > values, const std::string &outputWorkspacePropertyName="OutputWorkspace") override |
Create an output workspace filled with data simulated with the fitting function. More... | |
void | declareDatasetProperties (const std::string &suffix="", bool addProp=true) override |
declare properties that specify the dataset within the workspace to fit to. More... | |
FitMD () | |
Default constructor. More... | |
FitMD (DomainType domainType) | |
Constructor. More... | |
FitMD (Kernel::IPropertyManager *fit, const std::string &workspacePropertyName, DomainType domainType=Simple) | |
Constructor. More... | |
size_t | getDomainSize () const override |
Return the size of the domain to be created. More... | |
void | initialize (Kernel::IPropertyManager *pm, const std::string &workspacePropertyName, DomainType domainType) override |
Initialize. More... | |
void | setMaxSize (size_t maxSize) |
Set max size for Sequantial and Parallel domains. More... | |
void | setRange (size_t startIndex, size_t count) |
Set the range. More... | |
void | setWorkspace (std::shared_ptr< API::IMDWorkspace > IMDWorkspace) |
Set the workspace. More... | |
Public Member Functions inherited from Mantid::API::IDomainCreator | |
virtual void | createDomain (std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0=0)=0 |
Create a domain and values from the input workspace. More... | |
virtual std::shared_ptr< API::Workspace > | createOutputWorkspace (const std::string &baseName, API::IFunction_sptr function, std::shared_ptr< API::FunctionDomain > domain, std::shared_ptr< API::FunctionValues > values, const std::string &outputWorkspacePropertyName="OutputWorkspace") |
Create an output workspace filled with data simulated with the fitting function. More... | |
virtual void | declareDatasetProperties (const std::string &suffix="", bool addProp=true) |
Declare properties that specify the dataset within the workspace to fit to. More... | |
virtual size_t | getDomainSize () const =0 |
Return the size of the domain to be created. More... | |
IDomainCreator (Kernel::IPropertyManager *manager, std::vector< std::string > workspacePropertyNames, DomainType domainType=Simple) | |
Constrcutor. More... | |
void | ignoreInvalidData (bool yes) |
Set to ignore invalid data. More... | |
virtual void | initFunction (API::IFunction_sptr function) |
Initialize the function. More... | |
virtual void | initialize (Kernel::IPropertyManager *, const std::string &, DomainType) |
Initialize. More... | |
void | separateCompositeMembersInOutput (const bool value, const bool conv=false) |
Toggle output of either just composite or composite + members. More... | |
virtual | ~IDomainCreator ()=default |
Virtual destructor. More... | |
Protected Member Functions | |
std::shared_ptr< API::Workspace > | createEventOutputWorkspace (const std::string &baseName, const API::IMDEventWorkspace &inputWorkspace, const API::FunctionValues &values, const std::string &outputWorkspacePropertyName) |
Create event output workspace. More... | |
std::shared_ptr< API::Workspace > | createHistoOutputWorkspace (const std::string &baseName, const API::IFunction_sptr &function, const std::shared_ptr< const API::IMDHistoWorkspace > &inputWorkspace, const std::string &outputWorkspacePropertyName) |
Create histo output workspace. More... | |
void | setParameters () const |
Set all parameters. More... | |
Protected Member Functions inherited from Mantid::API::IDomainCreator | |
void | declareProperty (Kernel::Property *prop, const std::string &doc) |
Declare a property to the algorithm. More... | |
Protected Attributes | |
size_t | m_count |
Size of the domain if part of the workspace is used. More... | |
std::shared_ptr< API::IMDWorkspace > | m_IMDWorkspace |
The input IMDWorkspace. More... | |
size_t | m_maxSize |
Max size for seq domain. More... | |
std::string | m_maxSizePropertyName |
Store maxSize property name. More... | |
size_t | m_startIndex |
Starting index. More... | |
std::string | m_workspacePropertyName |
Store workspace property name. More... | |
Protected Attributes inherited from Mantid::API::IDomainCreator | |
bool | m_convolutionCompositeMembers |
Perform convolution of output composite components. More... | |
DomainType | m_domainType |
Domain type. More... | |
bool | m_ignoreInvalidData |
Flag to ignore nans, infinities and zero errors. More... | |
Kernel::IPropertyManager * | m_manager |
Pointer to a property manager. More... | |
bool | m_outputCompositeMembers |
Output separate composite function values. More... | |
std::vector< std::string > | m_workspacePropertyNames |
Property names for workspaces to get the data from. More... | |
Additional Inherited Members | |
Public Types inherited from Mantid::API::IDomainCreator | |
enum | DomainType { Simple = 0 , Sequential , Parallel } |
Type of domain to create. More... | |
Creates FunctionDomainMD from an IMDWorkspace.
Does not create any properties.
Mantid::MDAlgorithms::FitMD::FitMD | ( | ) |
Mantid::MDAlgorithms::FitMD::FitMD | ( | Kernel::IPropertyManager * | fit, |
const std::string & | workspacePropertyName, | ||
IDomainCreator::DomainType | domainType = Simple |
||
) |
Constructor.
Definition at line 43 of file FitMD.cpp.
References m_workspacePropertyName, Mantid::API::IDomainCreator::m_workspacePropertyNames, and Mantid::API::IDomainCreator::Simple.
|
inline |
|
overridevirtual |
Create a domain from the input workspace.
domain | :: The input domain |
ivalues | :: The calculated values |
i0 | :: Ignored currently |
Implements Mantid::API::IDomainCreator.
Definition at line 93 of file FitMD.cpp.
References Mantid::API::FunctionDomainMD::getNextIterator(), m_count, m_IMDWorkspace, m_startIndex, n, Mantid::API::FunctionDomainMD::reset(), setParameters(), and UNUSED_ARG.
|
protected |
Create event output workspace.
Create an output event workspace filled with data simulated with the fitting function.
baseName | :: The base name for the workspace |
inputWorkspace | :: The input workspace. |
values | :: The calculated values |
outputWorkspacePropertyName | :: The property name |
Definition at line 170 of file FitMD.cpp.
References Mantid::Geometry::MDHistoDimensionBuilder::create(), Mantid::API::IMDWorkspace::createIterator(), Mantid::DataObjects::MDEventFactory::CreateMDWorkspace(), Mantid::API::IDomainCreator::declareProperty(), Mantid::API::FunctionValues::getCalculated(), Mantid::API::MDGeometry::getDimension(), Mantid::API::MDGeometry::getNumDims(), Mantid::API::IMDWorkspace::getSpecialCoordinateSystem(), Mantid::Kernel::ThreadPool::joinAll(), Mantid::API::IDomainCreator::m_manager, Mantid::DataHandling::numEvents(), Mantid::Kernel::Direction::Output, Mantid::Geometry::MDHistoDimensionBuilder::setFrameName(), Mantid::Geometry::MDHistoDimensionBuilder::setId(), Mantid::Geometry::MDHistoDimensionBuilder::setMax(), Mantid::Geometry::MDHistoDimensionBuilder::setMin(), Mantid::Geometry::MDHistoDimensionBuilder::setName(), Mantid::Geometry::MDHistoDimensionBuilder::setNumBins(), Mantid::Kernel::IPropertyManager::setProperty(), Mantid::Kernel::IPropertyManager::setPropertyValue(), and Mantid::Geometry::MDHistoDimensionBuilder::setUnits().
Referenced by createOutputWorkspace().
|
protected |
Create histo output workspace.
Create an output histo workspace filled with data simulated with the fitting function.
baseName | :: The base name for the workspace |
function | :: The function used for the calculation |
inputWorkspace | :: The input workspace |
outputWorkspacePropertyName | :: The property name |
Definition at line 251 of file FitMD.cpp.
References Mantid::API::IDomainCreator::declareProperty(), Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::API::IDomainCreator::m_manager, Mantid::Kernel::Direction::Output, Mantid::Kernel::IPropertyManager::setProperty(), and Mantid::Kernel::IPropertyManager::setPropertyValue().
Referenced by createOutputWorkspace().
|
overridevirtual |
Create an output workspace filled with data simulated with the fitting function.
baseName | :: The base name for the workspace |
function | :: The function used for the calculation |
domain | :: A pointer to the input domain |
values | :: A pointer to the calculated values |
outputWorkspacePropertyName | :: The property name |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 136 of file FitMD.cpp.
References createEventOutputWorkspace(), and createHistoOutputWorkspace().
|
overridevirtual |
declare properties that specify the dataset within the workspace to fit to.
Declare properties that specify the dataset within the workspace to fit to.
suffix | |
addProp |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 75 of file FitMD.cpp.
References Mantid::API::IDomainCreator::declareProperty(), Mantid::Kernel::IPropertyManager::existsProperty(), Mantid::API::IDomainCreator::m_domainType, Mantid::API::IDomainCreator::m_manager, m_maxSizePropertyName, and Mantid::API::IDomainCreator::Simple.
|
overridevirtual |
Return the size of the domain to be created.
Implements Mantid::API::IDomainCreator.
Definition at line 316 of file FitMD.cpp.
References m_count, m_IMDWorkspace, m_startIndex, n, and setParameters().
|
overridevirtual |
Initialize.
Initialize from a default constructor.
pm | :: A pointer to a property manager instance |
workspacePropertyName | The name of the workspace property |
domainType |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 62 of file FitMD.cpp.
References Mantid::API::IDomainCreator::m_domainType, Mantid::API::IDomainCreator::m_manager, m_workspacePropertyName, and Mantid::API::IDomainCreator::m_workspacePropertyNames.
|
inline |
|
protected |
Set all parameters.
Definition at line 284 of file FitMD.cpp.
References Mantid::Kernel::IPropertyManager::getProperty(), Mantid::API::IDomainCreator::m_domainType, m_IMDWorkspace, Mantid::API::IDomainCreator::m_manager, m_maxSize, m_maxSizePropertyName, m_workspacePropertyName, Mantid::API::IDomainCreator::m_workspacePropertyNames, and Mantid::API::IDomainCreator::Simple.
Referenced by createDomain(), and getDomainSize().
void Mantid::MDAlgorithms::FitMD::setRange | ( | size_t | startIndex, |
size_t | count | ||
) |
Set the range.
startIndex | :: Starting index in the worspace |
count | :: Size of the domain |
Definition at line 308 of file FitMD.cpp.
References count, m_count, and m_startIndex.
|
inline |
|
protected |
Size of the domain if part of the workspace is used.
Definition at line 92 of file FitMD.h.
Referenced by createDomain(), getDomainSize(), and setRange().
|
mutableprotected |
The input IMDWorkspace.
Definition at line 86 of file FitMD.h.
Referenced by createDomain(), getDomainSize(), and setParameters().
|
mutableprotected |
|
protected |
Store maxSize property name.
Definition at line 84 of file FitMD.h.
Referenced by declareDatasetProperties(), and setParameters().
|
protected |
Starting index.
Definition at line 90 of file FitMD.h.
Referenced by createDomain(), getDomainSize(), and setRange().
|
protected |
Store workspace property name.
Definition at line 82 of file FitMD.h.
Referenced by FitMD(), initialize(), and setParameters().