Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantid::MDAlgorithms::FitMD Class Reference

Creates FunctionDomainMD from an IMDWorkspace. More...

#include <FitMD.h>

Inheritance diagram for Mantid::MDAlgorithms::FitMD:
Mantid::API::IDomainCreator

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

std::shared_ptr< API::WorkspacecreateEventOutputWorkspace (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::WorkspacecreateHistoOutputWorkspace (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::IMDWorkspacem_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::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...
 

Additional Inherited Members

- Public Types inherited from Mantid::API::IDomainCreator
enum  DomainType { Simple = 0 , Sequential , Parallel }
 Type of domain to create. More...
 

Detailed Description

Creates FunctionDomainMD from an IMDWorkspace.

Does not create any properties.

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

Definition at line 34 of file FitMD.h.

Constructor & Destructor Documentation

◆ FitMD() [1/3]

Mantid::MDAlgorithms::FitMD::FitMD ( )

Default constructor.

Default Constructor.

Definition at line 36 of file FitMD.cpp.

◆ FitMD() [2/3]

Mantid::MDAlgorithms::FitMD::FitMD ( Kernel::IPropertyManager fit,
const std::string &  workspacePropertyName,
IDomainCreator::DomainType  domainType = Simple 
)

◆ FitMD() [3/3]

Mantid::MDAlgorithms::FitMD::FitMD ( DomainType  domainType)
inline

Constructor.

Definition at line 41 of file FitMD.h.

Member Function Documentation

◆ createDomain()

void Mantid::MDAlgorithms::FitMD::createDomain ( std::shared_ptr< API::FunctionDomain > &  domain,
std::shared_ptr< API::FunctionValues > &  ivalues,
size_t  i0 
)
overridevirtual

Create a domain from the input workspace.

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

◆ createEventOutputWorkspace()

std::shared_ptr< API::Workspace > Mantid::MDAlgorithms::FitMD::createEventOutputWorkspace ( const std::string &  baseName,
const API::IMDEventWorkspace inputWorkspace,
const API::FunctionValues values,
const std::string &  outputWorkspacePropertyName 
)
protected

◆ createHistoOutputWorkspace()

std::shared_ptr< API::Workspace > Mantid::MDAlgorithms::FitMD::createHistoOutputWorkspace ( const std::string &  baseName,
const API::IFunction_sptr function,
const std::shared_ptr< const API::IMDHistoWorkspace > &  inputWorkspace,
const std::string &  outputWorkspacePropertyName 
)
protected

Create histo output workspace.

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

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

◆ createOutputWorkspace()

std::shared_ptr< API::Workspace > Mantid::MDAlgorithms::FitMD::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" 
)
overridevirtual

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

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

◆ declareDatasetProperties()

void Mantid::MDAlgorithms::FitMD::declareDatasetProperties ( const std::string &  suffix = "",
bool  addProp = true 
)
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.

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

◆ getDomainSize()

size_t Mantid::MDAlgorithms::FitMD::getDomainSize ( ) const
overridevirtual

Return the size of the domain to be created.

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

◆ initialize()

void Mantid::MDAlgorithms::FitMD::initialize ( Kernel::IPropertyManager pm,
const std::string &  workspacePropertyName,
IDomainCreator::DomainType  domainType 
)
overridevirtual

Initialize.

Initialize from a default constructor.

Parameters
pm:: A pointer to a property manager instance
workspacePropertyNameThe 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.

◆ setMaxSize()

void Mantid::MDAlgorithms::FitMD::setMaxSize ( size_t  maxSize)
inline

Set max size for Sequantial and Parallel domains.

Parameters
maxSize:: Maximum size of each simple domain

Definition at line 65 of file FitMD.h.

◆ setParameters()

void Mantid::MDAlgorithms::FitMD::setParameters ( ) const
protected

◆ setRange()

void Mantid::MDAlgorithms::FitMD::setRange ( size_t  startIndex,
size_t  count 
)

Set the range.

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

◆ setWorkspace()

void Mantid::MDAlgorithms::FitMD::setWorkspace ( std::shared_ptr< API::IMDWorkspace IMDWorkspace)
inline

Set the workspace.

Definition at line 60 of file FitMD.h.

Member Data Documentation

◆ m_count

size_t Mantid::MDAlgorithms::FitMD::m_count
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().

◆ m_IMDWorkspace

std::shared_ptr<API::IMDWorkspace> Mantid::MDAlgorithms::FitMD::m_IMDWorkspace
mutableprotected

The input IMDWorkspace.

Definition at line 86 of file FitMD.h.

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

◆ m_maxSize

size_t Mantid::MDAlgorithms::FitMD::m_maxSize
mutableprotected

Max size for seq domain.

Definition at line 88 of file FitMD.h.

Referenced by setParameters().

◆ m_maxSizePropertyName

std::string Mantid::MDAlgorithms::FitMD::m_maxSizePropertyName
protected

Store maxSize property name.

Definition at line 84 of file FitMD.h.

Referenced by declareDatasetProperties(), and setParameters().

◆ m_startIndex

size_t Mantid::MDAlgorithms::FitMD::m_startIndex
protected

Starting index.

Definition at line 90 of file FitMD.h.

Referenced by createDomain(), getDomainSize(), and setRange().

◆ m_workspacePropertyName

std::string Mantid::MDAlgorithms::FitMD::m_workspacePropertyName
protected

Store workspace property name.

Definition at line 82 of file FitMD.h.

Referenced by FitMD(), initialize(), and setParameters().


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