Mantid
Loading...
Searching...
No Matches
Functions
WorkflowAlgorithmHelpers Namespace Reference

Functions

bool getBoolPropOrParam (const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const bool overrideValue=false)
 Function to get boolean property or instrument parameter value. More...
 
double getDblPropOrParam (const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const double overrideValue=Mantid::EMPTY_DBL())
 Function to get double property or instrument parameter value. More...
 
int getIntPropOrParam (const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const int overrideValue=Mantid::EMPTY_INT())
 Function to get int property or instrument parameter value. More...
 

Function Documentation

◆ getBoolPropOrParam()

bool WorkflowAlgorithmHelpers::getBoolPropOrParam ( const std::string &  pmProp,
Mantid::Kernel::PropertyManager_sptr pm,
const std::string &  instParam,
Mantid::API::MatrixWorkspace_sptr ws,
const bool  overrideValue 
)

Function to get boolean property or instrument parameter value.

This function tries to get a boolean value from a particular algorithm property.

If that property does not exist, then the function tries to look up the parameter on the instrument in the given workspace for a given parameter name. If found, that value is returned. If not found, the default value (false) is returned. If the property exists, just use the value provided.

Parameters
pmProp: The name of the algorithm property to retrieve
pm: The property manager pointer to retrieve a property value from
instParam: The name of the instrument parameter to fetch from the workspace
ws: A workspace that should house the alternate parameter
overrideValue: A provided override value to hand back if nothing is found
Returns
: Either the algorithm property or an instrument parameter.

Definition at line 115 of file WorkflowAlgorithmHelpers.cpp.

Referenced by Mantid::WorkflowAlgorithms::DgsDiagnose::exec().

◆ getDblPropOrParam()

double WorkflowAlgorithmHelpers::getDblPropOrParam ( const std::string &  pmProp,
Mantid::Kernel::PropertyManager_sptr pm,
const std::string &  instParam,
Mantid::API::MatrixWorkspace_sptr ws,
const double  overrideValue 
)

Function to get double property or instrument parameter value.

This function tries to get a double value from a particular algorithm property.

If that property is the default (EMPTY_DBL()), then the function tries to look up the parameter on the instrument in the given workspace for a given parameter name. If found, that value is returned. If not found, the default value (EMPTY_DBL()) is returned.

Parameters
pmProp: The name of the algorithm property to retrieve
pm: The property manager pointer to retrieve a property value from
instParam: The name of the instrument parameter to fetch from the workspace
ws: A workspace that should house the alternate parameter
overrideValue: A provided override value to hand back if nothing is found
Returns
: Either the algorithm property or an instrument parameter.

Definition at line 33 of file WorkflowAlgorithmHelpers.cpp.

References Mantid::EMPTY_DBL().

Referenced by Mantid::WorkflowAlgorithms::DgsAbsoluteUnitsReduction::exec(), Mantid::WorkflowAlgorithms::DgsConvertToEnergyTransfer::exec(), Mantid::WorkflowAlgorithms::DgsDiagnose::exec(), Mantid::WorkflowAlgorithms::DgsPreprocessData::exec(), and Mantid::WorkflowAlgorithms::DgsProcessDetectorVanadium::exec().

◆ getIntPropOrParam()

int WorkflowAlgorithmHelpers::getIntPropOrParam ( const std::string &  pmProp,
Mantid::Kernel::PropertyManager_sptr pm,
const std::string &  instParam,
Mantid::API::MatrixWorkspace_sptr ws,
const int  overrideValue 
)

Function to get int property or instrument parameter value.

This function tries to get an int value from a particular algorithm property.

If that property is the default (EMPTY_INT()), then the function tries to look up the parameter on the instrument in the given workspace for a given parameter name. If found, that value is returned. If not found, the default value (EMPTY_INT()) is returned.

Parameters
pmProp: The name of the algorithm property to retrieve
pm: The property manager pointer to retrieve a property value from
instParam: The name of the instrument parameter to fetch from the workspace
ws: A workspace that should house the alternate parameter
overrideValue: A provided override value to hand back if nothing is found
Returns
: Either the algorithm property or an instrument parameter.

Definition at line 74 of file WorkflowAlgorithmHelpers.cpp.

References Mantid::EMPTY_INT().