Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantid::API::IDomainCreator Class Referenceabstract

An base class for domain creators for use in Fit. More...

#include <IDomainCreator.h>

Inheritance diagram for Mantid::API::IDomainCreator:
Mantid::CurveFitting::FunctionDomain1DSpectrumCreator Mantid::CurveFitting::GeneralDomainCreator Mantid::CurveFitting::IMWDomainCreator Mantid::CurveFitting::LatticeDomainCreator Mantid::CurveFitting::MultiDomainCreator Mantid::CurveFitting::SeqDomainSpectrumCreator Mantid::CurveFitting::TableWorkspaceDomainCreator Mantid::MDAlgorithms::FitMD

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::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 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::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

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.

Author
Roman Tolchenov, Tessella plc
Date
22/03/2012

Definition at line 39 of file IDomainCreator.h.

Member Enumeration Documentation

◆ DomainType

Type of domain to create.

Enumerator
Simple 
Sequential 
Parallel 

Definition at line 42 of file IDomainCreator.h.

Constructor & Destructor Documentation

◆ IDomainCreator()

Mantid::API::IDomainCreator::IDomainCreator ( Kernel::IPropertyManager manager,
std::vector< std::string >  workspacePropertyNames,
DomainType  domainType = Simple 
)

Constrcutor.

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

◆ ~IDomainCreator()

virtual Mantid::API::IDomainCreator::~IDomainCreator ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ createDomain()

virtual void Mantid::API::IDomainCreator::createDomain ( std::shared_ptr< API::FunctionDomain > &  domain,
std::shared_ptr< API::FunctionValues > &  values,
size_t  i0 = 0 
)
pure virtual

Create a domain and values from the input workspace.

FunctionValues must be filled with data to fit to.

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

◆ createOutputWorkspace()

virtual std::shared_ptr< API::Workspace > Mantid::API::IDomainCreator::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" 
)
inlinevirtual

Create an output workspace filled with data simulated with the fitting function.

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 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
Returns
A shared pointer to the created workspace.

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.

◆ declareDatasetProperties()

virtual void Mantid::API::IDomainCreator::declareDatasetProperties ( const std::string &  suffix = "",
bool  addProp = true 
)
inlinevirtual

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

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

◆ declareProperty()

void Mantid::API::IDomainCreator::declareProperty ( Kernel::Property prop,
const std::string &  doc 
)
protected

◆ getDomainSize()

virtual size_t Mantid::API::IDomainCreator::getDomainSize ( ) const
pure virtual

◆ ignoreInvalidData()

void Mantid::API::IDomainCreator::ignoreInvalidData ( bool  yes)
inline

Set to ignore invalid data.

Definition at line 108 of file IDomainCreator.h.

◆ initFunction()

void Mantid::API::IDomainCreator::initFunction ( API::IFunction_sptr  function)
virtual

Initialize the function.

Initialize the function with the workspace.

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

◆ initialize()

virtual void Mantid::API::IDomainCreator::initialize ( Kernel::IPropertyManager ,
const std::string &  ,
DomainType   
)
inlinevirtual

Initialize.

Reimplemented in Mantid::MDAlgorithms::FitMD.

Definition at line 49 of file IDomainCreator.h.

◆ separateCompositeMembersInOutput()

void Mantid::API::IDomainCreator::separateCompositeMembersInOutput ( const bool  value,
const bool  conv = false 
)

Toggle output of either just composite or composite + members.

Parameters
valueIf true then each composite is unrolled and its output is appended to the default output, otherwise just the composite is used
convIf 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.

Member Data Documentation

◆ m_convolutionCompositeMembers

bool Mantid::API::IDomainCreator::m_convolutionCompositeMembers
protected

◆ m_domainType

DomainType Mantid::API::IDomainCreator::m_domainType
protected

◆ m_ignoreInvalidData

bool Mantid::API::IDomainCreator::m_ignoreInvalidData
protected

◆ m_manager

Kernel::IPropertyManager* Mantid::API::IDomainCreator::m_manager
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().

◆ m_outputCompositeMembers

bool Mantid::API::IDomainCreator::m_outputCompositeMembers
protected

◆ m_workspacePropertyNames

std::vector<std::string> Mantid::API::IDomainCreator::m_workspacePropertyNames
protected

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