-
Notifications
You must be signed in to change notification settings - Fork 124
/
ConvertToHistogram.h
54 lines (48 loc) · 2.01 KB
/
ConvertToHistogram.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_ALGORITHMS_CONVERTTOHISTOGRAM_H_
#define MANTID_ALGORITHMS_CONVERTTOHISTOGRAM_H_
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include "MantidAlgorithms/XDataConverter.h"
namespace Mantid {
namespace Algorithms {
/**
Converts a histogram workspace to point data by simply taking the centre point
of the bin
as the new point on the X axis
@author Martyn Gigg, Tessella plc
@date 2010-12-21
*/
class DLLExport ConvertToHistogram : public XDataConverter {
public:
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "ConvertToHistogram"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Converts a workspace containing point data into one containing "
"histograms.";
}
const std::vector<std::string> seeAlso() const override {
return {"ConvertToPointData"};
}
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override { return "Transforms\\Axes"; }
private:
/// Returns true if the algorithm needs to be run.
bool
isProcessingRequired(const API::MatrixWorkspace_sptr inputWS) const override;
/// Returns the size of the new X vector
std::size_t getNewXSize(const std::size_t ySize) const override;
/// Calculate the X point values. Implement in an inheriting class.
Kernel::cow_ptr<HistogramData::HistogramX> calculateXPoints(
Kernel::cow_ptr<HistogramData::HistogramX> inputX) const override;
};
} // namespace Algorithms
} // namespace Mantid
#endif /*MANTID_ALGORITHMS_CONVERTTOHISTOGRAM_H_*/