Mantid
|
SeqDomainSpectrumCreator : More...
#include <SeqDomainSpectrumCreator.h>
Public Member Functions | |
void | createDomain (std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0=0) override |
Creates a sequential domain corresponding to the assigned MatrixWorkspace. More... | |
API::Workspace_sptr | 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") override |
Creates an output workspace using the given function and domain. More... | |
size_t | getDomainSize () const override |
Returns the domain size. More... | |
SeqDomainSpectrumCreator (Kernel::IPropertyManager *manager, const std::string &workspacePropertyName) | |
Constructor. 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 | |
bool | histogramIsUsable (size_t i) const |
Determines whether a spectrum is masked, in case there is no instrument this always returns true. More... | |
void | setMatrixWorkspace (const API::MatrixWorkspace_sptr &matrixWorkspace) |
Sets the MatrixWorkspace the created domain is based on. More... | |
void | setParametersFromPropertyManager () |
Tries to extract a workspace from the assigned property manager. 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 |
std::string | m_workspacePropertyName |
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... | |
Additional Inherited Members | |
Public Types inherited from Mantid::API::IDomainCreator | |
enum | DomainType { Simple = 0 , Sequential , Parallel } |
Type of domain to create. More... | |
SeqDomainSpectrumCreator creates a special type of SeqDomain, which contains one FunctionDomain1DSpectrum for each histogram of the Workspace2D this domain refers to. It can be used for functions that involve several histograms at once.
Definition at line 31 of file SeqDomainSpectrumCreator.h.
Mantid::CurveFitting::SeqDomainSpectrumCreator::SeqDomainSpectrumCreator | ( | Kernel::IPropertyManager * | manager, |
const std::string & | workspacePropertyName | ||
) |
Constructor.
Manager can be a null-pointer if required in a context where no PropertyManager is available. The same for the second argument, it can be an empty string if the functionality is not required.
manager | :: Pointer to IPropertyManager instance. |
workspacePropertyName | :: Name of the output property for a created workspace in case a PropertyManager is used. |
Definition at line 34 of file SeqDomainSpectrumCreator.cpp.
|
overridevirtual |
Creates a sequential domain corresponding to the assigned MatrixWorkspace.
For each spectrum in the workspace, a FunctionDomain1DSpectrumCreator is constructed and added to a SeqDomain. This way each spectrum of the workspace is represented by its own, independent domain.
domain | :: Pointer to outgoing FunctionDomain instance. |
values | :: Pointer to outgoing FunctionValues object. |
i0 | :: Size offset for values object if it already contains data. |
Implements Mantid::API::IDomainCreator.
Definition at line 50 of file SeqDomainSpectrumCreator.cpp.
References Mantid::CurveFitting::SeqDomain::addCreator(), Mantid::CurveFitting::SeqDomain::create(), histogramIsUsable(), Mantid::API::IDomainCreator::m_domainType, m_matrixWorkspace, Mantid::CurveFitting::FunctionDomain1DSpectrumCreator::setMatrixWorkspace(), and setParametersFromPropertyManager().
|
overridevirtual |
Creates an output workspace using the given function and domain.
This method creates a MatrixWorkspace with the same dimensions as the input workspace that was assigned before or throws std::invalid_argument if no valid workspace is present. The method also checks that the provided domain is a SeqDomain. The function needs to be able to handle a FunctionDomain1D-domain. If all requirements are met, an output workspace is created and populated with the calculated values.
baseName | :: Basename for output workspace. |
function | :: Function that can handle a FunctionDomain1D-domain. |
domain | :: Pointer to SeqDomain instance. |
values | :: Pointer to FunctionValues instance, currently not used. |
outputWorkspacePropertyName | :: Name of output workspace property, if used. |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 100 of file SeqDomainSpectrumCreator.cpp.
References Mantid::DataObjects::create(), Mantid::API::IDomainCreator::declareProperty(), Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::API::IDomainCreator::m_manager, m_matrixWorkspace, Mantid::Kernel::Direction::Output, Mantid::Kernel::IPropertyManager::setProperty(), Mantid::Kernel::IPropertyManager::setPropertyValue(), and UNUSED_ARG.
|
overridevirtual |
Returns the domain size.
Throws if no MatrixWorkspace has been set.
Implements Mantid::API::IDomainCreator.
Definition at line 172 of file SeqDomainSpectrumCreator.cpp.
References m_matrixWorkspace.
|
protected |
Determines whether a spectrum is masked, in case there is no instrument this always returns true.
Definition at line 207 of file SeqDomainSpectrumCreator.cpp.
References m_matrixWorkspace.
Referenced by createDomain().
|
protected |
Sets the MatrixWorkspace the created domain is based on.
Definition at line 197 of file SeqDomainSpectrumCreator.cpp.
References m_matrixWorkspace.
Referenced by setParametersFromPropertyManager().
|
protected |
Tries to extract a workspace from the assigned property manager.
Definition at line 188 of file SeqDomainSpectrumCreator.cpp.
References Mantid::Kernel::IPropertyManager::getProperty(), Mantid::API::IDomainCreator::m_manager, m_workspacePropertyName, setMatrixWorkspace(), and workspace.
Referenced by createDomain().
|
protected |
Definition at line 51 of file SeqDomainSpectrumCreator.h.
Referenced by createDomain(), createOutputWorkspace(), getDomainSize(), histogramIsUsable(), and setMatrixWorkspace().
|
protected |
Definition at line 50 of file SeqDomainSpectrumCreator.h.
Referenced by setParametersFromPropertyManager().