Mantid
|
#include <LatticeDomainCreator.h>
Public Member Functions | |
void | createDomain (std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0) override |
Creates a LatticeDomain from the assigned Workspace. 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) override |
Creates an output workspace from calculated and observed values. More... | |
size_t | getDomainSize () const override |
Return the size of the domain to be created. More... | |
LatticeDomainCreator (Kernel::IPropertyManager *manager, const std::string &workspacePropertyName, DomainType domainType=Simple) | |
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 | |
void | createDomainFromPeaksWorkspace (const API::IPeaksWorkspace_sptr &workspace, std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0) |
Creates a LatticeDomain from an IPeaksWorkspace, using HKL and d-values. More... | |
void | createDomainFromPeakTable (const API::ITableWorkspace_sptr &workspace, std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0) |
Creates a domain from an ITableWorkspace. More... | |
void | setWorkspaceFromPropertyManager () |
Get the workspace with peak data from the 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::Workspace_sptr | m_workspace |
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... | |
Domain creator for LatticeDomain, which processes IPeaksWorkspace or an ITableWorkspace with certain columns (HKL, d).
Definition at line 27 of file LatticeDomainCreator.h.
Mantid::CurveFitting::LatticeDomainCreator::LatticeDomainCreator | ( | Kernel::IPropertyManager * | manager, |
const std::string & | workspacePropertyName, | ||
DomainType | domainType = Simple |
||
) |
Constructor.
Definition at line 28 of file LatticeDomainCreator.cpp.
|
overridevirtual |
Creates a LatticeDomain from the assigned Workspace.
This function uses the internally stored workspace which can either be an IPeaksWorkspace or a TableWorkspace with HKL and d-values to create a LatticeDomain. It also assigns fit data to the supplied value object. If null-pointers are passed, new objects are allocated.
Reflections where HKL is (000) are ignored, so the final domain size may be smaller than the number of rows in the input workspace.
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 48 of file LatticeDomainCreator.cpp.
References createDomainFromPeaksWorkspace(), createDomainFromPeakTable(), m_workspace, and setWorkspaceFromPropertyManager().
|
protected |
Creates a LatticeDomain from an IPeaksWorkspace, using HKL and d-values.
Definition at line 151 of file LatticeDomainCreator.cpp.
References Mantid::Geometry::IPeak::getDSpacing(), Mantid::Geometry::IPeak::getHKL(), and workspace.
Referenced by createDomain().
|
protected |
Creates a domain from an ITableWorkspace.
This method creates a LatticeDomain from a table workspace that contains two columns, HKL and d. HKL can either be a V3D-column or a string column, containing three integers separated by space, comma, semi-colon and optionally surrounded by []. The d-column can be double or a string that can be parsed as a double number.
workspace | :: ITableWorkspace with format specified above. |
domain | :: Pointer to outgoing FunctionDomain instance. |
values | :: Pointer to outgoing FunctionValues object. |
i0 | :: Size offset for values object if it already contains data. |
Definition at line 210 of file LatticeDomainCreator.cpp.
References Mantid::Geometry::d, and workspace.
Referenced by createDomain().
|
overridevirtual |
Creates an output workspace from calculated and observed values.
This method creates a table workspace for an ILatticeFunction, containing observed and calculated d-values for each HKL, as well as the difference between those two values.
baseName | :: Basename for output workspace. |
function | :: An ILatticeFunction |
domain | :: Pointer to LatticeDomain instance. |
values | :: Pointer to FunctionValues instance. |
outputWorkspacePropertyName | :: Name of output workspace property. |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 77 of file LatticeDomainCreator.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().
|
overridevirtual |
Return the size of the domain to be created.
Implements Mantid::API::IDomainCreator.
Definition at line 123 of file LatticeDomainCreator.cpp.
References m_workspace.
|
protected |
Get the workspace with peak data from the property manager.
Definition at line 138 of file LatticeDomainCreator.cpp.
References Mantid::Kernel::IPropertyManager::getProperty(), Mantid::API::IDomainCreator::m_manager, m_workspace, and m_workspacePropertyName.
Referenced by createDomain().
|
protected |
Definition at line 53 of file LatticeDomainCreator.h.
Referenced by createDomain(), getDomainSize(), and setWorkspaceFromPropertyManager().
|
protected |
Definition at line 52 of file LatticeDomainCreator.h.
Referenced by setWorkspaceFromPropertyManager().