Mantid
Loading...
Searching...
No Matches
SpectraAxis.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 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//----------------------------------------------------------------------
12#include "MantidAPI/Axis.h"
13#include "MantidAPI/DllConfig.h"
15#include <string>
16#include <vector>
17
18namespace Mantid {
19namespace API {
20//----------------------------------------------------------------------
21// Forward declaration
22//----------------------------------------------------------------------
23class MatrixWorkspace;
24
30class MANTID_API_DLL SpectraAxis : public Axis {
31public:
32 explicit SpectraAxis(const MatrixWorkspace *const parentWorkspace);
33 Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
34 Axis *clone(const std::size_t length, const MatrixWorkspace *const parentWorkspace) override;
35 std::size_t length() const override;
37 bool isSpectra() const override { return true; }
38 double operator()(const std::size_t &index, const std::size_t &verticalIndex = 0) const override;
39 void setValue(const std::size_t &index, const double &value) override;
40 size_t indexOfValue(const double value) const override;
41 bool operator==(const Axis &) const override;
42 std::string label(const std::size_t &index) const override;
43
44 specnum_t spectraNo(const std::size_t &index) const override;
45 // Get a map that contains the spectra index as the key and the index in the
46 // array as the value
47 spec2index_map getSpectraIndexMap() const;
48
49 double getMin() const override;
50 double getMax() const override;
51
52private:
63 mutable std::vector<double> m_edges;
64};
65
66} // namespace API
67} // namespace Mantid
double value
The value of the point.
Definition FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Class to represent the axis of a workspace.
Definition Axis.h:28
Base MatrixWorkspace Abstract Class.
Class to represent the spectra axis of a workspace.
Definition SpectraAxis.h:30
const SpectraAxis & operator=(const SpectraAxis &)
Private, undefined copy assignment operator.
SpectraAxis(const SpectraAxis &)
Private, undefined copy constructor.
std::vector< double > m_edges
List of edge values for quick searching of values as if this is binned data.
Definition SpectraAxis.h:63
bool isSpectra() const override
If this is a spectra Axis - always true for this class.
Definition SpectraAxis.h:37
const MatrixWorkspace *const m_parentWS
A pointer to the workspace holding the axis.
Definition SpectraAxis.h:60
SpectraAxis()
Default constructor.
Helper class which provides the Collimation Length for SANS instruments.
std::unordered_map< specnum_t, size_t > spec2index_map
Map with key = spectrum number, value = workspace index.
int32_t specnum_t
Typedef for a spectrum Number.
Definition IDTypes.h:14
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)