31using namespace DataObjects;
32using namespace Kernel;
38 return "Computes S(Q,w) using a either centre point or parallel-piped "
40 "The output from each method is:\n"
41 "CentrePoint - centre-point rebin that takes no account of pixel "
42 "curvature or area overlap\n\n"
43 "Polygon - parallel-piped rebin, outputting a weighted-sum of "
44 "overlapping polygons\n\n"
45 "NormalisedPolygon - parallel-piped rebin, outputting a weighted-sum "
47 "overlapping polygons normalised by the fractional area of each "
58 const char *methodOptions[] = {
"Centre",
"Polygon",
"NormalisedPolygon"};
59 this->declareProperty(
61 std::make_shared<StringListValidator>(std::vector<std::string>(methodOptions, methodOptions + 3)),
62 "Defines the method used to compute the output.");
70 auto wsValidator = std::make_shared<CompositeValidator>();
77 "Reduced data in units of energy transfer DeltaE.\nThe "
78 "workspace must contain histogram data and have common "
79 "bins across all spectra.");
81 "The name to use for the q-omega workspace.");
83 "The bin parameters to use for the q axis (in the format used by the "
84 ":ref:`algm-Rebin` algorithm).");
86 const std::vector<std::string> propOptions{
"Direct",
"Indirect"};
87 alg.
declareProperty(
"EMode",
"", std::make_shared<StringListValidator>(propOptions),
88 "The energy transfer analysis mode (Direct/Indirect)");
89 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
90 mustBePositive->setLower(0.0);
92 "The value of fixed energy: :math:`E_i` (EMode=Direct) "
93 "or :math:`E_f` (EMode=Indirect) (meV).\nMust be set "
94 "here if not available in the instrument definition.");
96 "If true, all NaN values in the output workspace are "
97 "replaced using the ReplaceSpecialValues algorithm.",
100 std::make_unique<
ArrayProperty<double>>(
"EAxisBinning", std::make_shared<RebinParamsValidator>(
true)),
101 "The bin parameters to use for the E axis (optional, in the format "
102 "used by the :ref:`algm-Rebin` algorithm).");
105 "A table workspace use by SofQWNormalisedPolygon containing a 'Detector "
106 "ID' column as well as 'Min two theta' and 'Max two theta' columns "
107 "listing the detector's min and max scattering angles in radians.");
113 std::string child =
"SofQW" + method;
119 childAlg->copyPropertiesFrom(*
this);
124 this->setProperty(
"OutputWorkspace", outputWS);
128 const size_t nHistos = inputWorkspace->getNumberHistograms();
129 auto m_progress = std::make_unique<Progress>(
this, 0.0, 1.0, nHistos);
130 m_progress->report(
"Creating output workspace");
#define DECLARE_ALGORITHM(classname)
Base class from which all concrete algorithm classes should be derived.
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
A validator which provides a TENTATIVE check that a workspace contains common bins in each spectrum.
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.
Kernel::IPropertyManager::TypedValue getProperty(const std::string &name) const override
Get the property held by this object.
A validator which checks that a workspace contains histogram data (the default) or point data as requ...
A validator which checks that a workspace has a valid instrument.
A validator which checks whether the input workspace has the Spectra number in the axis.
A property class for workspaces.
A validator which checks that the unit of the workspace referred to by a WorkspaceProperty is the exp...
static void createCommonInputProperties(API::Algorithm &alg)
Create the input properties on the given algorithm object.
const std::string summary() const override
Summary of algorithms purpose.
void init() override
Initialization code.
void exec() override
Execution code.
Support for a property that holds an array of values.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
@ Input
An input workspace.
@ Output
An output workspace.