Mantid
Loading...
Searching...
No Matches
XDataConverter.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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"
12
13namespace Mantid {
14namespace HistogramData {
15class HistogramDx;
16class HistogramX;
17} // namespace HistogramData
18namespace Algorithms {
29class MANTID_ALGORITHMS_DLL XDataConverter : public API::DistributedAlgorithm {
30public:
34 int version() const override { return 1; }
36 const std::string category() const override { return "General"; }
37
38protected:
40 virtual bool isProcessingRequired(const API::MatrixWorkspace_sptr inputWS) const = 0;
42 virtual std::size_t getNewXSize(const std::size_t ySize) const = 0;
46
47private:
49 void init() override;
51 void exec() override;
52
53 std::size_t getNewYSize(const API::MatrixWorkspace_sptr &inputWS);
54
56 void setXData(const API::MatrixWorkspace_sptr &outputWS, const API::MatrixWorkspace_sptr &inputWS, const int index);
57
62};
63
64} // namespace Algorithms
65} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Base class for algorithms that treat all spectra independently, i.e., we can trivially parallelize ov...
This is an abstract base class for sharing methods between algorithms that operate only on X data.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
virtual Kernel::cow_ptr< HistogramData::HistogramX > calculateXPoints(const Kernel::cow_ptr< HistogramData::HistogramX > inputX) const =0
Calculate the X point values. Implement in an inheriting class.
int version() const override
Algorithm's version for identification overriding a virtual method.
bool m_sharedX
Flag if the X data is shared.
virtual std::size_t getNewXSize(const std::size_t ySize) const =0
Returns the size of the new X vector.
virtual bool isProcessingRequired(const API::MatrixWorkspace_sptr inputWS) const =0
Returns true if the algorithm needs to be run.
Implements a copy on write data template.
Definition: cow_ptr.h:41
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.