Commit 66fdb835 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Rename LeanPeaksWorkspace to LeanElasticPeaksWorkspace

parent 4f21c1c7
......@@ -31,7 +31,7 @@ set(SRC_FILES
src/LeanElasticPeak.cpp
src/BasePeak.cpp
src/PeakColumn.cpp
src/LeanPeakColumn.cpp
src/LeanElasticPeakColumn.cpp
src/PeakNoShapeFactory.cpp
src/PeakShapeBase.cpp
src/PeakShapeEllipsoid.cpp
......@@ -39,7 +39,7 @@ set(SRC_FILES
src/PeakShapeSpherical.cpp
src/PeakShapeSphericalFactory.cpp
src/PeaksWorkspace.cpp
src/LeanPeaksWorkspace.cpp
src/LeanElasticPeaksWorkspace.cpp
src/PropertyWithValue.cpp
src/RebinnedOutput.cpp
src/ReflectometryTransform.cpp
......@@ -115,7 +115,7 @@ set(INC_FILES
inc/MantidDataObjects/LeanElasticPeak.h
inc/MantidDataObjects/BasePeak.h
inc/MantidDataObjects/PeakColumn.h
inc/MantidDataObjects/LeanPeakColumn.h
inc/MantidDataObjects/LeanElasticPeakColumn.h
inc/MantidDataObjects/PeakNoShapeFactory.h
inc/MantidDataObjects/PeakShapeBase.h
inc/MantidDataObjects/PeakShapeEllipsoid.h
......@@ -124,7 +124,7 @@ set(INC_FILES
inc/MantidDataObjects/PeakShapeSpherical.h
inc/MantidDataObjects/PeakShapeSphericalFactory.h
inc/MantidDataObjects/PeaksWorkspace.h
inc/MantidDataObjects/LeanPeaksWorkspace.h
inc/MantidDataObjects/LeanElasticPeaksWorkspace.h
inc/MantidDataObjects/RebinnedOutput.h
inc/MantidDataObjects/ReflectometryTransform.h
inc/MantidDataObjects/ScanningWorkspaceBuilder.h
......@@ -185,7 +185,7 @@ set(TEST_FILES
PeakTest.h
LeanElasticPeakTest.h
PeaksWorkspaceTest.h
LeanPeaksWorkspaceTest.h
LeanElasticPeaksWorkspaceTest.h
RebinnedOutputTest.h
RefAxisTest.h
ReflectometryTransformTest.h
......
......@@ -7,7 +7,7 @@
#pragma once
#include "MantidAPI/Column.h"
#include "MantidDataObjects/LeanPeak.h"
#include "MantidDataObjects/LeanElasticPeak.h"
#include <boost/variant.hpp>
#include <list>
......@@ -24,11 +24,11 @@ namespace DataObjects {
* @author Janik Zikovsky
* @date 2011-04-25 18:06:32.952258
*/
class DLLExport LeanPeakColumn : public Mantid::API::Column {
class DLLExport LeanElasticPeakColumn : public Mantid::API::Column {
public:
/// Construct a column with a reference to the peaks list, a name & type
LeanPeakColumn(std::vector<LeanPeak> &peaks, const std::string &name);
LeanElasticPeakColumn(std::vector<LeanElasticPeak> &peaks, const std::string &name);
/// Number of individual elements in the column.
size_t size() const override { return m_peaks.size(); }
......@@ -58,7 +58,7 @@ public:
long int sizeOfData() const override;
/// Clone.
LeanPeakColumn *clone() const override;
LeanElasticPeakColumn *clone() const override;
/// Cast to double
double toDouble(size_t i) const override;
......@@ -67,7 +67,7 @@ public:
void fromDouble(size_t i, double value) override;
/// Reference to the data.
const std::vector<LeanPeak> &data() const { return m_peaks; }
const std::vector<LeanElasticPeak> &data() const { return m_peaks; }
bool equals(const Column &otherColumn, double tolerance) const override {
(void)otherColumn;
......@@ -90,7 +90,7 @@ protected:
private:
/// Reference to the peaks object saved in the PeaksWorkspace.
std::vector<LeanPeak> &m_peaks;
std::vector<LeanElasticPeak> &m_peaks;
/// Precision of hkl in table workspace
int m_hklPrec;
......
......@@ -9,8 +9,8 @@
#include "MantidAPI/IPeaksWorkspace.h"
#include "MantidAPI/ITableWorkspace.h"
#include "MantidDataObjects/DllConfig.h"
#include "MantidDataObjects/LeanPeak.h"
#include "MantidDataObjects/LeanPeakColumn.h"
#include "MantidDataObjects/LeanElasticPeak.h"
#include "MantidDataObjects/LeanElasticPeakColumn.h"
#include "MantidGeometry/Crystal/IPeak.h"
#include "MantidKernel/SpecialCoordinateSystem.h"
#include "MantidKernel/V3D.h"
......@@ -26,24 +26,24 @@ class Logger;
namespace DataObjects {
//==========================================================================================
/** @class Mantid::DataObjects::LeanPeaksWorkspace
/** @class Mantid::DataObjects::LeanElasticPeaksWorkspace
The class LeanPeaksWorkspace stores information about a set of SCD lean
The class LeanElasticPeaksWorkspace stores information about a set of SCD lean
peaks.
@author Ruth Mikkelson, SNS ORNL
@date 3/10/2010
*/
class MANTID_DATAOBJECTS_DLL LeanPeaksWorkspace
class MANTID_DATAOBJECTS_DLL LeanElasticPeaksWorkspace
: public Mantid::API::IPeaksWorkspace {
public:
using ColumnAndDirection = std::pair<std::string, bool>;
public:
const std::string id() const override { return "LeanPeaksWorkspace"; }
const std::string id() const override { return "LeanElasticPeaksWorkspace"; }
LeanPeaksWorkspace();
LeanPeaksWorkspace &operator=(const LeanPeaksWorkspace &other) = delete;
LeanElasticPeaksWorkspace();
LeanElasticPeaksWorkspace &operator=(const LeanElasticPeaksWorkspace &other) = delete;
/** Get access to shared pointer containing workspace porperties. This
function is there to provide common interface of iTableWorkspace
......@@ -59,13 +59,13 @@ public:
API::LogManager_const_sptr getLogs() const override;
/// Returns a clone of the workspace
std::unique_ptr<LeanPeaksWorkspace> clone() const {
return std::unique_ptr<LeanPeaksWorkspace>(doClone());
std::unique_ptr<LeanElasticPeaksWorkspace> clone() const {
return std::unique_ptr<LeanElasticPeaksWorkspace>(doClone());
}
/// Returns a default-initialized clone of the workspace
std::unique_ptr<LeanPeaksWorkspace> cloneEmpty() const {
return std::unique_ptr<LeanPeaksWorkspace>(doCloneEmpty());
std::unique_ptr<LeanElasticPeaksWorkspace> cloneEmpty() const {
return std::unique_ptr<LeanElasticPeaksWorkspace>(doCloneEmpty());
}
void appendFile(std::string filename, Geometry::Instrument_sptr inst);
......@@ -82,11 +82,11 @@ public:
void removePeaks(std::vector<int> badPeaks) override;
void addPeak(const Geometry::IPeak &peak) override;
/// Move a peak object into this peaks workspace
void addPeak(LeanPeak &&peak);
void addPeak(LeanElasticPeak &&peak);
void addPeak(const Kernel::V3D &position,
const Kernel::SpecialCoordinateSystem &frame) override;
LeanPeak &getPeak(int peakNum) override;
const LeanPeak &getPeak(int peakNum) const override;
LeanElasticPeak &getPeak(int peakNum) override;
const LeanElasticPeak &getPeak(int peakNum) const override;
std::unique_ptr<Geometry::IPeak> createPeak(
const Kernel::V3D &QLabFrame,
......@@ -104,8 +104,8 @@ public:
int peakInfoNumber(const Kernel::V3D &qFrame, bool labCoords) const override;
std::vector<LeanPeak> &getPeaks();
const std::vector<LeanPeak> &getPeaks() const;
std::vector<LeanElasticPeak> &getPeaks();
const std::vector<LeanElasticPeak> &getPeaks() const;
bool hasIntegratedPeaks() const override;
size_t getMemorySize() const override;
......@@ -169,14 +169,14 @@ public:
protected:
/// Protected copy constructor. May be used by childs for cloning.
LeanPeaksWorkspace(const LeanPeaksWorkspace &other);
LeanElasticPeaksWorkspace(const LeanElasticPeaksWorkspace &other);
private:
LeanPeaksWorkspace *doClone() const override {
return new LeanPeaksWorkspace(*this);
LeanElasticPeaksWorkspace *doClone() const override {
return new LeanElasticPeaksWorkspace(*this);
}
LeanPeaksWorkspace *doCloneEmpty() const override {
return new LeanPeaksWorkspace();
LeanElasticPeaksWorkspace *doCloneEmpty() const override {
return new LeanElasticPeaksWorkspace();
}
ITableWorkspace *
doCloneColumns(const std::vector<std::string> &colNames) const override;
......@@ -196,83 +196,83 @@ private:
API::Column_sptr addColumn(const std::string & /*type*/,
const std::string & /*name*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace structure is read-only. Cannot add column.");
"LeanElasticPeaksWorkspace structure is read-only. Cannot add column.");
}
bool addColumns(const std::string & /*type*/, const std::string & /*name*/,
size_t /*n*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace structure is read-only. Cannot add columns.");
"LeanElasticPeaksWorkspace structure is read-only. Cannot add columns.");
}
void removeColumn(const std::string & /*name*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace structure is read-only. Cannot remove column.");
"LeanElasticPeaksWorkspace structure is read-only. Cannot remove column.");
}
void setRowCount(size_t /*count*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace structure is read-only. Cannot setRowCount");
"LeanElasticPeaksWorkspace structure is read-only. Cannot setRowCount");
}
size_t insertRow(size_t /*index*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace structure is read-only. Cannot insertRow");
"LeanElasticPeaksWorkspace structure is read-only. Cannot insertRow");
}
void removeRow(size_t /*index*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace structure is read-only. Cannot removeRow.");
"LeanElasticPeaksWorkspace structure is read-only. Cannot removeRow.");
}
/// find method to get the index of integer cell value in a table workspace
void find(size_t /*value*/, size_t & /*row*/,
const size_t & /*col*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace::find() not implemented.");
"LeanElasticPeaksWorkspace::find() not implemented.");
}
/// find method to get the index of double cell value in a table workspace
void find(double /*value*/, size_t & /*row*/,
const size_t & /*col*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace::find() not implemented.");
"LeanElasticPeaksWorkspace::find() not implemented.");
}
/// find method to get the index of float cell value in a table workspace
void find(float /*value*/, size_t & /*row*/,
const size_t & /*col*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace::find() not implemented.");
"LeanElasticPeaksWorkspace::find() not implemented.");
}
/// find method to get the index of API::Boolean value cell in a table
/// workspace
void find(API::Boolean /*value*/, size_t & /*row*/,
const size_t & /*col*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace::find() not implemented.");
"LeanElasticPeaksWorkspace::find() not implemented.");
}
/// find method to get the index of cellstd::string value in a table
/// workspace
void find(std::string /*value*/, size_t & /*row*/,
const size_t & /*col*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace::find() not implemented.");
"LeanElasticPeaksWorkspace::find() not implemented.");
}
/// find method to get the index of Mantid::Kernel::V3D cell value in a table
/// workspace
void find(Mantid::Kernel::V3D /*value*/, size_t & /*row*/,
const size_t & /*col*/) override {
throw Mantid::Kernel::Exception::NotImplementedError(
"LeanPeaksWorkspace::find() not implemented.");
"LeanElasticPeaksWorkspace::find() not implemented.");
}
// ====================================== End ITableWorkspace Methods
// ==================================
/** Vector of Peak contained within. */
std::vector<LeanPeak> peaks;
std::vector<LeanElasticPeak> peaks;
/** Column shared pointers. */
std::vector<std::shared_ptr<Mantid::DataObjects::LeanPeakColumn>> columns;
std::vector<std::shared_ptr<Mantid::DataObjects::LeanElasticPeakColumn>> columns;
/** Column names */
std::vector<std::string> columnNames;
......@@ -282,9 +282,9 @@ private:
};
/// Typedef for a shared pointer to a peaks workspace.
using LeanPeaksWorkspace_sptr = std::shared_ptr<LeanPeaksWorkspace>;
using LeanElasticPeaksWorkspace_sptr = std::shared_ptr<LeanElasticPeaksWorkspace>;
/// Typedef for a shared pointer to a const peaks workspace.
using LeanPeaksWorkspace_const_sptr = std::shared_ptr<const LeanPeaksWorkspace>;
using LeanElasticPeaksWorkspace_const_sptr = std::shared_ptr<const LeanElasticPeaksWorkspace>;
} // namespace DataObjects
} // namespace Mantid
......@@ -4,7 +4,7 @@
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidDataObjects/LeanPeakColumn.h"
#include "MantidDataObjects/LeanElasticPeakColumn.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/Exception.h"
#include "MantidKernel/MultiThreaded.h"
......@@ -19,7 +19,7 @@ namespace Mantid {
namespace DataObjects {
namespace {
/// static logger
Kernel::Logger g_log("LeanPeakColumn");
Kernel::Logger g_log("LeanElasticPeakColumn");
/// Number of items to keep around in the cell cache (see void_pointer())
size_t NCELL_ITEM_CACHED = 100;
......@@ -71,10 +71,10 @@ const std::string typeFromName(const std::string &name) {
if (iter != typeIndex.data().end()) {
return iter->second;
} else {
throw std::runtime_error("LeanPeakColumn - Unknown column name: \"" + name +
throw std::runtime_error("LeanElasticPeakColumn - Unknown column name: \"" + name +
"\""
"Peak column names/types must be explicitly "
"marked in LeanPeakColumn.cpp");
"marked in LeanElasticPeakColumn.cpp");
}
}
} // namespace
......@@ -84,24 +84,24 @@ const std::string typeFromName(const std::string &name) {
* @param peaks :: vector of peaks
* @param name :: name for the column
*/
LeanPeakColumn::LeanPeakColumn(std::vector<LeanPeak> &peaks,
LeanElasticPeakColumn::LeanElasticPeakColumn(std::vector<LeanElasticPeak> &peaks,
const std::string &name)
: m_peaks(peaks), m_oldRows() {
this->m_name = name;
this->m_type = typeFromName(name); // Throws if the name is unknown
const std::string key = "LeanPeakColumn.hklPrec";
const std::string key = "LeanElasticPeakColumn.hklPrec";
auto hklPrec = ConfigService::Instance().getValue<int>(key);
this->m_hklPrec = hklPrec.get_value_or(2);
if (!hklPrec.is_initialized()) {
g_log.information()
<< "In LeanPeakColumn constructor, did not find any value for '" << key
<< "In LeanElasticPeakColumn constructor, did not find any value for '" << key
<< "' from the Config Service. Using default: " << this->m_hklPrec
<< "\n";
}
}
/// Returns typeid for the data in the column
const std::type_info &LeanPeakColumn::get_type_info() const {
const std::type_info &LeanElasticPeakColumn::get_type_info() const {
// This is horrible copy-and-paste with the method below. The whole thing
// around columns could be much better implemented using templates & traits to
// avoid this
......@@ -117,12 +117,12 @@ const std::type_info &LeanPeakColumn::get_type_info() const {
return typeid(V3D);
} else {
throw std::runtime_error(
"LeanPeakColumn::get_type_info() - Unknown column type: " + m_name);
"LeanElasticPeakColumn::get_type_info() - Unknown column type: " + m_name);
}
}
/// Returns typeid for the pointer type to the data element in the column
const std::type_info &LeanPeakColumn::get_pointer_type_info() const {
const std::type_info &LeanElasticPeakColumn::get_pointer_type_info() const {
if (type() == "double") {
return typeid(double *);
} else if (type() == "int") {
......@@ -132,7 +132,7 @@ const std::type_info &LeanPeakColumn::get_pointer_type_info() const {
} else if (type() == "V3D") {
return typeid(V3D *);
} else {
throw std::runtime_error("LeanPeakColumn::get_pointer_type_info() -: " +
throw std::runtime_error("LeanElasticPeakColumn::get_pointer_type_info() -: " +
m_name);
}
}
......@@ -143,8 +143,8 @@ const std::type_info &LeanPeakColumn::get_pointer_type_info() const {
* @param s :: stream to output
* @param index :: row index
*/
void LeanPeakColumn::print(size_t index, std::ostream &s) const {
LeanPeak &peak = m_peaks[index];
void LeanElasticPeakColumn::print(size_t index, std::ostream &s) const {
LeanElasticPeak &peak = m_peaks[index];
s.imbue(std::locale("C"));
std::ios::fmtflags fflags(s.flags());
if (m_name == "RunNumber")
......@@ -176,7 +176,7 @@ void LeanPeakColumn::print(size_t index, std::ostream &s) const {
* @param text :: string to read
* @param index :: index of the peak to modify
*/
void LeanPeakColumn::read(size_t index, const std::string &text) {
void LeanElasticPeakColumn::read(size_t index, const std::string &text) {
// Don't modify read-only ones
if (this->getReadOnly() || index >= m_peaks.size())
return;
......@@ -197,7 +197,7 @@ void LeanPeakColumn::read(size_t index, const std::string &text) {
* @param index :: index of the peak to modify
* @param in :: input stream
*/
void LeanPeakColumn::read(const size_t index, std::istringstream &in) {
void LeanElasticPeakColumn::read(const size_t index, std::istringstream &in) {
if (this->getReadOnly() || index >= m_peaks.size())
return;
......@@ -215,19 +215,19 @@ void LeanPeakColumn::read(const size_t index, std::istringstream &in) {
//-------------------------------------------------------------------------------------
/** @return true if the column is read-only */
bool LeanPeakColumn::getReadOnly() const {
bool LeanElasticPeakColumn::getReadOnly() const {
return !((m_name == "h") || (m_name == "k") || (m_name == "l") ||
(m_name == "RunNumber"));
}
//-------------------------------------------------------------------------------------
/// Specialized type check
bool LeanPeakColumn::isBool() const { return false; }
bool LeanElasticPeakColumn::isBool() const { return false; }
bool LeanPeakColumn::isNumber() const { return false; }
bool LeanElasticPeakColumn::isNumber() const { return false; }
/// @returns overall memory size taken by the column.
long int LeanPeakColumn::sizeOfData() const {
long int LeanElasticPeakColumn::sizeOfData() const {
return sizeof(double) * static_cast<long int>(m_peaks.size());
}
......@@ -237,9 +237,9 @@ long int LeanPeakColumn::sizeOfData() const {
* @param count :: Count of new column size (unused)
* @throw Exception::NotImplementedError
*/
void LeanPeakColumn::resize(size_t count) {
void LeanElasticPeakColumn::resize(size_t count) {
UNUSED_ARG(count);
throw Exception::NotImplementedError("LeanPeakColumn::resize - Peaks must be "
throw Exception::NotImplementedError("LeanElasticPeakColumn::resize - Peaks must be "
"added through the PeaksWorkspace "
"interface.");
}
......@@ -250,9 +250,9 @@ void LeanPeakColumn::resize(size_t count) {
* @param index :: The new index position (unused)
* @throw Exception::NotImplementedError
*/
void LeanPeakColumn::insert(size_t index) {
void LeanElasticPeakColumn::insert(size_t index) {
UNUSED_ARG(index);
throw Exception::NotImplementedError("LeanPeakColumn::insert - Peaks must be "
throw Exception::NotImplementedError("LeanElasticPeakColumn::insert - Peaks must be "
"inserted through the PeaksWorkspace "
"interface.");
}
......@@ -263,9 +263,9 @@ void LeanPeakColumn::insert(size_t index) {
* @param index :: The index position removed(unused)
* @throw Exception::NotImplementedError
*/
void LeanPeakColumn::remove(size_t index) {
void LeanElasticPeakColumn::remove(size_t index) {
UNUSED_ARG(index);
throw Exception::NotImplementedError("LeanPeakColumn::remove - Peaks must be "
throw Exception::NotImplementedError("LeanElasticPeakColumn::remove - Peaks must be "
"remove through the PeaksWorkspace "
"interface.");
}
......@@ -275,8 +275,8 @@ void LeanPeakColumn::remove(size_t index) {
* @param index :: A row index pointing to the PeaksWorkspace
* @returns A pointer to the data element at that index from this column
*/
void *LeanPeakColumn::void_pointer(size_t index) {
const auto *constThis = const_cast<const LeanPeakColumn *>(this);
void *LeanElasticPeakColumn::void_pointer(size_t index) {
const auto *constThis = const_cast<const LeanElasticPeakColumn *>(this);
return const_cast<void *>(constThis->void_pointer(index));
}
......@@ -285,8 +285,8 @@ void *LeanPeakColumn::void_pointer(size_t index) {
* @param index :: A row index pointing to the PeaksWorkspace
* @returns A pointer to the data element at that index from this column
*/
const void *LeanPeakColumn::void_pointer(size_t index) const {
const LeanPeak &peak = m_peaks[index];
const void *LeanElasticPeakColumn::void_pointer(size_t index) const {
const LeanElasticPeak &peak = m_peaks[index];
// The cell() api requires that the value exist somewhere in memory, however,
// some of the values from a Peak are calculated on the fly so a reference
......@@ -327,26 +327,26 @@ const void *LeanPeakColumn::void_pointer(size_t index) const {
}
}
LeanPeakColumn *LeanPeakColumn::clone() const {
auto temp = new LeanPeakColumn(this->m_peaks, this->m_name);
LeanElasticPeakColumn *LeanElasticPeakColumn::clone() const {
auto temp = new LeanElasticPeakColumn(this->m_peaks, this->m_name);
return temp;
}
double LeanPeakColumn::toDouble(size_t /*index*/) const {
double LeanElasticPeakColumn::toDouble(size_t /*index*/) const {
throw std::runtime_error(
"LeanPeakColumn::toDouble() not implemented, LeanPeakColumn "
"LeanElasticPeakColumn::toDouble() not implemented, LeanElasticPeakColumn "
"is has no general write access");
}
void LeanPeakColumn::fromDouble(size_t /*index*/, double /*value*/) {
void LeanElasticPeakColumn::fromDouble(size_t /*index*/, double /*value*/) {
throw std::runtime_error(
"fromDouble() not implemented, LeanPeakColumn is has no "
"fromDouble() not implemented, LeanElasticPeakColumn is has no "
"general write access");
}
void LeanPeakColumn::setPeakHKLOrRunNumber(const size_t index,
void LeanElasticPeakColumn::setPeakHKLOrRunNumber(const size_t index,
const double val) {
LeanPeak &peak = m_peaks[index];
LeanElasticPeak &peak = m_peaks[index];
if (m_name == "h")
peak.setH(val);
else if (m_name == "k")
......
......@@ -4,7 +4,7 @@
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidDataObjects/LeanPeaksWorkspace.h"
#include "MantidDataObjects/LeanElasticPeaksWorkspace.h"
#include "MantidAPI/Run.h"
#include "MantidAPI/Sample.h"
#include "MantidAPI/WorkspaceFactory.h"
......@@ -28,33 +28,33 @@ using namespace Mantid::Geometry;
namespace Mantid {
namespace DataObjects {
/// Register the workspace as a type
DECLARE_WORKSPACE(LeanPeaksWorkspace)
DECLARE_WORKSPACE(LeanElasticPeaksWorkspace)
//---------------------------------------------------------------------------------------------
/** Constructor. Create a table with all the required columns.
*
* @return LeanPeaksWorkspace object
* @return LeanElasticPeaksWorkspace object
*/
LeanPeaksWorkspace::LeanPeaksWorkspace()
LeanElasticPeaksWorkspace::LeanElasticPeaksWorkspace()
: IPeaksWorkspace(), peaks(), columns(), columnNames(),
m_coordSystem(None) {
initColumns();
// LeanPeaksWorkspace does not use the grouping mechanism of ExperimentInfo.
// LeanElasticPeaksWorkspace does not use the grouping mechanism of ExperimentInfo.
setNumberOfDetectorGroups(0);
}
//---------------------------------------------------------------------------------------------
/** Copy constructor
*
* @param other :: other LeanPeaksWorkspace to copy from
* @param other :: other LeanElasticPeaksWorkspace to copy from
*/
// LeanPeaksWorkspace::LeanPeaksWorkspace(const LeanPeaksWorkspace &other) =
// LeanElasticPeaksWorkspace::LeanElasticPeaksWorkspace(const LeanElasticPeaksWorkspace &other) =
// default;
LeanPeaksWorkspace::LeanPeaksWorkspace(const LeanPeaksWorkspace &other)
LeanElasticPeaksWorkspace::LeanElasticPeaksWorkspace(const LeanElasticPeaksWorkspace &other)
: IPeaksWorkspace(other), peaks(other.peaks), columns(), columnNames(),
m_coordSystem(other.m_coordSystem) {
initColumns();
// LeanPeaksWorkspace does not use the grouping mechanism of ExperimentInfo.
// LeanElasticPeaksWorkspace does not use the grouping mechanism of ExperimentInfo.
setNumberOfDetectorGroups(0);
}
......@@ -62,7 +62,7 @@ LeanPeaksWorkspace::LeanPeaksWorkspace(const LeanPeaksWorkspace &other)
*/
class PeakComparator {
public:
using ColumnAndDirection = LeanPeaksWorkspace::ColumnAndDirection;
using ColumnAndDirection = LeanElasticPeaksWorkspace::ColumnAndDirection;
std::vector<ColumnAndDirection> &criteria;
/** Constructor for the comparator for sorting peaks
......@@ -73,7 +73,7 @@ public:
: criteria(criteria) {}
/** Compare two peaks using the stored criteria */
inline bool operator()(const LeanPeak &a, const LeanPeak &b) {
inline bool operator()(const LeanElasticPeak &a, const LeanElasticPeak &b) {
for (const auto &name : criteria) {
const auto &col = name.first;
const bool ascending = name.second;
......@@ -114,7 +114,7 @@ public:
* The peaks are sorted by the first criterion first, then the 2nd if
*equal, etc.
*/
void LeanPeaksWorkspace::sort(std::vector<ColumnAndDirection> &criteria) {
void LeanElasticPeaksWorkspace::sort(std::vector<ColumnAndDirection> &criteria) {
PeakComparator comparator(criteria);