47 const std::string
name()
const override {
return "SofQW"; }
49 const std::string summary()
const override;
52 int version()
const override {
return (1); }
53 const std::vector<std::string>
seeAlso()
const override {
54 return {
"SofQWCentre",
"SofQWPolygon",
"SofQWNormalisedPolygon",
"Rebin2D"};
57 const std::string
category()
const override {
return "Inelastic\\SofQW"; }
59 template <
typename Workspace>
60 static std::unique_ptr<Workspace>
61 setUpOutputWorkspace(
const API::MatrixWorkspace &inputWorkspace,
const std::vector<double> &qbinParams,
62 std::vector<double> &qAxis,
const std::vector<double> &ebinParams,
85template <
typename Workspace>
86std::unique_ptr<Workspace>
88 std::vector<double> &qAxis,
const std::vector<double> &ebinParams,
92 HistogramData::BinEdges xAxis(0);
93 double eMin{std::nan(
"")};
94 double eMax{std::nan(
"")};
95 if (ebinParams.empty()) {
97 }
else if (ebinParams.size() == 1) {
106 if (qbinParams.size() == 1) {
107 if (std::isnan(eMin)) {
112 std::tie(qMin, qMax) = emodeProperties.
qBinHints(inputWorkspace, eMin, eMax);
119 auto outputWorkspace = DataObjects::create<Workspace>(inputWorkspace, yLength - 1, xAxis);
122 auto verticalAxis = std::make_unique<API::BinEdgeAxis>(qAxis);
123 auto verticalAxisRaw = verticalAxis.get();
124 outputWorkspace->replaceAxis(1, std::move(verticalAxis));
128 verticalAxisRaw->title() =
"|Q|";
131 outputWorkspace->getAxis(0)->title() =
"Energy transfer";
133 outputWorkspace->setYUnit(
"");
134 outputWorkspace->setYUnitLabel(
"Intensity");
136 return outputWorkspace;
Base class from which all concrete algorithm classes should be derived.
Data processor algorithm to be used as a parent to workflow algorithms.
Base MatrixWorkspace Abstract Class.
HistogramData::BinEdges binEdges(const size_t index) const
virtual void getXMinMax(double &xmin, double &xmax) const
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name.
static std::unique_ptr< Workspace > setUpOutputWorkspace(const API::MatrixWorkspace &inputWorkspace, const std::vector< double > &qbinParams, std::vector< double > &qAxis, const std::vector< double > &ebinParams, const SofQCommon &emodeProperties)
Create the output workspace.
const std::vector< std::string > seeAlso() const override
int version() const override
Algorithm's version.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
int MANTID_KERNEL_DLL createAxisFromRebinParams(const std::vector< double > ¶ms, std::vector< double > &xnew, const bool resize_xnew=true, const bool full_bins_only=false, const double xMinHint=std::nan(""), const double xMaxHint=std::nan(""), const bool useReverseLogarithmic=false, const double power=-1)
Creates a new output X array given a 'standard' set of rebinning parameters.
Helper class which provides the Collimation Length for SANS instruments.
std::pair< double, double > qBinHints(const API::MatrixWorkspace &ws, const double minE, const double maxE) const
Estimate minimum and maximum momentum transfer.