9#include "MantidDataObjects/DllConfig.h"
182 throw std::invalid_argument(
" there are more dimensions requested then instantiated");
184 return std::shared_ptr<API::IMDEventWorkspace>(pWs);
207 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID) {
210 throw std::invalid_argument(
" there are more dimensions requested then instantiated");
213 if (extentsVector.size() != nDimensions)
215 std::vector<Mantid::Geometry::MDDimensionExtents<coord_t>> defaultExtents(nDimensions);
216 for (
size_t i = 0; i < nDimensions; i++) {
218 defaultExtents[i].setExtents(-1e30f, 1e30f);
220 return (*(
boxCreatorFP[
id]))(splitter.get(), defaultExtents, depth, nBoxEvents, boxID);
223 return (*(
boxCreatorFP[
id]))(splitter.get(), extentsVector, depth, nBoxEvents, boxID);
230std::vector<MDEventFactory::fpCreateBox>
253 if (eventType ==
"MDEvent")
255 else if (eventType ==
"MDLeanEvent")
258 throw std::invalid_argument(
"Unknown event type " + eventType +
" passed to CreateMDWorkspace.");
271MDEventFactory::createMDWorkspaceND<0>(
const std::string &eventType,
277 throw std::invalid_argument(
"Workspace can not have 0 dimensions");
287 const uint32_t ,
const size_t ,
const size_t ) {
288 throw std::invalid_argument(
"MDBox/MDGridBox can not have 0 dimensions");
303 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID) {
319 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID) {
320 return new MDBox<MDEvent<nd>, nd>(splitter, depth, extentsVector, nBoxEvents, boxID);
335 const uint32_t depth,
const size_t ,
const size_t ) {
351 const uint32_t depth,
const size_t ,
const size_t ) {
360template <
size_t nd>
class LOOP {
368 &MDEventFactory::createMDBoxLean<nd>;
370 &MDEventFactory::createMDBoxFat<nd>;
372 &MDEventFactory::createMDGridBoxLean<nd>;
374 &MDEventFactory::createMDGridBoxFat<nd>;
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
This class is used by MDBox and MDGridBox in order to intelligently determine optimal behavior.
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
MDEventFactory : collection of methods to create MDLeanEvent* instances, by specifying the number of ...
Templated super-class of a multi-dimensional event "box".
MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth.
Templated class for a multi-dimensional event "box".
static LOOP< MAX_MD_DIMENSIONS_NUM > CODE_GENERATOR
static API::IMDNode * createMDBoxLean(API::BoxController *splitter, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, const uint32_t depth, const size_t nBoxEvents, const size_t boxID)
Method to create MDBox for lean events (Constructor wrapper) with given number of dimensions.
BoxType
enum defines fifferent box types generated by createBox factory We will use typecast from integer to ...
static API::IMDNode * createMDGridBoxFat(API::BoxController *splitter, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, const uint32_t depth, const size_t nBoxEvents=0, const size_t boxID=0)
Method to create MDGridBox for events (Constructor wrapper) with given number of dimensions.
static API::IMDNode * createMDGridBoxLean(API::BoxController *splitter, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, const uint32_t depth, const size_t nBoxEvents=0, const size_t boxID=0)
Method to create MDGridBox for lean events (Constructor wrapper) with given number of dimensions.
static std::vector< fpCreateMDWS > wsCreatorFP
static API::IMDNode * createMDBoxWrong(API::BoxController *, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &, const uint32_t, const size_t, const size_t)
Method to create any MDBox type with 0 number of dimensions.
static API::IMDEventWorkspace * createMDWorkspaceND(const std::string &eventType, const Mantid::API::MDNormalization &preferredNormalization, const Mantid::API::MDNormalization &preferredNormalizationHisto)
Template to create md workspace with specific number of dimensions.
static API::IMDNode * createMDBoxFat(API::BoxController *splitter, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, const uint32_t depth, const size_t nBoxEvents, const size_t boxID)
Method to create MDBox for events (Constructor wrapper) with given number of dimensions.
static std::vector< fpCreateBox > boxCreatorFP
static vector, conaining the pointers to the functions creating MD boxes
static API::IMDEventWorkspace_sptr CreateMDWorkspace(size_t nd, const std::string &eventType="MDLeanEvent", const Mantid::API::MDNormalization &preferredNormalization=Mantid::API::MDNormalization::VolumeNormalization, const Mantid::API::MDNormalization &preferredNormalizationHisto=Mantid::API::MDNormalization::VolumeNormalization)
Create a MDEventWorkspace of the given type.
static API::IMDNode * createBox(size_t nDimensions, BoxType Type, API::BoxController_sptr &splitter, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector=std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > >(), const uint32_t depth=0, const size_t nBoxEvents=UNDEF_SIZET, const size_t boxID=UNDEF_SIZET)
Create a MDBox or MDGridBoxof the given type.
Templated class for the multi-dimensional event workspace.
Templated class holding data about a neutron detection event in N-dimensions (for example,...
Templated class for a GRIDDED multi-dimensional event "box".
Templated class holding data about a neutron detection event in N-dimensions (for example,...
Simple class that holds the extents (min/max) of a given dimension in a MD workspace or MDBox.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< BoxController > BoxController_sptr
Shared ptr to BoxController.
MDNormalization
Enum describing different ways to normalize the signal in a MDWorkspace.