24using namespace Kernel;
26using namespace DataObjects;
30 "Flood field or sensitivity file.");
32 "Workspace defining the area of the detector to be patched. "
33 "All masked pixels in this workspace will be patched.");
34 declareProperty(
"ReductionProperties",
"__eqsans_reduction_properties",
Direction::Input);
36 "Workspace containing the sensitivity correction.");
41 std::string outputMessage;
42 progress(0.1,
"Setting up sensitivity calculation");
50 if (reductionManager->existsProperty(
"SANSBeamFinderAlgorithm")) {
54 IAlgorithm_sptr ctrAlg = reductionManager->getProperty(
"SANSBeamFinderAlgorithm");
55 ctrAlg->setPropertyValue(
"ReductionProperties",
getPropertyValue(
"ReductionProperties"));
56 ctrAlg->setChild(
true);
58 std::string outMsg2 = ctrAlg->getPropertyValue(
"OutputMessage");
59 outputMessage += outMsg2;
62 progress(0.2,
"Computing sensitivity");
67 if (!patchWSName.empty()) {
69 patchAlg->setPropertyValue(
"PatchWorkspace", patchWSName);
70 if (!reductionManager->existsProperty(
"SensitivityPatchAlgorithm")) {
71 reductionManager->declareProperty(std::make_unique<AlgorithmProperty>(
"SensitivityPatchAlgorithm"));
73 reductionManager->setProperty(
"SensitivityPatchAlgorithm", patchAlg);
76 if (reductionManager->existsProperty(
"SensitivityAlgorithm")) {
78 IAlgorithm_sptr effAlg = reductionManager->getProperty(
"SensitivityAlgorithm");
79 effAlg->setChild(
true);
80 effAlg->setProperty(
"Filename", fileName);
81 effAlg->setPropertyValue(
"OutputSensitivityWorkspace", outputWS);
84 setProperty(
"OutputWorkspace", effWS);
85 std::string outMsg2 = effAlg->getPropertyValue(
"OutputMessage");
86 outputMessage += outMsg2;
87 setProperty(
"OutputMessage", outputMessage);
89 g_log.
error() <<
"Could not find sensitivity algorithm\n";
#define DECLARE_ALGORITHM(classname)
@ Load
allowed here which will be passed to the algorithm
std::shared_ptr< Kernel::PropertyManager > getProcessProperties(const std::string &propertyManager=std::string()) const
Get the property manager object of a given name from the property manager data service,...
std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1) override
Create a Child Algorithm.
std::string getPropertyValue(const std::string &name) const override
Get the property held by this object.
A property class for workspaces.
void error(const std::string &msg)
Logs at error level.
void init() override
Initialisation code.
void exec() override
Execution code.
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
@ Input
An input workspace.
@ Output
An output workspace.