Mantid
Loading...
Searching...
No Matches
RebinToWorkspace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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
11#include "MantidAlgorithms/DllConfig.h"
12
13namespace Mantid {
14
15namespace Algorithms {
30class MANTID_ALGORITHMS_DLL RebinToWorkspace : public Mantid::API::Algorithm {
31public:
33 const std::string name() const override { return "RebinToWorkspace"; }
35 const std::string summary() const override {
36 return "Rebin a selected workspace to the same binning as a different "
37 "workspace";
38 }
39
41 int version() const override { return (1); }
42
44 const std::string category() const override { return "Transforms\\Rebin"; }
46 const std::vector<std::string> seeAlso() const override { return {"Rebin"}; }
47
48protected:
49 Parallel::ExecutionMode
50 getParallelExecutionMode(const std::map<std::string, Parallel::StorageMode> &storageModes) const override;
51
52private:
53 bool m_preserveEvents{true};
54 bool m_isEvents{true};
55
57 void init() override;
59 void exec() override;
60
61 bool needToRebin(const API::MatrixWorkspace_sptr &left, const API::MatrixWorkspace_sptr &rght);
63 void histogram(API::MatrixWorkspace_sptr &toRebin, API::MatrixWorkspace_sptr &toMatch);
64};
65} // namespace Algorithms
66} // namespace Mantid
double left
Definition: LineProfile.cpp:80
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Rebins a workspace so that the binning, for all its spectra, match that of the first spectrum of a se...
const std::vector< std::string > seeAlso() const override
Algorithm's seeAlso.
const std::string category() const override
Algorithm's category for identification.
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
Algorithm's name.
int version() const override
Algorithm's version.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void MANTID_KERNEL_DLL rebin(const std::vector< double > &xold, const std::vector< double > &yold, const std::vector< double > &eold, const std::vector< double > &xnew, std::vector< double > &ynew, std::vector< double > &enew, bool distribution, bool addition=false)
Rebins data according to a new output X array.
Helper class which provides the Collimation Length for SANS instruments.