Mantid
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::MDEventInserter< MDEW_SPTR > Class Template Reference

MDEventInserter : Helper class that provides a generic interface for adding events to an MDWorkspace without knowing whether the workspace is storing MDLeanEvents or full MDEvents. More...

#include <MDEventInserter.h>

Classes

struct  IntToType
 Loki IntToType, used for template overload deduction. More...
 

Public Types

using MDEventType = typename MDEW_SPTR::element_type::MDEventType
 Type of MDEvent used by the MDEventWorkspace. More...
 

Public Member Functions

void insertMDEvent (float signal, float errorSQ, uint16_t expInfoIndex, uint16_t goniometerIndex, int32_t detectno, Mantid::coord_t *coords)
 Creates an mdevent and adds it to the MDEW. More...
 
 MDEventInserter (MDEW_SPTR &ws)
 Constructor. More...
 

Private Member Functions

void insertMDEvent (float signal, float errorSQ, uint16_t expInfoIndex, uint16_t goniometerIndex, int32_t detectno, Mantid::coord_t *coords, IntToType< true >)
 Creates a FULL MDEvent and adds it to the MDEW. More...
 
void insertMDEvent (float signal, float errorSQ, uint16_t, uint16_t, int32_t, Mantid::coord_t *coords, IntToType< false >)
 Creates a LEAN MDEvent and adds it to the MDEW. More...
 

Private Attributes

MDEW_SPTR m_ws
 shared pointer to MDEW to add to. More...
 

Detailed Description

template<typename MDEW_SPTR>
class Mantid::DataObjects::MDEventInserter< MDEW_SPTR >

MDEventInserter : Helper class that provides a generic interface for adding events to an MDWorkspace without knowing whether the workspace is storing MDLeanEvents or full MDEvents.

Uses LOKI techniques for choosing the overload addition operation based on embedded type arguments in the respective MDLeanEventTypes. This solution is nice because depending upon the workspace type, only one of the private addEvent funtions is instantiated. For usage, you only need to know the dimensionality of the workspace, not the underlying type of MDEvent being used.

Date
2012-07-16

Definition at line 28 of file MDEventInserter.h.

Member Typedef Documentation

◆ MDEventType

template<typename MDEW_SPTR >
using Mantid::DataObjects::MDEventInserter< MDEW_SPTR >::MDEventType = typename MDEW_SPTR::element_type::MDEventType

Type of MDEvent used by the MDEventWorkspace.

Definition at line 37 of file MDEventInserter.h.

Constructor & Destructor Documentation

◆ MDEventInserter()

template<typename MDEW_SPTR >
Mantid::DataObjects::MDEventInserter< MDEW_SPTR >::MDEventInserter ( MDEW_SPTR &  ws)
inline

Constructor.

Parameters
ws: MDEventWorkspace to add to.

Definition at line 43 of file MDEventInserter.h.

Member Function Documentation

◆ insertMDEvent() [1/3]

template<typename MDEW_SPTR >
void Mantid::DataObjects::MDEventInserter< MDEW_SPTR >::insertMDEvent ( float  signal,
float  errorSQ,
uint16_t  expInfoIndex,
uint16_t  goniometerIndex,
int32_t  detectno,
Mantid::coord_t coords 
)
inline

Creates an mdevent and adds it to the MDEW.

The type of MDEvent generated is determined internally using type information on the MDEventType.

Parameters
signal: intensity
errorSQ: squared value of the error
expInfoIndex: associated experiment-info index (index into the vector of ExperimentInfo)
goniometerIndex0-based index determines the goniometer settings when this event occurred
detectno: detector number
coords: pointer to coordinates array

Definition at line 56 of file MDEventInserter.h.

Referenced by Mantid::MDAlgorithms::ImportMDEventWorkspace::addEventsData().

◆ insertMDEvent() [2/3]

template<typename MDEW_SPTR >
void Mantid::DataObjects::MDEventInserter< MDEW_SPTR >::insertMDEvent ( float  signal,
float  errorSQ,
uint16_t  expInfoIndex,
uint16_t  goniometerIndex,
int32_t  detectno,
Mantid::coord_t coords,
IntToType< true >   
)
inlineprivate

Creates a FULL MDEvent and adds it to the MDEW.

Parameters
signal: intensity
errorSQ: squared value of the error
expInfoIndex: associated experiment-info index
goniometerIndex0-based index determines the goniometer settings when this event occurred
detectno: detector number
coords: pointer to coordinates array

Definition at line 89 of file MDEventInserter.h.

◆ insertMDEvent() [3/3]

template<typename MDEW_SPTR >
void Mantid::DataObjects::MDEventInserter< MDEW_SPTR >::insertMDEvent ( float  signal,
float  errorSQ,
uint16_t  ,
uint16_t  ,
int32_t  ,
Mantid::coord_t coords,
IntToType< false >   
)
inlineprivate

Creates a LEAN MDEvent and adds it to the MDEW.

Parameters
signal: intensity
errorSQ: squared value of the error
coords: pointer to coordinates array

Definition at line 74 of file MDEventInserter.h.

Member Data Documentation

◆ m_ws

template<typename MDEW_SPTR >
MDEW_SPTR Mantid::DataObjects::MDEventInserter< MDEW_SPTR >::m_ws
private

shared pointer to MDEW to add to.

Definition at line 66 of file MDEventInserter.h.


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