Mantid
|
1D histogram implementation. More...
#include <Histogram1D.h>
Public Member Functions | |
void | clearData () override |
Zero the data (Y&E) in this spectrum. More... | |
void | copyDataFrom (const ISpectrum &source) override |
Copy data from a Histogram1D or EventList, via ISpectrum reference. More... | |
const MantidVec & | dataDx () const override |
Deprecated, use dx() instead. More... | |
MantidVec & | dataDx () override |
Deprecated, use mutableDx() instead. More... | |
const MantidVec & | dataE () const override |
Deprecated, use e() instead. Returns the error data const. More... | |
MantidVec & | dataE () override |
Deprecated, use mutableE() instead. Returns the error data. More... | |
const MantidVec & | dataX () const override |
Deprecated, use x() instead. Returns the x data const. More... | |
MantidVec & | dataX () override |
Deprecated, use mutableX() instead. Returns the x data. More... | |
const MantidVec & | dataY () const override |
Deprecated, use y() instead. Returns the y data const. More... | |
MantidVec & | dataY () override |
Deprecated, use mutableY() instead. Returns the y data. More... | |
size_t | getMemorySize () const override |
Gets the memory size of the histogram. More... | |
Histogram1D (const Histogram1D &)=default | |
Histogram1D (const ISpectrum &other) | |
Construct from ISpectrum. More... | |
Histogram1D (Histogram1D &&)=default | |
Histogram1D (HistogramData::Histogram::XMode xmode, HistogramData::Histogram::YMode ymode) | |
Construct empty. More... | |
bool | isError () const |
Checks for errors. More... | |
Histogram1D & | operator= (const Histogram1D &)=default |
Histogram1D & | operator= (const ISpectrum &rhs) |
Assignment from ISpectrum. More... | |
Histogram1D & | operator= (Histogram1D &&)=default |
Kernel::cow_ptr< HistogramData::HistogramX > | ptrX () const override |
Deprecated, use sharedX() instead. Returns a pointer to the x data. More... | |
const MantidVec & | readDx () const override |
Deprecated, use dx() instead. More... | |
const MantidVec & | readX () const override |
Deprecated, use x() instead. Returns the x data const. More... | |
void | setX (const Kernel::cow_ptr< HistogramData::HistogramX > &X) override |
Deprecated, use setSharedX() instead. More... | |
virtual std::size_t | size () const |
get pseudo size More... | |
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 MantidVec & | dataDx () const =0 |
virtual MantidVec & | dataDx ()=0 |
virtual const MantidVec & | dataE () const =0 |
virtual MantidVec & | dataE ()=0 |
virtual const MantidVec & | dataX () const =0 |
virtual MantidVec & | dataX ()=0 |
virtual const MantidVec & | dataY () const =0 |
virtual MantidVec & | dataY ()=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 MantidVec & | readDx () const =0 |
virtual const MantidVec & | readE () const |
Deprecated, use e() instead. Returns the y error data const. More... | |
virtual const MantidVec & | readX () const =0 |
virtual const MantidVec & | readY () 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 |
Private Member Functions | |
void | checkAndSanitizeHistogram (HistogramData::Histogram &histogram) override |
Makes sure a histogram has valid Y and E data. 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... | |
void | copyDataInto (Histogram1D &sink) const override |
Used by copyDataFrom for dynamic dispatch for its source . More... | |
virtual void | copyDataInto (SpectrumTester &) const |
Override in child classes for polymorphic copying of data. More... | |
const HistogramData::Histogram & | histogramRef () const override |
HistogramData::Histogram & | mutableHistogramRef () override |
Private Attributes | |
HistogramData::Histogram | m_histogram |
Histogram object holding the histogram data. More... | |
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... | |
ISpectrum & | operator= (const ISpectrum &other) |
Copy assignment. More... | |
ISpectrum & | operator= (ISpectrum &&other) |
Move assignment. More... | |
1D histogram implementation.
Definition at line 18 of file Histogram1D.h.
Mantid::DataObjects::Histogram1D::Histogram1D | ( | HistogramData::Histogram::XMode | xmode, |
HistogramData::Histogram::YMode | ymode | ||
) |
|
default |
|
default |
Mantid::DataObjects::Histogram1D::Histogram1D | ( | const ISpectrum & | other | ) |
Construct from ISpectrum.
Definition at line 27 of file Histogram1D.cpp.
|
overrideprivatevirtual |
Makes sure a histogram has valid Y and E data.
histogram | A histogram to check. |
std::invalid_argument | if Y or E data is NULL. |
Reimplemented from Mantid::API::ISpectrum.
Definition at line 77 of file Histogram1D.cpp.
References Mantid::API::ISpectrum::histogram().
|
overridevirtual |
Zero the data (Y&E) in this spectrum.
Implements Mantid::API::ISpectrum.
Definition at line 42 of file Histogram1D.cpp.
|
overridevirtual |
Copy data from a Histogram1D or EventList, via ISpectrum reference.
Implements Mantid::API::ISpectrum.
Definition at line 37 of file Histogram1D.cpp.
References Mantid::API::ISpectrum::copyDataInto().
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 203 of file ISpectrum.cpp.
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 204 of file ISpectrum.cpp.
|
overrideprivatevirtual |
Used by copyDataFrom for dynamic dispatch for its source
.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 40 of file Histogram1D.cpp.
References m_histogram.
|
privatevirtual |
Override in child classes for polymorphic copying of data.
Reimplemented from Mantid::API::ISpectrum.
Definition at line 205 of file ISpectrum.cpp.
|
overridevirtual |
Deprecated, use dx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 68 of file Histogram1D.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use mutableDx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 66 of file Histogram1D.cpp.
References m_histogram.
|
inlineoverridevirtual |
Deprecated, use e() instead. Returns the error data const.
Implements Mantid::API::ISpectrum.
Definition at line 52 of file Histogram1D.h.
Referenced by clearData().
|
inlineoverridevirtual |
Deprecated, use mutableE() instead. Returns the error data.
Implements Mantid::API::ISpectrum.
Definition at line 57 of file Histogram1D.h.
|
overridevirtual |
Deprecated, use x() instead. Returns the x data const.
Implements Mantid::API::ISpectrum.
Definition at line 57 of file Histogram1D.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use mutableX() instead. Returns the x data.
Implements Mantid::API::ISpectrum.
Definition at line 54 of file Histogram1D.cpp.
References m_histogram.
|
inlineoverridevirtual |
Deprecated, use y() instead. Returns the y data const.
Implements Mantid::API::ISpectrum.
Definition at line 50 of file Histogram1D.h.
Referenced by clearData().
|
inlineoverridevirtual |
Deprecated, use mutableY() instead. Returns the y data.
Implements Mantid::API::ISpectrum.
Definition at line 55 of file Histogram1D.h.
|
inlineoverridevirtual |
Gets the memory size of the histogram.
Implements Mantid::API::ISpectrum.
Definition at line 65 of file Histogram1D.h.
|
inlineoverrideprivatevirtual |
Implements Mantid::API::ISpectrum.
Definition at line 74 of file Histogram1D.h.
|
inline |
Checks for errors.
Definition at line 62 of file Histogram1D.h.
|
inlineoverrideprivatevirtual |
Implements Mantid::API::ISpectrum.
Definition at line 75 of file Histogram1D.h.
|
default |
Histogram1D & Mantid::DataObjects::Histogram1D::operator= | ( | const ISpectrum & | rhs | ) |
Assignment from ISpectrum.
Definition at line 30 of file Histogram1D.cpp.
References m_histogram, Mantid::API::ISpectrum::operator=(), and rhs.
|
default |
|
overridevirtual |
Deprecated, use sharedX() instead. Returns a pointer to the x data.
Implements Mantid::API::ISpectrum.
Definition at line 63 of file Histogram1D.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use dx() instead.
Implements Mantid::API::ISpectrum.
Definition at line 70 of file Histogram1D.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use x() instead. Returns the x data const.
Implements Mantid::API::ISpectrum.
Definition at line 60 of file Histogram1D.cpp.
References m_histogram.
|
overridevirtual |
Deprecated, use setSharedX() instead.
Sets the x data.
X | :: vector of X data |
Implements Mantid::API::ISpectrum.
Definition at line 51 of file Histogram1D.cpp.
References m_histogram, and Mantid::Geometry::X.
Referenced by Mantid::DataObjects::Workspace2D::init().
|
inlinevirtual |
get pseudo size
Definition at line 59 of file Histogram1D.h.
|
private |
Histogram object holding the histogram data.
Definition at line 21 of file Histogram1D.h.
Referenced by copyDataInto(), dataDx(), dataX(), Histogram1D(), operator=(), ptrX(), readDx(), readX(), and setX().