32 : m_ws(
workspace), m_pos(0),
m_max(0), m_function(function), m_errorIsCached(false),
33 m_spectrumInfo(m_ws->spectrumInfo()) {
35 throw std::runtime_error(
"MatrixWorkspaceMDIterator::ctor() NULL MatrixWorkspace");
42 throw std::runtime_error(
"MatrixWorkspaceMDIterator: Beginning workspace "
43 "index passed is too high.");
50 throw std::runtime_error(
"MatrixWorkspaceMDIterator: End point is before the start point.");
103 if (yVals.size() > 1) {
171 return std::numeric_limits<signal_t>::quiet_NaN();
186 return std::numeric_limits<signal_t>::quiet_NaN();
205 throw std::runtime_error(
"MatrixWorkspaceMDIterator::getVertexesArray() not implemented yet");
210 const bool * )
const {
211 throw std::runtime_error(
"MatrixWorkspaceMDIterator::getVertexesArray() not implemented yet");
268 throw std::runtime_error(
"MatrixWorkspaceMDIterator does not implement findNeighbourIndexes");
276 throw std::runtime_error(
"MatrixWorkspaceMDIterator does not implement "
277 "findNeighbourIndexesFaceTouching");
281 throw std::runtime_error(
"MatrixWorkspaceMDIterator does not implement getLinearIndex");
285 throw std::runtime_error(
"MatrixWorkspaceMDIterator does not implement isWithinBounds");
IPeaksWorkspace_sptr workspace
std::map< DeltaEMode::Type, std::string > index
double lower
lower and upper bounds on the multiplier, if known
Mantid::API::MDNormalization m_normalization
Normalization method for getNormalizedSignal()
std::unique_ptr< coord_t[]> getVertexesArray(size_t &numVertices) const override
Return a list of vertexes defining the volume pointed to.
Mantid::Kernel::VMD m_center
Coordinates of the center at the current iterator pos.
uint16_t getInnerExpInfoIndex(size_t index) const override
For a given event/point in this box, return the associated experiment-info index.
Mantid::Geometry::MDImplicitFunction * m_function
Implicit function to limit volume searched.
uint64_t m_max
The maximum linear index in the workspace.
signal_t getSignal() const override
Returns the signal for this box, same as innerSignal.
uint16_t getInnerGoniometerIndex(size_t index) const override
For a given event/point in this box, return the associated experiment-info index.
bool m_isBinnedData
Is the matrix workspace binned (true) e.g. Y vector is 1 shorter than X.
bool getIsMasked() const override
Getter for the masked state of the workspace.
size_t getNumEvents() const override
Returns the number of events/points contained in this box.
double m_verticalBinSize
For numeric axes, this is the size of the bin in the vertical direction.
MantidVec m_X
Cached copies of X,Y,E at current workspace index.
size_t getLinearIndex() const override
Get the linear index.
bool next() override
Advance to the next cell.
bool m_errorIsCached
Error vector has been cached?
std::vector< size_t > findNeighbourIndexesFaceTouching() const override
Find neighbour indexes face touching.
void jumpTo(size_t index) override
Jump to the index^th cell.
signal_t getInnerSignal(size_t index) const override
Returns the signal of a given event.
std::vector< size_t > findNeighbourIndexes() const override
Find neighbour indexes.
Mantid::Geometry::IMDDimension_const_sptr m_dimY
The Y (vertical, e.g. spectra) dimension.
size_t m_workspaceIndex
Workspace index of the spectrum we are looking at.
bool valid() const override
int32_t getInnerDetectorID(size_t index) const override
For a given event/point in this box, return the detector ID.
signal_t getInnerError(size_t index) const override
Returns the error of a given event.
uint64_t m_pos
The linear position/index into the MDHistoWorkspace.
bool isWithinBounds(size_t index) const override
Is index reachable by the iterator.
signal_t getNormalizedError() const override
Returns the normalized error for this box.
const SpectrumInfo & m_spectrumInfo
SpectrumInfo object, used for masking information.
signal_t getError() const override
Returns the error for this box, same as innerError.
size_t getDataSize() const override
coord_t getInnerPosition(size_t index, size_t dimension) const override
Returns the position of a given event for a given dimension.
size_t m_endWI
Workspace index at which the iterator ends.
size_t m_xIndex
x-index, index into the Y[] data array of the spectrum.
const MatrixWorkspace * m_ws
Workspace being iterated.
Mantid::Kernel::VMD getCenter() const override
Returns the position of the center of the box pointed to.
size_t m_beginWI
Workspace index at which the iterator begins.
void calcWorkspacePos(size_t newWI)
Calculate the workspace index/x index for this iterator position.
MatrixWorkspaceMDIterator(const MatrixWorkspace *workspace, Mantid::Geometry::MDImplicitFunction *function, size_t beginWI=0, size_t endWI=size_t(-1))
Constructor.
signal_t getNormalizedSignal() const override
Returns the normalized signal for this box.
std::vector< size_t > m_startIndices
vector of starting index of the unraveled data array
Base MatrixWorkspace Abstract Class.
const MantidVec & readE(std::size_t const index) const
Deprecated, use e() instead.
virtual std::size_t getNumberHistograms() const =0
Returns the number of histograms in the workspace.
const MantidVec & readY(std::size_t const index) const
Deprecated, use y() instead.
virtual Axis * getAxis(const std::size_t &axisIndex) const
Get a non owning pointer to a workspace axis.
const MantidVec & readX(std::size_t const index) const
Deprecated, use x() instead.
std::shared_ptr< const Mantid::Geometry::IMDDimension > getDimension(size_t index) const override
Get a dimension.
virtual bool isHistogramData() const
Returns true if the workspace contains data in histogram form (as opposed to point-like)
Class to represent a numeric axis of a workspace.
virtual const std::vector< double > & getValues() const
Return a const reference to the values.
bool hasDetectors(const size_t index) const
Returns true if the spectrum is associated with detectors in the instrument.
bool isMasked(const size_t index) const
Returns true if the detector(s) associated with the spectrum are masked.
An "ImplicitFunction" defining a hyper-cuboid-shaped region in N dimensions.
virtual bool isPointContained(const coord_t *coords)
Is a point in MDimensions contained by this ImplicitFunction? If the point is bounded by ALL planes c...
@ VolumeNormalization
Divide the signal by the volume of the box/bin.
@ NumEventsNormalization
Divide the signal by the number of events that contributed to it.
@ NoNormalization
Don't normalize = return raw counts.
VMDBase< VMD_t > VMD
Define the VMD as using the double or float data type.
float VMD_t
Underlying data type for the VMD type.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
double signal_t
Typedef for the signal recorded in a MDBox, etc.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces