24#include "MantidDataObjects/MDBin.tcc"
25#include "MantidDataObjects/MDBox.tcc"
26#include "MantidDataObjects/MDBoxBase.tcc"
27#include "MantidDataObjects/MDBoxIterator.tcc"
28#include "MantidDataObjects/MDEventWorkspace.tcc"
29#include "MantidDataObjects/MDGridBox.tcc"
203 throw std::invalid_argument(
" there are more dimensions requested then instantiated");
205 return std::shared_ptr<API::IMDEventWorkspace>(pWs);
228 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID) {
231 throw std::invalid_argument(
" there are more dimensions requested then instantiated");
234 if (extentsVector.size() != nDimensions)
236 std::vector<Mantid::Geometry::MDDimensionExtents<coord_t>> defaultExtents(nDimensions);
237 for (
size_t i = 0; i < nDimensions; i++) {
239 defaultExtents[i].setExtents(-1e30f, 1e30f);
241 return (*(
boxCreatorFP[
id]))(splitter.get(), defaultExtents, depth, nBoxEvents, boxID);
244 return (*(
boxCreatorFP[
id]))(splitter.get(), extentsVector, depth, nBoxEvents, boxID);
251std::vector<MDEventFactory::fpCreateBox>
274 if (eventType ==
"MDEvent")
276 else if (eventType ==
"MDLeanEvent")
279 throw std::invalid_argument(
"Unknown event type " + eventType +
" passed to CreateMDWorkspace.");
292MDEventFactory::createMDWorkspaceND<0>(
const std::string &eventType,
298 throw std::invalid_argument(
"Workspace can not have 0 dimensions");
308 const uint32_t ,
const size_t ,
const size_t ) {
309 throw std::invalid_argument(
"MDBox/MDGridBox can not have 0 dimensions");
324 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID) {
340 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID) {
341 return new MDBox<MDEvent<nd>, nd>(splitter, depth, extentsVector, nBoxEvents, boxID);
356 const uint32_t depth,
const size_t ,
const size_t ) {
372 const uint32_t depth,
const size_t ,
const size_t ) {
381template <
size_t nd>
class LOOP {
389 &MDEventFactory::createMDBoxLean<nd>;
391 &MDEventFactory::createMDBoxFat<nd>;
393 &MDEventFactory::createMDGridBoxLean<nd>;
395 &MDEventFactory::createMDGridBoxFat<nd>;
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
#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 ...
MDBin : Class describing a single bin in a dense, Multidimensional histogram.
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.