Mantid
Loading...
Searching...
No Matches
Regroup.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
16namespace Mantid {
17namespace HistogramData {
18class HistogramX;
19class HistogramY;
20class HistogramE;
21} // namespace HistogramData
22namespace Algorithms {
37class MANTID_ALGORITHMS_DLL Regroup final : public API::Algorithm {
38public:
40 const std::string name() const override { return "Regroup"; }
42 const std::string summary() const override { return "Regroups data with new bin boundaries."; }
43
45 int version() const override { return 1; }
46 const std::vector<std::string> seeAlso() const override { return {"Rebin"}; }
48 const std::string category() const override { return "Transforms\\Rebin"; }
49
50 int newAxis(const std::vector<double> &params, const std::vector<double> &xold, std::vector<double> &xnew,
51 std::vector<int> &xoldIndex);
52
53private:
54 // Overridden Algorithm methods
55 void init() override;
56 void exec() override;
57
58 void rebin(const HistogramData::HistogramX &xold, const HistogramData::HistogramY &yold,
59 const HistogramData::HistogramE &eold, const std::vector<int> &xoldIndex, HistogramData::HistogramY &ynew,
60 HistogramData::HistogramE &enew, bool distribution);
61};
62
63} // namespace Algorithms
64} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Takes a 2D workspace as input and regroups the data according to the input regroup parameters.
Definition: Regroup.h:37
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Regroup.h:45
const std::string summary() const override
Summary of algorithms purpose.
Definition: Regroup.h:42
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Regroup.h:40
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: Regroup.h:48
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: Regroup.h:46
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.