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
16#include <span>
17
18namespace Mantid {
19namespace HistogramData {
20class HistogramX;
21class HistogramY;
22class HistogramE;
23} // namespace HistogramData
24namespace Algorithms {
39class MANTID_ALGORITHMS_DLL Regroup final : public API::Algorithm {
40public:
42 const std::string name() const override { return "Regroup"; }
44 const std::string summary() const override { return "Regroups data with new bin boundaries."; }
45
47 int version() const override { return 1; }
48 const std::vector<std::string> seeAlso() const override { return {"Rebin"}; }
50 const std::string category() const override { return "Transforms\\Rebin"; }
51
52 int newAxis(const std::vector<double> &params, std::span<double const> xold, std::vector<double> &xnew,
53 std::vector<int> &xoldIndex);
54
55private:
56 // Overridden Algorithm methods
57 void init() override;
58 void exec() override;
59
60 void rebin(const HistogramData::HistogramX &xold, const HistogramData::HistogramY &yold,
61 const HistogramData::HistogramE &eold, const std::vector<int> &xoldIndex, HistogramData::HistogramY &ynew,
62 HistogramData::HistogramE &enew, bool distribution);
63};
64
65} // namespace Algorithms
66} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Takes a 2D workspace as input and regroups the data according to the input regroup parameters.
Definition Regroup.h:39
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition Regroup.h:47
const std::string summary() const override
Summary of algorithms purpose.
Definition Regroup.h:44
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition Regroup.h:42
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition Regroup.h:50
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition Regroup.h:48
void MANTID_KERNEL_DLL rebin(std::span< double const > xold, std::span< double const > yold, std::span< double const > eold, std::span< double const > xnew, std::span< double > ynew, std::span< double > enew, bool distribution, bool addition=false)
The input and output ranges are taken as spans so that the size-checked histogram data types,...
Helper class which provides the Collimation Length for SANS instruments.