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

FunctionDomain1DSpectrumCreator : More...

#include <FunctionDomain1DSpectrumCreator.h>

Inheritance diagram for Mantid::CurveFitting::FunctionDomain1DSpectrumCreator:
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
 Creates the domain according to the stored MatrixWorkspace and workspace index. More...
 
 FunctionDomain1DSpectrumCreator ()
 Default Constructor. More...
 
size_t getDomainSize () const override
 Returns the domain sizes. More...
 
void setMatrixWorkspace (API::MatrixWorkspace_sptr matrixWorkspace)
 Sets the matrix workspace this creator is working with. More...
 
void setWorkspaceIndex (size_t workspaceIndex)
 Sets the workspace index for the created domain. 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 throwIfWorkspaceInvalid () const
 Checks the assigned MatrixWorkspace and workspace index. 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

API::MatrixWorkspace_sptr m_matrixWorkspace
 
size_t m_workspaceIndex
 
bool m_workspaceIndexIsSet
 
- 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

FunctionDomain1DSpectrumCreator :

FunctionDomain1DSpectrumCreator creates an FunctionDomain1DSpectrum using a given MatrixWorkspace and workspace index. Currently it does not create an output workspace, since it is exclusively used in a context where it's not required.

Author
Michael Wedel, Paul Scherrer Institut - SINQ
Date
30/05/2014

Definition at line 36 of file FunctionDomain1DSpectrumCreator.h.

Constructor & Destructor Documentation

◆ FunctionDomain1DSpectrumCreator()

Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::FunctionDomain1DSpectrumCreator ( )

Default Constructor.

Definition at line 22 of file FunctionDomain1DSpectrumCreator.cpp.

Member Function Documentation

◆ createDomain()

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

Creates the domain according to the stored MatrixWorkspace and workspace index.

This method constructs a FunctionDomain1DSpectrum instance and set the domain and values parameters. If no workspace is present, the index is invalid or there are too few bins (0), the method throws std::invalid_argument.

Parameters
domain:: Pointer that holds the domain instance after the call.
values:: Pointer that holds the function values instance after the call.
i0:: Size offset in case the FunctionValues object already contains data.

Implements Mantid::API::IDomainCreator.

Definition at line 60 of file FunctionDomain1DSpectrumCreator.cpp.

References m_matrixWorkspace, m_workspaceIndex, and throwIfWorkspaceInvalid().

◆ getDomainSize()

size_t Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::getDomainSize ( ) const
overridevirtual

Returns the domain sizes.

The function throws std::invalid_argument if the workspace, or the index are not valid.

Returns
Domain size, depending on whether the MatrixWorkspace contains histogram data or not.

Implements Mantid::API::IDomainCreator.

Definition at line 91 of file FunctionDomain1DSpectrumCreator.cpp.

References m_matrixWorkspace, m_workspaceIndex, and throwIfWorkspaceInvalid().

◆ setMatrixWorkspace()

void Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::setMatrixWorkspace ( API::MatrixWorkspace_sptr  matrixWorkspace)

Sets the matrix workspace this creator is working with.

Parameters
matrixWorkspace:: Pointer to matrix workspace the domain is based on.

Definition at line 30 of file FunctionDomain1DSpectrumCreator.cpp.

References m_matrixWorkspace.

Referenced by Mantid::CurveFitting::SeqDomainSpectrumCreator::createDomain().

◆ setWorkspaceIndex()

void Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::setWorkspaceIndex ( size_t  workspaceIndex)

Sets the workspace index for the created domain.

Does not perform any validity checks.

Parameters
workspaceIndex:: Index of spectrum for which the domain is created.

Definition at line 39 of file FunctionDomain1DSpectrumCreator.cpp.

References m_workspaceIndex, and m_workspaceIndexIsSet.

◆ throwIfWorkspaceInvalid()

void Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::throwIfWorkspaceInvalid ( ) const
protected

Checks the assigned MatrixWorkspace and workspace index.

Definition at line 104 of file FunctionDomain1DSpectrumCreator.cpp.

References m_matrixWorkspace, m_workspaceIndex, and m_workspaceIndexIsSet.

Referenced by createDomain(), and getDomainSize().

Member Data Documentation

◆ m_matrixWorkspace

API::MatrixWorkspace_sptr Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::m_matrixWorkspace
protected

◆ m_workspaceIndex

size_t Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::m_workspaceIndex
protected

◆ m_workspaceIndexIsSet

bool Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::m_workspaceIndexIsSet
protected

Definition at line 53 of file FunctionDomain1DSpectrumCreator.h.

Referenced by setWorkspaceIndex(), and throwIfWorkspaceInvalid().


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