Mantid
Loading...
Searching...
No Matches
IPeaksWorkspace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
17#include <boost/optional.hpp>
18
19namespace Mantid {
20namespace Geometry {
21class IPeak;
22}
23namespace API {
24
25//==========================================================================================
33class MANTID_API_DLL IPeaksWorkspace : public ITableWorkspace, public Mantid::API::ExperimentInfo {
34public:
37 : ITableWorkspace(), ExperimentInfo(), m_convention(Kernel::ConfigService::Instance().getString("Q.convention")) {
38 }
39
41 IPeaksWorkspace_uptr clone() const { return IPeaksWorkspace_uptr(doClone()); }
42 IPeaksWorkspace &operator=(const IPeaksWorkspace &other) = delete;
43 //---------------------------------------------------------------------------------------------
46 virtual int getNumberPeaks() const = 0;
47
48 //---------------------------------------------------------------------------------------------
51 virtual std::string getConvention() const = 0;
52
53 //---------------------------------------------------------------------------------------------
57 virtual void removePeak(int peakNum) = 0;
58
59 virtual void removePeaks(std::vector<int> badPeaks) = 0;
60
61 //---------------------------------------------------------------------------------------------
65 virtual void addPeak(const Mantid::Geometry::IPeak &ipeak) = 0;
66
67 //---------------------------------------------------------------------------------------------
72 virtual void addPeak(const Kernel::V3D &position, const Kernel::SpecialCoordinateSystem &frame) = 0;
73
74 //---------------------------------------------------------------------------------------------
79 virtual Mantid::Geometry::IPeak &getPeak(int peakNum) = 0;
80
81 //---------------------------------------------------------------------------------------------
86 virtual const Mantid::Geometry::IPeak &getPeak(int peakNum) const = 0;
87
88 //---------------------------------------------------------------------------------------------
93 Mantid::Geometry::IPeak *getPeakPtr(const int peakNum) { return &this->getPeak(peakNum); }
94
95 //---------------------------------------------------------------------------------------------
103 virtual std::unique_ptr<Geometry::IPeak> createPeak(const Mantid::Kernel::V3D &QLabFrame,
104 boost::optional<double> detectorDistance = boost::none) const = 0;
105
106 //---------------------------------------------------------------------------------------------
112 virtual std::unique_ptr<Mantid::Geometry::IPeak>
114
115 //---------------------------------------------------------------------------------------------
120 virtual std::unique_ptr<Mantid::Geometry::IPeak> createPeakQSample(const Mantid::Kernel::V3D &position) const = 0;
121
127 virtual std::unique_ptr<Geometry::IPeak> createPeakHKL(const Mantid::Kernel::V3D &HKL) const = 0;
128
133 virtual std::unique_ptr<Geometry::IPeak> createPeak() const = 0;
134
135 //---------------------------------------------------------------------------------------------
140 virtual bool hasIntegratedPeaks() const = 0;
141
142 //---------------------------------------------------------------------------------------------
150
151 //---------------------------------------------------------------------------------------------
156 virtual void setCoordinateSystem(const Kernel::SpecialCoordinateSystem coordinateSystem) = 0;
157 //---------------------------------------------------------------------------------------------
164
165 virtual std::vector<std::pair<std::string, std::string>> peakInfo(const Kernel::V3D &QFrame,
166 bool labCoords) const = 0;
167 virtual int peakInfoNumber(const Kernel::V3D &qLabFrame, bool labCoords) const = 0;
168
169 //---------------------------------------------------------------------------------------------
170 virtual void saveNexus(::NeXus::File *file) const = 0;
171
172 std::string m_convention;
173
174protected:
177
178 const std::string toString() const override;
179
180private:
181 IPeaksWorkspace *doClone() const override = 0;
182};
183} // namespace API
184} // namespace Mantid
double position
Definition: GetAllEi.cpp:154
This class is shared by a few Workspace types and holds information related to a particular experimen...
Interface to the class Mantid::DataObjects::PeaksWorkspace.
Mantid::Geometry::IPeak * getPeakPtr(const int peakNum)
Return a pointer to the Peak.
virtual void addPeak(const Kernel::V3D &position, const Kernel::SpecialCoordinateSystem &frame)=0
Add a peak to the list.
virtual Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem() const =0
Get the special coordinate system.
virtual Mantid::Geometry::IPeak & getPeak(int peakNum)=0
Return a reference to the Peak.
virtual bool hasIntegratedPeaks() const =0
Determine if the workspace has been integrated using a peaks integration algorithm.
virtual API::ITableWorkspace_sptr createDetectorTable() const =0
Creates a new TableWorkspace giving the IDs of the detectors that contribute to the peak.
virtual void removePeak(int peakNum)=0
Removes the indicated peak.
virtual void removePeaks(std::vector< int > badPeaks)=0
virtual void addPeak(const Mantid::Geometry::IPeak &ipeak)=0
Add a peak to the list.
virtual int peakInfoNumber(const Kernel::V3D &qLabFrame, bool labCoords) const =0
virtual std::unique_ptr< Geometry::IPeak > createPeak() const =0
Create an instance of a peak using default constructor.
virtual const Mantid::Geometry::IPeak & getPeak(int peakNum) const =0
Return a reference to the Peak (const version)
virtual std::vector< std::pair< std::string, std::string > > peakInfo(const Kernel::V3D &QFrame, bool labCoords) const =0
virtual std::string getConvention() const =0
virtual std::unique_ptr< Geometry::IPeak > createPeak(const Mantid::Kernel::V3D &QLabFrame, boost::optional< double > detectorDistance=boost::none) const =0
Create an instance of a Peak.
IPeaksWorkspace(const IPeaksWorkspace &)=default
Protected copy constructor. May be used by childs for cloning.
virtual std::unique_ptr< Mantid::Geometry::IPeak > createPeak(const Mantid::Kernel::V3D &position, const Mantid::Kernel::SpecialCoordinateSystem &frame) const =0
Create an instance of a Peak.
IPeaksWorkspace & operator=(const IPeaksWorkspace &other)=delete
virtual void setCoordinateSystem(const Kernel::SpecialCoordinateSystem coordinateSystem)=0
Set the special coordinate system.
virtual void saveNexus(::NeXus::File *file) const =0
virtual std::unique_ptr< Geometry::IPeak > createPeakHKL(const Mantid::Kernel::V3D &HKL) const =0
Create an instance of a peak using a V3D.
IPeaksWorkspace * doClone() const override=0
Virtual clone method. Not implemented to force implementation in children.
virtual int getNumberPeaks() const =0
virtual std::unique_ptr< Mantid::Geometry::IPeak > createPeakQSample(const Mantid::Kernel::V3D &position) const =0
Create an instance of a Peak.
IPeaksWorkspace_uptr clone() const
Returns a clone of the workspace.
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
HKL : HKL MDFrame.
Definition: HKL.h:21
Structure describing a single-crystal peak.
Definition: IPeak.h:26
Manage the lifetime of a class intended to be a singleton.
Class for 3D vectors.
Definition: V3D.h:34
std::unique_ptr< IPeaksWorkspace > IPeaksWorkspace_uptr
unique pointer to Mantid::API::IPeaksWorkspace
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
SpecialCoordinateSystem
Special coordinate systems for Q3D.
Helper class which provides the Collimation Length for SANS instruments.