From 13fbdad8892a9e9715f33e943d842d773db2741a Mon Sep 17 00:00:00 2001 From: Verena Reimund <reimund@ill.eu> Date: Thu, 15 Mar 2018 15:39:35 +0100 Subject: [PATCH] Add Dx to HistogramBuilder Refs #22083 --- .../HistogramData/inc/MantidHistogramData/HistogramBuilder.h | 5 +++++ Framework/HistogramData/src/HistogramBuilder.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Framework/HistogramData/inc/MantidHistogramData/HistogramBuilder.h b/Framework/HistogramData/inc/MantidHistogramData/HistogramBuilder.h index f99d3a7b586..a7f0ee9ad0f 100644 --- a/Framework/HistogramData/inc/MantidHistogramData/HistogramBuilder.h +++ b/Framework/HistogramData/inc/MantidHistogramData/HistogramBuilder.h @@ -50,6 +50,10 @@ public: template <typename... T> void setE(T &&... data) { m_e = Kernel::make_cow<HistogramE>(std::forward<T>(data)...); } + /// Sets Dx information. Can be a length or actual Dx data. + template <typename... T> void setDx(T &&... data){ + d_x = Kernel::make_cow<HistogramDx>(std::forward<T>(data)...); + } void setDistribution(bool isDistribution); Histogram build() const; @@ -59,6 +63,7 @@ private: Kernel::cow_ptr<HistogramX> m_x{nullptr}; Kernel::cow_ptr<HistogramY> m_y{nullptr}; Kernel::cow_ptr<HistogramE> m_e{nullptr}; + Kernel::cow_ptr<HistogramDx> d_x{nullptr}; }; } // namespace HistogramData diff --git a/Framework/HistogramData/src/HistogramBuilder.cpp b/Framework/HistogramData/src/HistogramBuilder.cpp index 44932841a90..6f43a9f72df 100644 --- a/Framework/HistogramData/src/HistogramBuilder.cpp +++ b/Framework/HistogramData/src/HistogramBuilder.cpp @@ -34,6 +34,8 @@ Histogram HistogramBuilder::build() const { } if (m_e) histogram->setSharedE(m_e); + if (d_x) + histogram->setSharedDx(d_x); return *histogram; } -- GitLab