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 {
13namespace Algorithms {
38class MANTID_ALGORITHMS_DLL Rebin : public API::DistributedAlgorithm {
39public:
41 const std::string name() const override { return "Rebin"; }
43 const std::string summary() const override {
44 return "Rebins data with new X bin boundaries. For EventWorkspaces, you "
45 "can very quickly rebin in-place by keeping the same output name "
46 "and PreserveEvents=true.";
47 }
48
50 int version() const override { return 1; }
52 const std::string category() const override { return "Transforms\\Rebin"; }
54 const std::string alias() const override { return "rebin"; }
56 const std::vector<std::string> seeAlso() const override {
57 return {"RebinToWorkspace", "Rebin2D", "Rebunch", "Regroup", "RebinByPulseTimes", "RebinByTimeAtSample"};
58 }
59 std::map<std::string, std::string> validateInputs() override;
60
61 static std::vector<double> rebinParamsFromInput(const std::vector<double> &inParams,
62 const API::MatrixWorkspace &inputWS, Kernel::Logger &logger);
63
64protected:
65 const std::string workspaceMethodName() const override { return "rebin"; }
66 const std::string workspaceMethodOnTypes() const override { return "MatrixWorkspace"; }
67 const std::string workspaceMethodInputProperty() const override { return "InputWorkspace"; }
68
69 // Overridden Algorithm methods
70 void init() override;
71 void exec() override;
72
73 void propagateMasks(const API::MatrixWorkspace_const_sptr &inputWS, const API::MatrixWorkspace_sptr &outputWS,
74 int hist);
75};
76
77} // namespace Algorithms
78} // namespace Mantid
Base class for algorithms that treat all spectra independently, i.e., we can trivially parallelize ov...
Base MatrixWorkspace Abstract Class.
Takes a workspace as input and rebins the data according to the input rebin parameters.
Definition: Rebin.h:38
const std::string workspaceMethodInputProperty() const override
Returns the name of the input workspace property used by the calling object.
Definition: Rebin.h:67
const std::string alias() const override
Algorithm's aliases.
Definition: Rebin.h:54
const std::string workspaceMethodName() const override
Definition: Rebin.h:65
const std::string summary() const override
Summary of algorithms purpose.
Definition: Rebin.h:43
const std::vector< std::string > seeAlso() const override
Algorithm's seeAlso.
Definition: Rebin.h:56
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: Rebin.h:52
const std::string workspaceMethodOnTypes() const override
Returns a semi-colon separated list of workspace types to attach this algorithm.
Definition: Rebin.h:66
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Rebin.h:50
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Rebin.h:41
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
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.