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"
15#include "MantidAlgorithms/DllConfig.h"
16
17#include <boost/function.hpp>
18
19namespace Mantid {
20namespace Algorithms {
35class MANTID_ALGORITHMS_DLL ScaleX final : public API::Algorithm {
36public:
38 ScaleX();
39
41 const std::string name() const override { return "ScaleX"; }
43 const std::string summary() const override {
44 return "Scales the X-axis of an input workspace by the given factor, which "
45 "can be either multiplicative or additive.";
46 }
47
49 int version() const override { return 1; }
50 const std::vector<std::string> seeAlso() const override { return {"ChangeBinOffset", "Scale"}; }
52 const std::string category() const override { return "Arithmetic;CorrectionFunctions"; }
53
54private:
55 // Overridden Algorithm methods
56 void init() override;
57 void exec() override;
59 void execEvent();
60
62 API::MatrixWorkspace_sptr createOutputWS(const API::MatrixWorkspace_sptr &input);
64 double getScaleFactor(const API::MatrixWorkspace_const_sptr &inputWS, const Mantid::API::SpectrumInfo &spectrumInfo,
65 const size_t index);
66
68 std::unique_ptr<API::Progress> m_progress;
69
73 std::string m_parname;
77 boost::function<double(double, double)> m_binOp;
82};
83
84} // namespace Algorithms
85} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Takes a workspace and adjusts all the time bin values by the same multiplicative factor.
Definition ScaleX.h:35
boost::function< double(double, double)> m_binOp
Function defining request operation.
Definition ScaleX.h:77
double m_algFactor
Scaling factor.
Definition ScaleX.h:71
int m_wi_min
Start workspace index.
Definition ScaleX.h:79
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition ScaleX.h:52
int m_wi_max
Stop workspace index.
Definition ScaleX.h:81
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition ScaleX.h:49
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition ScaleX.h:41
const std::string summary() const override
Summary of algorithms purpose.
Definition ScaleX.h:43
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition ScaleX.h:50
std::string m_parname
instrument parameter name
Definition ScaleX.h:73
bool m_combine
Flag whether we are combining input parameters.
Definition ScaleX.h:75
std::unique_ptr< API::Progress > m_progress
The progress reporting object.
Definition ScaleX.h:68
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.