Mantid
Loading...
Searching...
No Matches
Rebin.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
10#include "MantidAlgorithms/DllConfig.h"
11
12namespace Mantid {
13
14namespace Algorithms {
39class MANTID_ALGORITHMS_DLL Rebin : public API::Algorithm {
40public:
42 const std::string name() const override { return "Rebin"; }
44 const std::string summary() const override {
45 return "Rebins data with new X bin boundaries. For EventWorkspaces, you "
46 "can very quickly rebin in-place by keeping the same output name "
47 "and PreserveEvents=true.";
48 }
49
51 int version() const override { return 1; }
53 const std::string category() const override { return "Transforms\\Rebin"; }
55 const std::string alias() const override { return "rebin"; }
57 const std::vector<std::string> seeAlso() const override {
58 return {"RebinToWorkspace", "Rebin2D", "Rebunch", "Regroup", "RebinByPulseTimes", "RebinByTimeAtSample"};
59 }
60 std::map<std::string, std::string> validateInputs() override;
61
62 static std::vector<double> rebinParamsFromInput(const std::vector<double> &inParams,
63 const API::MatrixWorkspace &inputWS, Kernel::Logger &logger,
64 const std::string &binModeName = "Default");
65
66protected:
67 const std::string workspaceMethodName() const override { return "rebin"; }
68 const std::string workspaceMethodOnTypes() const override { return "MatrixWorkspace"; }
69 const std::string workspaceMethodInputProperty() const override { return "InputWorkspace"; }
70
71 // Overridden Algorithm methods
72 void init() override;
73 void exec() override;
74
75 void propagateMasks(const API::MatrixWorkspace_const_sptr &inputWS, const API::MatrixWorkspace_sptr &outputWS,
76 const int hist, const bool IgnoreBinErrors = false);
77};
78
79} // namespace Algorithms
80} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Base MatrixWorkspace Abstract Class.
Takes a workspace as input and rebins the data according to the input rebin parameters.
Definition Rebin.h:39
const std::string workspaceMethodInputProperty() const override
Returns the name of the input workspace property used by the calling object.
Definition Rebin.h:69
const std::string alias() const override
Algorithm's aliases.
Definition Rebin.h:55
const std::string workspaceMethodName() const override
Definition Rebin.h:67
const std::string summary() const override
Summary of algorithms purpose.
Definition Rebin.h:44
const std::vector< std::string > seeAlso() const override
Algorithm's seeAlso.
Definition Rebin.h:57
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition Rebin.h:53
const std::string workspaceMethodOnTypes() const override
Returns a semi-colon separated list of workspace types to attach this algorithm.
Definition Rebin.h:68
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition Rebin.h:51
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition Rebin.h:42
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
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.