Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
SpectrumTester Class Reference

Helper class that implements ISpectrum. More...

#include <FakeObjects.h>

Inheritance diagram for SpectrumTester:
Mantid::API::ISpectrum

Public Member Functions

void clearData () override
 Mask the spectrum to this value. More...
 
void copyDataFrom (const ISpectrum &other) override
 Copy data from another ISpectrum with double-dynamic dispatch. More...
 
const MantidVec & dataDx () const override
 
MantidVec & dataDx () override
 
const MantidVec & dataE () const override
 
MantidVec & dataE () override
 
const MantidVec & dataX () const override
 
MantidVec & dataX () override
 
const MantidVec & dataY () const override
 
MantidVec & dataY () override
 
size_t getMemorySize () const override
 
Mantid::Kernel::cow_ptr< Mantid::HistogramData::HistogramX > ptrX () const override
 
const MantidVec & readDx () const override
 
const MantidVec & readX () const override
 
void setX (const Mantid::Kernel::cow_ptr< Mantid::HistogramData::HistogramX > &X) override
 
 SpectrumTester (const specnum_t specNo, Mantid::HistogramData::Histogram::XMode xmode, Mantid::HistogramData::Histogram::YMode ymode)
 
 SpectrumTester (Mantid::HistogramData::Histogram::XMode xmode, Mantid::HistogramData::Histogram::YMode ymode)
 
- Public Member Functions inherited from Mantid::API::ISpectrum
void addDetectorID (const detid_t detID)
 Add a detector ID to the set of detector IDs. More...
 
void addDetectorIDs (const std::set< detid_t > &detIDs)
 Add a set of detector IDs to the set of detector IDs. More...
 
void addDetectorIDs (const std::vector< detid_t > &detIDs)
 Add a vector of detector IDs to the set of detector IDs. More...
 
HistogramData::BinEdges binEdges () const
 
virtual void clearData ()=0
 
void clearDetectorIDs ()
 Clear the detector IDs set. More...
 
void convertToCounts ()
 
void convertToFrequencies ()
 
virtual void copyDataFrom (const ISpectrum &source)=0
 Copy data from another ISpectrum with double-dynamic dispatch. More...
 
virtual void copyDataInto (DataObjects::EventList &) const
 Override in child classes for polymorphic copying of data. More...
 
virtual void copyDataInto (DataObjects::Histogram1D &) const
 Override in child classes for polymorphic copying of data. More...
 
virtual void copyDataInto (SpectrumTester &) const
 Override in child classes for polymorphic copying of data. More...
 
void copyInfoFrom (const ISpectrum &other)
 Copy spectrum number and detector IDs, but not X vector, from another ISpectrum. More...
 
virtual HistogramData::Counts counts () const
 
virtual HistogramData::CountStandardDeviations countStandardDeviations () const
 
virtual HistogramData::CountVariances countVariances () const
 
virtual const MantidVecdataDx () const =0
 
virtual MantidVecdataDx ()=0
 
virtual const MantidVecdataE () const =0
 
virtual MantidVecdataE ()=0
 
virtual const MantidVecdataX () const =0
 
virtual MantidVecdataX ()=0
 
virtual const MantidVecdataY () const =0
 
virtual MantidVecdataY ()=0
 
const HistogramData::HistogramDx & dx () const
 
virtual const HistogramData::HistogramE & e () const
 
virtual HistogramData::Frequencies frequencies () const
 
virtual HistogramData::FrequencyStandardDeviations frequencyStandardDeviations () const
 
virtual HistogramData::FrequencyVariances frequencyVariances () const
 
const std::set< detid_t > & getDetectorIDs () const
 Get a const reference to the detector IDs set. More...
 
virtual size_t getMemorySize () const =0
 
specnum_t getSpectrumNo () const
 
virtual std::pair< double, double > getXDataRange () const
 Return the min/max X values for this spectrum. More...
 
bool hasDetectorID (const detid_t detID) const
 Return true if the given detector ID is in the list for this ISpectrum. More...
 
bool hasDx () const
 Gets the value of the use flag. More...
 
virtual HistogramData::Histogram histogram () const
 Returns the Histogram associated with this spectrum. More...
 
 ISpectrum ()=default
 
 ISpectrum (const specnum_t specNo)
 Constructor with spectrum number. More...
 
HistogramData::HistogramDx & mutableDx () &
 
HistogramData::HistogramE & mutableE () &
 
HistogramData::HistogramX & mutableX () &
 
HistogramData::HistogramY & mutableY () &
 
HistogramData::Points points () const
 
HistogramData::PointStandardDeviations pointStandardDeviations () const
 
virtual Kernel::cow_ptr< HistogramData::HistogramX > ptrX () const =0
 
virtual const MantidVecreadDx () const =0
 
virtual const MantidVecreadE () const
 Deprecated, use e() instead. Returns the y error data const. More...
 
virtual const MantidVecreadX () const =0
 
virtual const MantidVecreadY () const
 Deprecated, use y() instead. Returns the y data const. More...
 
void resetHasDx ()
 Resets the hasDx flag. More...
 
template<typename... T>
void setBinEdges (T &&...data) &
 
template<typename... T>
void setCounts (T &&...data) &
 
template<typename... T>
void setCountStandardDeviations (T &&...data) &
 
template<typename... T>
void setCountVariances (T &&...data) &
 
void setDetectorID (const detid_t detID)
 Clear the list of detector IDs, then add one. More...
 
void setDetectorIDs (const std::set< detid_t > &detIDs)
 Set the detector IDs to be the set given. More...
 
void setDetectorIDs (std::set< detid_t > &&detIDs)
 Set the detector IDs to be the set given (move version). More...
 
template<typename... T>
void setFrequencies (T &&...data) &
 
template<typename... T>
void setFrequencyStandardDeviations (T &&...data) &
 
template<typename... T>
void setFrequencyVariances (T &&...data) &
 
template<typename... T>
void setHistogram (T &&...data)
 Sets the Histogram associated with this spectrum. More...
 
void setMatrixWorkspace (MatrixWorkspace *matrixWorkspace, const size_t index)
 Sets the MatrixWorkspace pointer (pointer to the owning workspace). More...
 
template<typename... T>
void setPoints (T &&...data) &
 
template<typename... T>
void setPointStandardDeviations (T &&...data) &
 
template<typename... T>
void setPointVariances (T &&...data) &
 
void setSharedDx (const Kernel::cow_ptr< HistogramData::HistogramDx > &dx) &
 
void setSharedE (const Kernel::cow_ptr< HistogramData::HistogramE > &e) &
 
void setSharedX (const Kernel::cow_ptr< HistogramData::HistogramX > &x) &
 
void setSharedY (const Kernel::cow_ptr< HistogramData::HistogramY > &y) &
 
void setSpectrumNo (specnum_t num)
 Sets the the spectrum number of this spectrum. More...
 
virtual void setX (const Kernel::cow_ptr< HistogramData::HistogramX > &X)=0
 
void setYMode (HistogramData::Histogram::YMode ymode)
 
Kernel::cow_ptr< HistogramData::HistogramDx > sharedDx () const
 
virtual Kernel::cow_ptr< HistogramData::HistogramE > sharedE () const
 
Kernel::cow_ptr< HistogramData::HistogramX > sharedX () const
 
virtual Kernel::cow_ptr< HistogramData::HistogramY > sharedY () const
 
const HistogramData::HistogramX & x () const
 
virtual const HistogramData::HistogramY & y () const
 
HistogramData::Histogram::YMode yMode () const
 
virtual ~ISpectrum ()=default
 

Protected Attributes

Mantid::HistogramData::Histogram m_histogram
 

Private Member Functions

void copyDataInto (SpectrumTester &other) const override
 Override in child classes for polymorphic copying of data. More...
 
const Mantid::HistogramData::Histogram & histogramRef () const override
 
Mantid::HistogramData::Histogram & mutableHistogramRef () override
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::API::ISpectrum
virtual void checkAndSanitizeHistogram (HistogramData::Histogram &)
 
virtual void checkIsYAndEWritable () const
 
virtual void checkWorksWithPoints () const
 
 ISpectrum (const ISpectrum &other)
 Copy constructor. More...
 
 ISpectrum (ISpectrum &&other)
 Move constructor. More...
 
ISpectrumoperator= (const ISpectrum &other)
 Copy assignment. More...
 
ISpectrumoperator= (ISpectrum &&other)
 Move assignment. More...
 

Detailed Description

Helper class that implements ISpectrum.

Definition at line 55 of file FakeObjects.h.

Constructor & Destructor Documentation

◆ SpectrumTester() [1/2]

SpectrumTester::SpectrumTester ( Mantid::HistogramData::Histogram::XMode  xmode,
Mantid::HistogramData::Histogram::YMode  ymode 
)
inline

Definition at line 57 of file FakeObjects.h.

References m_histogram.

◆ SpectrumTester() [2/2]

SpectrumTester::SpectrumTester ( const specnum_t  specNo,
Mantid::HistogramData::Histogram::XMode  xmode,
Mantid::HistogramData::Histogram::YMode  ymode 
)
inline

Definition at line 62 of file FakeObjects.h.

References m_histogram.

Member Function Documentation

◆ clearData()

void SpectrumTester::clearData ( )
inlineoverridevirtual

Mask the spectrum to this value.

Implements Mantid::API::ISpectrum.

Definition at line 90 of file FakeObjects.h.

References dataE(), and dataY().

◆ copyDataFrom()

void SpectrumTester::copyDataFrom ( const ISpectrum source)
inlineoverridevirtual

Copy data from another ISpectrum with double-dynamic dispatch.

Implements Mantid::API::ISpectrum.

Definition at line 69 of file FakeObjects.h.

◆ copyDataInto()

void SpectrumTester::copyDataInto ( SpectrumTester ) const
inlineoverrideprivatevirtual

Override in child classes for polymorphic copying of data.

Reimplemented from Mantid::API::ISpectrum.

Definition at line 103 of file FakeObjects.h.

References m_histogram.

◆ dataDx() [1/2]

const MantidVec & SpectrumTester::dataDx ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 78 of file FakeObjects.h.

References m_histogram.

◆ dataDx() [2/2]

MantidVec & SpectrumTester::dataDx ( )
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 77 of file FakeObjects.h.

References m_histogram.

◆ dataE() [1/2]

const MantidVec & SpectrumTester::dataE ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 85 of file FakeObjects.h.

References m_histogram.

◆ dataE() [2/2]

MantidVec & SpectrumTester::dataE ( )
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 82 of file FakeObjects.h.

References m_histogram.

Referenced by clearData().

◆ dataX() [1/2]

const MantidVec & SpectrumTester::dataX ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 73 of file FakeObjects.h.

References m_histogram.

◆ dataX() [2/2]

MantidVec & SpectrumTester::dataX ( )
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 72 of file FakeObjects.h.

References m_histogram.

◆ dataY() [1/2]

const MantidVec & SpectrumTester::dataY ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 84 of file FakeObjects.h.

References m_histogram.

◆ dataY() [2/2]

MantidVec & SpectrumTester::dataY ( )
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 81 of file FakeObjects.h.

References m_histogram.

Referenced by clearData().

◆ getMemorySize()

size_t SpectrumTester::getMemorySize ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 87 of file FakeObjects.h.

References Mantid::API::ISpectrum::readY().

◆ histogramRef()

const Mantid::HistogramData::Histogram & SpectrumTester::histogramRef ( ) const
inlineoverrideprivatevirtual

Implements Mantid::API::ISpectrum.

Definition at line 105 of file FakeObjects.h.

References m_histogram.

◆ mutableHistogramRef()

Mantid::HistogramData::Histogram & SpectrumTester::mutableHistogramRef ( )
inlineoverrideprivatevirtual

Implements Mantid::API::ISpectrum.

Definition at line 106 of file FakeObjects.h.

References m_histogram.

◆ ptrX()

Mantid::Kernel::cow_ptr< Mantid::HistogramData::HistogramX > SpectrumTester::ptrX ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 75 of file FakeObjects.h.

References m_histogram.

◆ readDx()

const MantidVec & SpectrumTester::readDx ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 79 of file FakeObjects.h.

References m_histogram.

◆ readX()

const MantidVec & SpectrumTester::readX ( ) const
inlineoverridevirtual

Implements Mantid::API::ISpectrum.

Definition at line 74 of file FakeObjects.h.

References m_histogram.

◆ setX()

void SpectrumTester::setX ( const Mantid::Kernel::cow_ptr< Mantid::HistogramData::HistogramX > &  X)
inlineoverride

Definition at line 71 of file FakeObjects.h.

References m_histogram, and Mantid::Geometry::X.

Member Data Documentation

◆ m_histogram

Mantid::HistogramData::Histogram SpectrumTester::m_histogram
protected

The documentation for this class was generated from the following file: