Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Mantid::CurveFitting::FitMW Class Reference

Creates FunctionDomain1D form a spectrum in a MatrixWorkspace. More...

#include <FitMW.h>

Inheritance diagram for Mantid::CurveFitting::FitMW:
Mantid::CurveFitting::IMWDomainCreator Mantid::API::IDomainCreator

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::WorkspacecreateOutputWorkspace (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::WorkspacecreateOutputWorkspace (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::WorkspacecreateOutputWorkspace (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::MatrixWorkspacecreateEmptyResultWS (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::FunctionDomain1Dm_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::MatrixWorkspacem_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::FunctionValuesm_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::IPropertyManagerm_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...
 

Detailed Description

Creates FunctionDomain1D form a spectrum in a MatrixWorkspace.

Declares WorkspaceIndex, StartX, and EndX input properties. Declares OutputWorkspace output property.

Author
Roman Tolchenov, Tessella plc
Date
06/12/2011

Definition at line 38 of file FitMW.h.

Constructor & Destructor Documentation

◆ FitMW() [1/2]

Mantid::CurveFitting::FitMW::FitMW ( Kernel::IPropertyManager fit,
const std::string &  workspacePropertyName,
FitMW::DomainType  domainType = Simple 
)

Constructor.

Parameters
fit:: Property manager with properties defining the domain to be created
workspacePropertyName:: Name of the workspace property.
domainType:: Type of the domain: Simple, Sequential, or Parallel.

Definition at line 123 of file FitMW.cpp.

◆ FitMW() [2/2]

Mantid::CurveFitting::FitMW::FitMW ( FitMW::DomainType  domainType = Simple)

Constructor.

Methods setWorkspace, setWorkspaceIndex and setRange must be called set up the creator.

Parameters
domainType:: Type of the domain: Simple, Sequential, or Parallel.

Definition at line 132 of file FitMW.cpp.

Member Function Documentation

◆ createDomain()

void Mantid::CurveFitting::FitMW::createDomain ( std::shared_ptr< API::FunctionDomain > &  domain,
std::shared_ptr< API::FunctionValues > &  values,
size_t  i0 = 0 
)
overridevirtual

◆ createOutputWorkspace()

std::shared_ptr< API::Workspace > Mantid::CurveFitting::FitMW::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 
)
overridevirtual

Create an output workspace.

Create an output workspace with the calculated values.

Parameters
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.

◆ declareDatasetProperties()

void Mantid::CurveFitting::FitMW::declareDatasetProperties ( const std::string &  suffix = "",
bool  addProp = true 
)
overridevirtual

Declare properties that specify the dataset within the workspace to fit to.

Parameters
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.

◆ setMaxSize()

void Mantid::CurveFitting::FitMW::setMaxSize ( size_t  maxSize)
inline

Set max size for Sequantial and Parallel domains.

Parameters
maxSize:: Maximum size of each simple domain

Definition at line 57 of file FitMW.h.

◆ setNormalise()

void Mantid::CurveFitting::FitMW::setNormalise ( bool  on)
inline

Set the normalisation flag.

Parameters
on:: If true and the spectrum is a histogram the fitting data will be normalised by the bin width.

Definition at line 62 of file FitMW.h.

◆ setParameters()

void Mantid::CurveFitting::FitMW::setParameters ( ) const
overrideprotectedvirtual

Member Data Documentation

◆ m_exclude

std::vector<double> Mantid::CurveFitting::FitMW::m_exclude
mutableprivate

Ranges that must be excluded from fit.

Definition at line 81 of file FitMW.h.

Referenced by createDomain(), and setParameters().

◆ m_excludePropertyName

std::string Mantid::CurveFitting::FitMW::m_excludePropertyName
private

Store the Exclude property name.

Definition at line 74 of file FitMW.h.

Referenced by declareDatasetProperties(), and setParameters().

◆ m_maxSize

size_t Mantid::CurveFitting::FitMW::m_maxSize
mutableprivate

Max size for seq domain.

Definition at line 77 of file FitMW.h.

Referenced by createDomain(), and setParameters().

◆ m_maxSizePropertyName

std::string Mantid::CurveFitting::FitMW::m_maxSizePropertyName
private

Store maxSize property name.

Definition at line 70 of file FitMW.h.

Referenced by declareDatasetProperties(), and setParameters().

◆ m_normalise

bool Mantid::CurveFitting::FitMW::m_normalise
mutableprivate

Option to normalise the data.

Definition at line 79 of file FitMW.h.

Referenced by createDomain(), createOutputWorkspace(), and setParameters().

◆ m_normalisePropertyName

std::string Mantid::CurveFitting::FitMW::m_normalisePropertyName
private

Store Normalise property name.

Definition at line 72 of file FitMW.h.

Referenced by declareDatasetProperties(), and setParameters().


The documentation for this class was generated from the following files: