Mantid
|
Creates FunctionDomain1D form a spectrum in a MatrixWorkspace. More...
#include <FitMW.h>
Public Member Functions | |
void | createDomain (std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0=0) 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) override |
Create an output workspace. More... | |
void | declareDatasetProperties (const std::string &suffix="", bool addProp=true) override |
Declare properties that specify the dataset within the workspace to fit to. More... | |
FitMW (DomainType domainType=Simple) | |
Constructor. More... | |
FitMW (Kernel::IPropertyManager *fit, const std::string &workspacePropertyName, DomainType domainType=Simple) | |
Constructor. More... | |
void | setMaxSize (size_t maxSize) |
Set max size for Sequantial and Parallel domains. More... | |
void | setNormalise (bool on) |
Set the normalisation flag. More... | |
Public Member Functions inherited from Mantid::CurveFitting::IMWDomainCreator | |
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) override |
Create an output workspace. More... | |
void | declareDatasetProperties (const std::string &suffix="", bool addProp=true) override |
Declare properties that specify the dataset within the workspace to fit to. More... | |
size_t | getDomainSize () const override |
Return the size of the domain to be created. More... | |
IMWDomainCreator (Kernel::IPropertyManager *fit, const std::string &workspacePropertyName, DomainType domainType=Simple) | |
Constructor. More... | |
void | initFunction (API::IFunction_sptr function) override |
Initialize the function. More... | |
void | setRange (double startX, double endX) |
Set the startX and endX. More... | |
void | setWorkspace (std::shared_ptr< API::MatrixWorkspace > ws) |
Set the workspace. More... | |
void | setWorkspaceIndex (size_t wi) |
Set the workspace index. 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 | |
void | setParameters () const override |
Set all parameters. More... | |
Protected Member Functions inherited from Mantid::CurveFitting::IMWDomainCreator | |
void | addFunctionValuesToWS (const API::IFunction_sptr &function, std::shared_ptr< API::MatrixWorkspace > &ws, const size_t wsIndex, const std::shared_ptr< API::FunctionDomain > &domain, const std::shared_ptr< API::FunctionValues > &resultValues) const |
Add the calculated function values to the workspace. More... | |
void | appendCompositeFunctionMembers (std::list< API::IFunction_sptr > &functionList, const API::IFunction_sptr &function) const |
void | appendConvolvedCompositeFunctionMembers (std::list< API::IFunction_sptr > &functionList, const API::IFunction_sptr &function) const |
If the fit function is Convolution and flag m_convolutionCompositeMembers is set and Convolution's second function (the model) is composite then use members of the model for the output. More... | |
std::shared_ptr< API::MatrixWorkspace > | createEmptyResultWS (const size_t nhistograms, const size_t nyvalues) |
Creates the blank output workspace of the correct size. More... | |
std::pair< size_t, size_t > | getXInterval () const |
Calculate size and starting iterator in the X array. More... | |
void | setInitialValues (API::IFunction &function) |
Set initial values for parameters with default values. More... | |
virtual 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... | |
Private Attributes | |
std::vector< double > | m_exclude |
Ranges that must be excluded from fit. More... | |
std::string | m_excludePropertyName |
Store the Exclude property name. More... | |
size_t | m_maxSize |
Max size for seq domain. More... | |
std::string | m_maxSizePropertyName |
Store maxSize property name. More... | |
bool | m_normalise |
Option to normalise the data. More... | |
std::string | m_normalisePropertyName |
Store Normalise property name. More... | |
Additional Inherited Members | |
Public Types inherited from Mantid::API::IDomainCreator | |
enum | DomainType { Simple = 0 , Sequential , Parallel } |
Type of domain to create. More... | |
Protected Attributes inherited from Mantid::CurveFitting::IMWDomainCreator | |
std::weak_ptr< API::FunctionDomain1D > | m_domain |
Store the created domain and values. More... | |
double | m_endX |
endX More... | |
std::string | m_endXPropertyName |
Store endX property name. More... | |
std::shared_ptr< API::MatrixWorkspace > | m_matrixWorkspace |
The input MareixWorkspace. More... | |
size_t | m_startIndex |
double | m_startX |
startX More... | |
std::string | m_startXPropertyName |
Store startX property name. More... | |
std::weak_ptr< API::FunctionValues > | m_values |
size_t | m_workspaceIndex |
The workspace index. More... | |
std::string | m_workspaceIndexPropertyName |
Store workspace index property name. 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... | |
Creates FunctionDomain1D form a spectrum in a MatrixWorkspace.
Declares WorkspaceIndex, StartX, and EndX input properties. Declares OutputWorkspace output property.
Mantid::CurveFitting::FitMW::FitMW | ( | Kernel::IPropertyManager * | fit, |
const std::string & | workspacePropertyName, | ||
FitMW::DomainType | domainType = Simple |
||
) |
Mantid::CurveFitting::FitMW::FitMW | ( | FitMW::DomainType | domainType = Simple | ) |
|
overridevirtual |
Create a domain from the input workspace.
Implements Mantid::API::IDomainCreator.
Definition at line 194 of file FitMW.cpp.
References Mantid::CurveFitting::SeqDomain::addCreator(), Mantid::CurveFitting::SeqDomain::create(), error, Mantid::CurveFitting::IMWDomainCreator::getXInterval(), Mantid::CurveFitting::ExcludeRangeFinder::isExcluded(), Mantid::Geometry::m, Mantid::CurveFitting::IMWDomainCreator::m_domain, Mantid::API::IDomainCreator::m_domainType, m_exclude, Mantid::API::IDomainCreator::m_ignoreInvalidData, Mantid::CurveFitting::IMWDomainCreator::m_matrixWorkspace, m_maxSize, m_normalise, Mantid::CurveFitting::IMWDomainCreator::m_startIndex, Mantid::CurveFitting::IMWDomainCreator::m_values, Mantid::CurveFitting::IMWDomainCreator::m_workspaceIndex, n, setParameters(), Mantid::CurveFitting::IMWDomainCreator::setWorkspace(), Mantid::API::IDomainCreator::Simple, Mantid::Geometry::X, Mantid::Geometry::x, Mantid::Geometry::Y, and Mantid::Geometry::y.
|
overridevirtual |
Create an output workspace.
Create an output workspace with the calculated values.
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 API::FunctionValues instance containing the fitting data |
outputWorkspacePropertyName | :: The property name |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 315 of file FitMW.cpp.
References Mantid::CurveFitting::IMWDomainCreator::createOutputWorkspace(), Mantid::CurveFitting::IMWDomainCreator::m_matrixWorkspace, m_normalise, Mantid::Geometry::X, and Mantid::Geometry::Y.
|
overridevirtual |
Declare properties that specify the dataset within the workspace to fit to.
suffix | :: names the dataset |
addProp | :: allows for the declaration of certain properties of the dataset |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 166 of file FitMW.cpp.
References Mantid::CurveFitting::IMWDomainCreator::declareDatasetProperties(), Mantid::API::IDomainCreator::declareProperty(), Mantid::Kernel::IPropertyManager::existsProperty(), Mantid::API::IDomainCreator::m_domainType, m_excludePropertyName, Mantid::API::IDomainCreator::m_manager, m_maxSizePropertyName, m_normalisePropertyName, and Mantid::API::IDomainCreator::Simple.
|
inline |
|
inline |
|
overrideprotectedvirtual |
Set all parameters.
std::runtime_error | if the Exclude property has an odd number of entries. |
Reimplemented from Mantid::CurveFitting::IMWDomainCreator.
Definition at line 140 of file FitMW.cpp.
References Mantid::Kernel::IPropertyManager::getProperty(), Mantid::API::IDomainCreator::m_domainType, m_exclude, m_excludePropertyName, Mantid::API::IDomainCreator::m_manager, m_maxSize, m_maxSizePropertyName, m_normalise, m_normalisePropertyName, Mantid::CurveFitting::IMWDomainCreator::setParameters(), and Mantid::API::IDomainCreator::Simple.
Referenced by createDomain().
|
mutableprivate |
Ranges that must be excluded from fit.
Definition at line 81 of file FitMW.h.
Referenced by createDomain(), and setParameters().
|
private |
Store the Exclude property name.
Definition at line 74 of file FitMW.h.
Referenced by declareDatasetProperties(), and setParameters().
|
mutableprivate |
Max size for seq domain.
Definition at line 77 of file FitMW.h.
Referenced by createDomain(), and setParameters().
|
private |
Store maxSize property name.
Definition at line 70 of file FitMW.h.
Referenced by declareDatasetProperties(), and setParameters().
|
mutableprivate |
Option to normalise the data.
Definition at line 79 of file FitMW.h.
Referenced by createDomain(), createOutputWorkspace(), and setParameters().
|
private |
Store Normalise property name.
Definition at line 72 of file FitMW.h.
Referenced by declareDatasetProperties(), and setParameters().