Mantid
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Private Types | Static Private Member Functions | Static Private Attributes | Friends | List of all members
Mantid::DataObjects::MDEventFactory Class Reference

#include <MDEventFactory.h>

Public Types

enum  BoxType {
  MDBoxWithLean = 0 , MDGridBoxWithLean = 1 , MDBoxWithFat = 2 , MDGridBoxWithFat = 3 ,
  NumBoxTypes = 4
}
 enum defines fifferent box types generated by createBox factory We will use typecast from integer to these types so it is important to define consisten numbers to these types
More...
 

Static Public Member Functions

static API::IMDNodecreateBox (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. More...
 
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. More...
 
static size_t getMaxNumDim ()
 Returns max number of MD dimensions allowed by current Mantid version. More...
 

Private Types

enum  { MAX_MD_DIMENSIONS_NUM = 9 }
 definition which states how many dimensions to generate. More...
 
using fpCreateBox = API::IMDNode *(*)(API::BoxController *, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &, const uint32_t, const size_t, const size_t)
 
using fpCreateMDWS = API::IMDEventWorkspace *(*)(const std::string &, const Mantid::API::MDNormalization &, const Mantid::API::MDNormalization &)
 

Static Private Member Functions

template<size_t nd>
static API::IMDNodecreateMDBoxFat (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. More...
 
template<size_t nd>
static API::IMDNodecreateMDBoxLean (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. More...
 
static API::IMDNodecreateMDBoxWrong (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. More...
 
template<size_t nd>
static API::IMDNodecreateMDGridBoxFat (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. More...
 
template<size_t nd>
static API::IMDNodecreateMDGridBoxLean (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. More...
 
template<size_t nd>
static API::IMDEventWorkspacecreateMDWorkspaceND (const std::string &eventType, const Mantid::API::MDNormalization &preferredNormalization, const Mantid::API::MDNormalization &preferredNormalizationHisto)
 Template to create md workspace with specific number of dimensions. More...
 
template<>
API::IMDEventWorkspacecreateMDWorkspaceND (const std::string &eventType, const Mantid::API::MDNormalization &preferredNormalization, const Mantid::API::MDNormalization &preferredNormalizationHisto)
 Template to create md workspace w ith 0 number of dimentisons. More...
 

Static Private Attributes

static std::vector< fpCreateBoxboxCreatorFP
 static vector, conaining the pointers to the functions creating MD boxes More...
 
static LOOP< MAX_MD_DIMENSIONS_NUMCODE_GENERATOR
 
static std::vector< fpCreateMDWSwsCreatorFP
 

Friends

template<size_t nd>
class LOOP
 

Detailed Description

Definition at line 32 of file MDEventFactory.h.

Member Typedef Documentation

◆ fpCreateBox

using Mantid::DataObjects::MDEventFactory::fpCreateBox = API::IMDNode *(*)(API::BoxController *, const std::vector<Mantid::Geometry::MDDimensionExtents<coord_t> > &, const uint32_t, const size_t, const size_t)
private

Definition at line 69 of file MDEventFactory.h.

◆ fpCreateMDWS

Definition at line 78 of file MDEventFactory.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

definition which states how many dimensions to generate.

This defines the number of dimensions in MD wokspace supported by Mantid IF THIS NUMBER CHANGES, ONE HAS TO RUN generate_mdevent_declarations.py located with MDEventFactory.cpp file TO REINSTANTIATE AUTOGENERATED CODE

Enumerator
MAX_MD_DIMENSIONS_NUM 

Definition at line 38 of file MDEventFactory.h.

◆ BoxType

enum defines fifferent box types generated by createBox factory We will use typecast from integer to these types so it is important to define consisten numbers to these types

Enumerator
MDBoxWithLean 
MDGridBoxWithLean 
MDBoxWithFat 
MDGridBoxWithFat 
NumBoxTypes 

Definition at line 44 of file MDEventFactory.h.

Member Function Documentation

◆ createBox()

API::IMDNode * Mantid::DataObjects::MDEventFactory::createBox ( size_t  nDimensions,
MDEventFactory::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 
)
static

Create a MDBox or MDGridBoxof the given type.

Parameters
nDimensions:: number of dimensions
Type:: enum descibing the box (MDBox or MDGridBox) and the event type (MDEvent or MDLeanEvent)
splitter:: shared pointer to the box controller responsible for splitting boxes. The BC is not incremented as boxes take usual pointer from this pointer
extentsVector,:box extents in all n-dimensions (min-max)
depth:: the depth of the box within the box tree
nBoxEvents:: if defined, specify the memory the box should allocate to accept events – not used for MDGridBox
boxID:: the unique identifier, referencing location of the box in 1D linked list of boxes. – not used for MDGridBox
Returns
pointer to the IMDNode with proper box created.

Definition at line 225 of file MDEventFactory.cpp.

References boxCreatorFP, MAX_MD_DIMENSIONS_NUM, and NumBoxTypes.

Referenced by Mantid::DataObjects::MDBoxFlatTree::restoreBoxTree().

◆ createMDBoxFat()

template<size_t nd>
API::IMDNode * Mantid::DataObjects::MDEventFactory::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 
)
staticprivate

Method to create MDBox for events (Constructor wrapper) with given number of dimensions.

Parameters
splitter:: BoxController that controls how boxes split
extentsVector:: vector defining the extents of the box in all n-dimensions
depth:: splitting depth of the new box.
nBoxEvents:: number of events to reserve memory for (if needed).
boxID:: id for the given box

Definition at line 338 of file MDEventFactory.cpp.

◆ createMDBoxLean()

template<size_t nd>
API::IMDNode * Mantid::DataObjects::MDEventFactory::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 
)
staticprivate

Method to create MDBox for lean events (Constructor wrapper) with given number of dimensions.

Parameters
splitter:: BoxController that controls how boxes split
extentsVector:: vector defining the extents of the box in all n-dimensions
depth:: splitting depth of the new box.
nBoxEvents:: number of events to reserve memory for (if needed).
boxID:: id for the given box

Definition at line 322 of file MDEventFactory.cpp.

◆ createMDBoxWrong()

API::IMDNode * Mantid::DataObjects::MDEventFactory::createMDBoxWrong ( API::BoxController ,
const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &  ,
const uint32_t  ,
const  size_t,
const  size_t 
)
staticprivate

Method to create any MDBox type with 0 number of dimensions.

As it is wrong, just throws

Definition at line 306 of file MDEventFactory.cpp.

Referenced by Mantid::DataObjects::LOOP< 0 >::EXEC().

◆ createMDGridBoxFat()

template<size_t nd>
API::IMDNode * Mantid::DataObjects::MDEventFactory::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 
)
staticprivate

Method to create MDGridBox for events (Constructor wrapper) with given number of dimensions.

Parameters
splitter:: BoxController that controls how boxes split
extentsVector:: vector defining the extents of the box in all n-dimensions
depth:: splitting depth of the new box.
nBoxEvents– not used
boxID:: — not used

Definition at line 370 of file MDEventFactory.cpp.

◆ createMDGridBoxLean()

template<size_t nd>
API::IMDNode * Mantid::DataObjects::MDEventFactory::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 
)
staticprivate

Method to create MDGridBox for lean events (Constructor wrapper) with given number of dimensions.

Parameters
splitter:: BoxController that controls how boxes split
extentsVector:: vector defining the extents of the box in all n-dimensions
depth:: splitting depth of the new box.
nBoxEvents– not used
boxID:: — not used

Definition at line 354 of file MDEventFactory.cpp.

◆ CreateMDWorkspace()

API::IMDEventWorkspace_sptr Mantid::DataObjects::MDEventFactory::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 
)
static

◆ createMDWorkspaceND() [1/2]

template<size_t nd>
API::IMDEventWorkspace * Mantid::DataObjects::MDEventFactory::createMDWorkspaceND ( const std::string &  eventType,
const Mantid::API::MDNormalization preferredNormalization,
const Mantid::API::MDNormalization preferredNormalizationHisto 
)
staticprivate

Template to create md workspace with specific number of dimensions.

Parameters
eventType– type of event (lean or full) to generate workspace for
preferredNormalizationthe preferred normalization for the event workspace
preferredNormalizationHistothe preferred normalization for a derived histo workspace

Definition at line 271 of file MDEventFactory.cpp.

◆ createMDWorkspaceND() [2/2]

template<>
API::IMDEventWorkspace * Mantid::DataObjects::MDEventFactory::createMDWorkspaceND ( const std::string &  eventType,
const Mantid::API::MDNormalization preferredNormalization,
const Mantid::API::MDNormalization preferredNormalizationHisto 
)
staticprivate

Template to create md workspace w ith 0 number of dimentisons.

As this is wrong, just throws. Used as terminator and check for the wrong dimensions number

Parameters
eventType– type of event (lean or full) to generate workspace for - -does not actually used.
preferredNormalizationthe preferred normalization of the workspace
preferredNormalizationHistothe preferred normalization of the derived histo workspace

Definition at line 291 of file MDEventFactory.cpp.

References UNUSED_ARG.

◆ getMaxNumDim()

static size_t Mantid::DataObjects::MDEventFactory::getMaxNumDim ( )
inlinestatic

Returns max number of MD dimensions allowed by current Mantid version.

Definition at line 66 of file MDEventFactory.h.

Referenced by Mantid::DataObjects::MDBoxFlatTree::restoreBoxTree().

Friends And Related Function Documentation

◆ LOOP

template<size_t nd>
friend class LOOP
friend

Definition at line 118 of file MDEventFactory.h.

Member Data Documentation

◆ boxCreatorFP

std::vector< MDEventFactory::fpCreateBox > Mantid::DataObjects::MDEventFactory::boxCreatorFP
staticprivate

static vector, conaining the pointers to the functions creating MD boxes

Definition at line 74 of file MDEventFactory.h.

Referenced by createBox(), Mantid::DataObjects::LOOP< nd >::EXEC(), and Mantid::DataObjects::LOOP< 0 >::EXEC().

◆ CODE_GENERATOR

LOOP< MDEventFactory::MAX_MD_DIMENSIONS_NUM > Mantid::DataObjects::MDEventFactory::CODE_GENERATOR
staticprivate

Definition at line 120 of file MDEventFactory.h.

◆ wsCreatorFP

std::vector< MDEventFactory::fpCreateMDWS > Mantid::DataObjects::MDEventFactory::wsCreatorFP
staticprivate

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