Mantid
Loading...
Searching...
No Matches
ConvertToHistogram.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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//------------------------------------------------------------------------------
8// Includes
9//------------------------------------------------------------------------------
13
14namespace Mantid::Algorithms {
15
16DECLARE_ALGORITHM(ConvertToHistogram)
17
20using std::size_t;
21
22//------------------------------------------------------------------------------
23// Private member functions
24//------------------------------------------------------------------------------
25
32 if (inputWS->isHistogramData()) {
33 g_log.information() << "Input workspace already contains histogram data. "
34 << "OutputWorkspace set to InputWorkspace value.\n";
35 return false;
36 }
37 return true;
38}
39
45size_t ConvertToHistogram::getNewXSize(const std::size_t ySize) const { return ySize + 1; }
46
57 return HistogramData::BinEdges(HistogramData::Points(inputX)).cowData();
58}
59} // namespace Mantid::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
bool isProcessingRequired(const API::MatrixWorkspace_sptr inputWS) const override
Returns true if the algorithm needs to be run.
Kernel::cow_ptr< HistogramData::HistogramX > calculateXPoints(Kernel::cow_ptr< HistogramData::HistogramX > inputX) const override
Calculate the X point values. Implement in an inheriting class.
std::size_t getNewXSize(const std::size_t ySize) const override
Returns the size of the new X vector.
void information(const std::string &msg)
Logs at information level.
Definition: Logger.cpp:105
Implements a copy on write data template.
Definition: cow_ptr.h:41
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces
Definition: cow_ptr.h:172