31using namespace DataObjects;
32using namespace Kernel;
38 return "Computes S(Q,w) via the SofQWNormalisedPolygon algorithm.\n"
39 "The output is a parallel-piped rebin, outputting a weighted-sum "
40 "of overlapping polygons normalised by the fractional area of each "
54 auto wsValidator = std::make_shared<CompositeValidator>();
61 "Reduced data in units of energy transfer DeltaE.\nThe "
62 "workspace must contain histogram data and have common "
63 "bins across all spectra.");
65 "The name to use for the q-omega workspace.");
67 "The bin parameters to use for the q axis (in the format used by the "
68 ":ref:`algm-Rebin` algorithm).");
70 const std::vector<std::string> propOptions{
"Direct",
"Indirect"};
71 alg.
declareProperty(
"EMode",
"", std::make_shared<StringListValidator>(propOptions),
72 "The energy transfer analysis mode (Direct/Indirect)");
73 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
74 mustBePositive->setLower(0.0);
76 "The value of fixed energy: :math:`E_i` (EMode=Direct) "
77 "or :math:`E_f` (EMode=Indirect) (meV).\nMust be set "
78 "here if not available in the instrument definition.");
80 "If true, all NaN values in the output workspace are "
81 "replaced using the ReplaceSpecialValues algorithm.",
84 std::make_unique<
ArrayProperty<double>>(
"EAxisBinning", std::make_shared<RebinParamsValidator>(
true)),
85 "The bin parameters to use for the E axis (optional, in the format "
86 "used by the :ref:`algm-Rebin` algorithm).");
89 "A table workspace use by SofQWNormalisedPolygon containing a 'Detector "
90 "ID' column as well as 'Min two theta' and 'Max two theta' columns "
91 "listing the detector's min and max scattering angles in radians.");
95 std::string child =
"SofQWNormalisedPolygon";
101 childAlg->copyPropertiesFrom(*
this);
106 this->setProperty(
"OutputWorkspace", outputWS);
110 const size_t nHistos = inputWorkspace->getNumberHistograms();
111 auto m_progress = std::make_unique<Progress>(
this, 0.0, 1.0, nHistos);
112 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.