Mantid
Loading...
Searching...
No Matches
ScaleX.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
14#include "MantidAlgorithms/DllConfig.h"
15
16#include <boost/function.hpp>
17
18namespace Mantid {
19namespace Algorithms {
34class MANTID_ALGORITHMS_DLL ScaleX final : public API::Algorithm {
35public:
37 ScaleX();
38
40 const std::string name() const override { return "ScaleX"; }
42 const std::string summary() const override {
43 return "Scales the X-axis of an input workspace by the given factor, which "
44 "can be either multiplicative or additive.";
45 }
46
48 int version() const override { return 1; }
49 const std::vector<std::string> seeAlso() const override { return {"ChangeBinOffset", "Scale"}; }
51 const std::string category() const override { return "Arithmetic;CorrectionFunctions"; }
52
53private:
54 // Overridden Algorithm methods
55 void init() override;
56 void exec() override;
58 void execEvent();
59
61 API::MatrixWorkspace_sptr createOutputWS(const API::MatrixWorkspace_sptr &input);
63 double getScaleFactor(const API::MatrixWorkspace_const_sptr &inputWS, const size_t index);
64
66 std::unique_ptr<API::Progress> m_progress;
67
71 std::string m_parname;
75 boost::function<double(double, double)> m_binOp;
80};
81
82} // namespace Algorithms
83} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Takes a workspace and adjusts all the time bin values by the same multiplicative factor.
Definition: ScaleX.h:34
boost::function< double(double, double)> m_binOp
Function defining request operation.
Definition: ScaleX.h:75
double m_algFactor
Scaling factor.
Definition: ScaleX.h:69
int m_wi_min
Start workspace index.
Definition: ScaleX.h:77
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: ScaleX.h:51
int m_wi_max
Stop workspace index.
Definition: ScaleX.h:79
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: ScaleX.h:48
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: ScaleX.h:40
const std::string summary() const override
Summary of algorithms purpose.
Definition: ScaleX.h:42
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: ScaleX.h:49
std::string m_parname
instrument parameter name
Definition: ScaleX.h:71
bool m_combine
Flag whether we are combining input parameters.
Definition: ScaleX.h:73
std::unique_ptr< API::Progress > m_progress
The progress reporting object.
Definition: ScaleX.h:66
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.