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 "MantidKernel/Unit.h"
16#include <string>
17#include <vector>
18
19namespace Mantid {
20namespace API {
21//----------------------------------------------------------------------
22// Forward declaration
23//----------------------------------------------------------------------
24class MatrixWorkspace;
25
31class MANTID_API_DLL SpectraAxis : public Axis {
32public:
33 explicit SpectraAxis(const MatrixWorkspace *const parentWorkspace);
34 Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
35 Axis *clone(const std::size_t length, const MatrixWorkspace *const parentWorkspace) override;
36 std::size_t length() const override;
38 bool isSpectra() const override { return true; }
39 double operator()(const std::size_t &index, const std::size_t &verticalIndex = 0) const override;
40 void setValue(const std::size_t &index, const double &value) override;
41 size_t indexOfValue(const double value) const override;
42 bool operator==(const Axis &) const override;
43 std::string label(const std::size_t &index) const override;
44
45 specnum_t spectraNo(const std::size_t &index) const override;
46 // Get a map that contains the spectra index as the key and the index in the
47 // array as the value
48 spec2index_map getSpectraIndexMap() const;
49
50 double getMin() const override;
51 double getMax() const override;
52
53private:
64 mutable std::vector<double> m_edges;
65};
66
67} // namespace API
68} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Class to represent the axis of a workspace.
Definition: Axis.h:30
Base MatrixWorkspace Abstract Class.
Class to represent the spectra axis of a workspace.
Definition: SpectraAxis.h:31
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:64
bool isSpectra() const override
If this is a spectra Axis - always true for this class.
Definition: SpectraAxis.h:38
const MatrixWorkspace *const m_parentWS
A pointer to the workspace holding the axis.
Definition: SpectraAxis.h:61
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:16
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)