Mantid
Loading...
Searching...
No Matches
IMDHistoWorkspace.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
12#include "MantidKernel/System.h"
13
14namespace Mantid {
15namespace API {
16
22class MANTID_API_DLL IMDHistoWorkspace : public IMDWorkspace, public MultipleExperimentInfos {
23public:
24 IMDHistoWorkspace() = default;
29 IMDHistoWorkspace_uptr cloneEmpty() const { return IMDHistoWorkspace_uptr(doCloneEmpty()); }
31 virtual coord_t getInverseVolume() const = 0;
32 virtual const signal_t *getSignalArray() const = 0;
33 virtual const signal_t *getErrorSquaredArray() const = 0;
34 virtual const signal_t *getNumEventsArray() const = 0;
35
39
40 virtual void setTo(signal_t signal, signal_t errorSquared, signal_t numEvents) = 0;
41 virtual Mantid::Kernel::VMD getCenter(size_t linearIndex) const = 0;
42 virtual void setSignalAt(size_t index, signal_t value) = 0;
43 virtual void setErrorSquaredAt(size_t index, signal_t value) = 0;
44 virtual signal_t getErrorAt(size_t index) const = 0;
45 virtual signal_t getErrorAt(size_t index1, size_t index2) const = 0;
46 virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3) const = 0;
47 virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3, size_t index4) const = 0;
48 virtual signal_t getSignalAt(size_t index) const = 0;
49 virtual signal_t getSignalAt(size_t index1, size_t index2) const = 0;
50 virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3) const = 0;
51 virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const = 0;
52 virtual signal_t getSignalNormalizedAt(size_t index) const = 0;
53 virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2) const = 0;
54 virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const = 0;
55 virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const = 0;
56 virtual signal_t getErrorNormalizedAt(size_t index) const = 0;
57 virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2) const = 0;
58 virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3) const = 0;
59 virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const = 0;
60
61 virtual signal_t &errorSquaredAt(size_t index) = 0;
62 virtual signal_t &signalAt(size_t index) = 0;
63 virtual size_t getLinearIndex(size_t index1, size_t index2) const = 0;
64 virtual size_t getLinearIndex(size_t index1, size_t index2, size_t index3) const = 0;
65 virtual size_t getLinearIndex(size_t index1, size_t index2, size_t index3, size_t index4) const = 0;
66
68 Mantid::API::MDNormalization normalize) const = 0;
69
70 virtual double &operator[](const size_t &index) = 0;
71
72 virtual void setCoordinateSystem(const Kernel::SpecialCoordinateSystem coordinateSystem) = 0;
73
74 virtual void setDisplayNormalization(const Mantid::API::MDNormalization &preferredNormalization) = 0;
75
76 // Check if this class has an oriented lattice on any sample object
77 virtual bool hasOrientedLattice() const override { return MultipleExperimentInfos::hasOrientedLattice(); }
78
79protected:
82
83 const std::string toString() const override;
84
85private:
86 IMDHistoWorkspace *doClone() const override = 0;
87 IMDHistoWorkspace *doCloneEmpty() const override = 0;
88};
89
90} // namespace API
91} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Abstract interface to MDHistoWorkspace, for use in exposing to Python.
virtual signal_t & errorSquaredAt(size_t index)=0
virtual Mantid::Kernel::VMD getCenter(size_t linearIndex) const =0
virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2) const =0
virtual signal_t getSignalAt(size_t index) const =0
virtual const signal_t * getErrorSquaredArray() const =0
virtual signal_t getErrorNormalizedAt(size_t index) const =0
virtual const signal_t * getNumEventsArray() const =0
virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const =0
IMDHistoWorkspace(const IMDHistoWorkspace &)=default
Protected copy constructor. May be used by childs for cloning.
IMDHistoWorkspace_uptr cloneEmpty() const
Returns a default-initialized clone of the workspace.
IMDHistoWorkspace * doClone() const override=0
Virtual clone method. Not implemented to force implementation in children.
virtual signal_t & signalAt(size_t index)=0
virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3) const =0
virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3) const =0
virtual signal_t getSignalAt(size_t index1, size_t index2) const =0
virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const =0
virtual signal_t * mutableNumEventsArray()=0
virtual signal_t getSignalNormalizedAt(size_t index) const =0
virtual void setErrorSquaredAt(size_t index, signal_t value)=0
virtual double & operator[](const size_t &index)=0
virtual void setCoordinateSystem(const Kernel::SpecialCoordinateSystem coordinateSystem)=0
virtual const signal_t * getSignalArray() const =0
virtual LinePlot getLineData(const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const =0
virtual signal_t * mutableSignalArray()=0
virtual void setDisplayNormalization(const Mantid::API::MDNormalization &preferredNormalization)=0
virtual signal_t getErrorAt(size_t index1, size_t index2) const =0
virtual void setSignalAt(size_t index, signal_t value)=0
virtual coord_t getInverseVolume() const =0
See the MDHistoWorkspace definition for descriptions of these.
virtual signal_t * mutableErrorSquaredArray()=0
virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2) const =0
virtual size_t getLinearIndex(size_t index1, size_t index2) const =0
virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3) const =0
virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3, size_t index4) const =0
virtual void setTo(signal_t signal, signal_t errorSquared, signal_t numEvents)=0
virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const =0
virtual signal_t getErrorAt(size_t index) const =0
IMDHistoWorkspace & operator=(const IMDHistoWorkspace &)=delete
IMDHistoWorkspace_uptr clone() const
Returns a clone of the workspace.
virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const =0
virtual size_t getLinearIndex(size_t index1, size_t index2, size_t index3) const =0
virtual size_t getLinearIndex(size_t index1, size_t index2, size_t index3, size_t index4) const =0
virtual bool hasOrientedLattice() const override
IMDHistoWorkspace * doCloneEmpty() const override=0
Virtual cloneEmpty method.
Basic MD Workspace Abstract Class.
Definition: IMDWorkspace.h:40
Small class that allows a MDEventWorkspace or a MDHistoWorkspace to hold several ExperimentInfo class...
MDNormalization
Enum describing different ways to normalize the signal in a MDWorkspace.
Definition: IMDIterator.h:25
std::unique_ptr< IMDHistoWorkspace > IMDHistoWorkspace_uptr
unique pointer to Mantid::API::IMDHistoWorkspace
SpecialCoordinateSystem
Special coordinate systems for Q3D.
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
Definition: MDTypes.h:27
double signal_t
Typedef for the signal recorded in a MDBox, etc.
Definition: MDTypes.h:36
Holds X, Y, E for a line plot.
Definition: IMDWorkspace.h:48