Mantid
|
An base class for domain creators for use in Fit. More...
#include <IDomainCreator.h>
Public Types | |
enum | DomainType { Simple = 0 , Sequential , Parallel } |
Type of domain to create. More... | |
Public Member Functions | |
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 | |
void | declareProperty (Kernel::Property *prop, const std::string &doc) |
Declare a property to the algorithm. More... | |
Protected Attributes | |
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... | |
An base class for domain creators for use in Fit.
Implementations create function domains from particular workspaces. Domain creators are instantiated by Fit algorithm and are responsible for declaring Fit's dynamic properties. Derived creators can implement createOutput method to declare the OutputWorkspace property for comparing the fitted and calculated data.
Definition at line 39 of file IDomainCreator.h.
Type of domain to create.
Enumerator | |
---|---|
Simple | |
Sequential | |
Parallel |
Definition at line 42 of file IDomainCreator.h.
Mantid::API::IDomainCreator::IDomainCreator | ( | Kernel::IPropertyManager * | manager, |
std::vector< std::string > | workspacePropertyNames, | ||
DomainType | domainType = Simple |
||
) |
Constrcutor.
manager | :: A property manager which has information about the data source (eg workspace) and the function. |
workspacePropertyNames | :: Property names for workspaces to get the data from. |
domainType | :: Type of domain to create: Simple, Sequential, or Parallel. |
Definition at line 26 of file IDomainCreator.cpp.
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Create a domain and values from the input workspace.
FunctionValues must be filled with data to fit to.
domain | :: Shared pointer to hold the created domain |
values | :: Shared pointer to hold the created values with set fitting data and weights. Implementations must check whether it's empty or not. If values pointer is empty create new values instance of an appropriate type otherwise extend it if neccessary. |
i0 | :: Starting index in values for the fitting data. Implementations must make sure values has enough room for the data from index i0 to the end of the container. |
Implemented in Mantid::MDAlgorithms::FitMD, Mantid::CurveFitting::MultiDomainCreator, Mantid::CurveFitting::LatticeDomainCreator, Mantid::CurveFitting::FitMW, Mantid::CurveFitting::FunctionDomain1DSpectrumCreator, Mantid::CurveFitting::GeneralDomainCreator, Mantid::CurveFitting::HistogramDomainCreator, Mantid::CurveFitting::SeqDomainSpectrumCreator, and Mantid::CurveFitting::TableWorkspaceDomainCreator.
|
inlinevirtual |
Create an output workspace filled with data simulated with the fitting function.
baseName | :: Specifies the name of the output workspace |
function | :: A pointer to the fitting function |
domain | :: The domain containing x-values for the function |
values | :: A FunctionValues instance containing the fitting data |
outputWorkspacePropertyName | :: Name of the property to declare and set to the created output workspace. If empty do not create the property, just return a pointer |
Reimplemented in Mantid::CurveFitting::FitMW, Mantid::CurveFitting::HistogramDomainCreator, Mantid::CurveFitting::IMWDomainCreator, Mantid::CurveFitting::LatticeDomainCreator, Mantid::CurveFitting::MultiDomainCreator, Mantid::CurveFitting::TableWorkspaceDomainCreator, Mantid::CurveFitting::GeneralDomainCreator, Mantid::CurveFitting::SeqDomainSpectrumCreator, and Mantid::MDAlgorithms::FitMD.
Definition at line 90 of file IDomainCreator.h.
References UNUSED_ARG.
|
inlinevirtual |
Declare properties that specify the dataset within the workspace to fit to.
suffix | :: A suffix to give to all new properties. |
addProp | :: If false don't actually declare new properties but do other stuff if needed |
Reimplemented in Mantid::CurveFitting::FitMW, Mantid::CurveFitting::GeneralDomainCreator, Mantid::CurveFitting::IMWDomainCreator, Mantid::CurveFitting::TableWorkspaceDomainCreator, and Mantid::MDAlgorithms::FitMD.
Definition at line 59 of file IDomainCreator.h.
References UNUSED_ARG.
|
protected |
Declare a property to the algorithm.
prop | :: A new property. |
doc | :: A doc string. |
Definition at line 51 of file IDomainCreator.cpp.
References Mantid::Kernel::IPropertyManager::declareProperty(), and m_manager.
Referenced by Mantid::MDAlgorithms::FitMD::createEventOutputWorkspace(), Mantid::MDAlgorithms::FitMD::createHistoOutputWorkspace(), Mantid::CurveFitting::IMWDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::LatticeDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::MultiDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::TableWorkspaceDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::GeneralDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::SeqDomainSpectrumCreator::createOutputWorkspace(), Mantid::CurveFitting::FitMW::declareDatasetProperties(), Mantid::CurveFitting::GeneralDomainCreator::declareDatasetProperties(), Mantid::CurveFitting::IMWDomainCreator::declareDatasetProperties(), Mantid::CurveFitting::TableWorkspaceDomainCreator::declareDatasetProperties(), and Mantid::MDAlgorithms::FitMD::declareDatasetProperties().
|
pure virtual |
Return the size of the domain to be created.
Implemented in Mantid::CurveFitting::FunctionDomain1DSpectrumCreator, Mantid::CurveFitting::GeneralDomainCreator, Mantid::CurveFitting::IMWDomainCreator, Mantid::CurveFitting::LatticeDomainCreator, Mantid::CurveFitting::MultiDomainCreator, Mantid::CurveFitting::SeqDomainSpectrumCreator, Mantid::CurveFitting::TableWorkspaceDomainCreator, and Mantid::MDAlgorithms::FitMD.
|
inline |
Set to ignore invalid data.
Definition at line 108 of file IDomainCreator.h.
|
virtual |
Initialize the function.
Initialize the function with the workspace.
function | :: A function to initialize. |
Default is to call IFunction::setWorkspace().
Reimplemented in Mantid::CurveFitting::IMWDomainCreator, Mantid::CurveFitting::MultiDomainCreator, and Mantid::CurveFitting::TableWorkspaceDomainCreator.
Definition at line 62 of file IDomainCreator.cpp.
References Mantid::Kernel::IPropertyManager::existsProperty(), Mantid::Kernel::IPropertyManager::getProperty(), m_manager, and workspace.
Referenced by Mantid::CurveFitting::MultiDomainCreator::initFunction().
|
inlinevirtual |
Initialize.
Reimplemented in Mantid::MDAlgorithms::FitMD.
Definition at line 49 of file IDomainCreator.h.
void Mantid::API::IDomainCreator::separateCompositeMembersInOutput | ( | const bool | value, |
const bool | conv = false |
||
) |
Toggle output of either just composite or composite + members.
value | If true then each composite is unrolled and its output is appended to the default output, otherwise just the composite is used |
conv | If true and the fitting function is Convolution and its model (function with index 1) is composite then output the components of the model convolved with the resolution (function index 0). |
Definition at line 41 of file IDomainCreator.cpp.
References m_convolutionCompositeMembers, m_outputCompositeMembers, and value.
|
protected |
Perform convolution of output composite components.
Definition at line 122 of file IDomainCreator.h.
Referenced by Mantid::CurveFitting::IMWDomainCreator::appendCompositeFunctionMembers(), Mantid::CurveFitting::TableWorkspaceDomainCreator::appendCompositeFunctionMembers(), Mantid::CurveFitting::MultiDomainCreator::createDomain(), and separateCompositeMembersInOutput().
|
protected |
Domain type.
Definition at line 118 of file IDomainCreator.h.
Referenced by Mantid::CurveFitting::FitMW::createDomain(), Mantid::CurveFitting::HistogramDomainCreator::createDomain(), Mantid::CurveFitting::SeqDomainSpectrumCreator::createDomain(), Mantid::CurveFitting::TableWorkspaceDomainCreator::createDomain(), Mantid::CurveFitting::FitMW::declareDatasetProperties(), Mantid::CurveFitting::TableWorkspaceDomainCreator::declareDatasetProperties(), Mantid::MDAlgorithms::FitMD::declareDatasetProperties(), Mantid::MDAlgorithms::FitMD::initialize(), Mantid::CurveFitting::TableWorkspaceDomainCreator::setParameters(), Mantid::MDAlgorithms::FitMD::setParameters(), and Mantid::CurveFitting::FitMW::setParameters().
|
protected |
Flag to ignore nans, infinities and zero errors.
Definition at line 124 of file IDomainCreator.h.
Referenced by Mantid::CurveFitting::FitMW::createDomain(), Mantid::CurveFitting::HistogramDomainCreator::createDomain(), and Mantid::CurveFitting::TableWorkspaceDomainCreator::createDomain().
|
protected |
Pointer to a property manager.
Definition at line 114 of file IDomainCreator.h.
Referenced by Mantid::CurveFitting::GeneralDomainCreator::createDomain(), Mantid::MDAlgorithms::FitMD::createEventOutputWorkspace(), Mantid::MDAlgorithms::FitMD::createHistoOutputWorkspace(), Mantid::CurveFitting::IMWDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::LatticeDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::MultiDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::TableWorkspaceDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::GeneralDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::SeqDomainSpectrumCreator::createOutputWorkspace(), Mantid::CurveFitting::FitMW::declareDatasetProperties(), Mantid::CurveFitting::IMWDomainCreator::declareDatasetProperties(), Mantid::CurveFitting::TableWorkspaceDomainCreator::declareDatasetProperties(), Mantid::MDAlgorithms::FitMD::declareDatasetProperties(), declareProperty(), Mantid::CurveFitting::GeneralDomainCreator::getInputWorkspace(), initFunction(), Mantid::MDAlgorithms::FitMD::initialize(), Mantid::CurveFitting::IMWDomainCreator::setParameters(), Mantid::CurveFitting::TableWorkspaceDomainCreator::setParameters(), Mantid::MDAlgorithms::FitMD::setParameters(), Mantid::CurveFitting::FitMW::setParameters(), Mantid::CurveFitting::SeqDomainSpectrumCreator::setParametersFromPropertyManager(), Mantid::CurveFitting::LatticeDomainCreator::setWorkspaceFromPropertyManager(), and Mantid::CurveFitting::TableWorkspaceDomainCreator::setXYEColumnNames().
|
protected |
Output separate composite function values.
Definition at line 120 of file IDomainCreator.h.
Referenced by Mantid::CurveFitting::MultiDomainCreator::createDomain(), Mantid::CurveFitting::IMWDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::TableWorkspaceDomainCreator::createOutputWorkspace(), and separateCompositeMembersInOutput().
|
protected |
Property names for workspaces to get the data from.
Definition at line 116 of file IDomainCreator.h.
Referenced by Mantid::CurveFitting::MultiDomainCreator::createDomain(), Mantid::MDAlgorithms::FitMD::FitMD(), Mantid::CurveFitting::GeneralDomainCreator::getInputWorkspace(), Mantid::CurveFitting::IMWDomainCreator::IMWDomainCreator(), Mantid::MDAlgorithms::FitMD::initialize(), Mantid::MDAlgorithms::FitMD::setParameters(), and Mantid::CurveFitting::TableWorkspaceDomainCreator::TableWorkspaceDomainCreator().