Mantid
|
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... | |
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.
Definition at line 28 of file MDEventInserter.h.
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.
|
inline |
Constructor.
ws | : MDEventWorkspace to add to. |
Definition at line 43 of file MDEventInserter.h.
|
inline |
Creates an mdevent and adds it to the MDEW.
The type of MDEvent generated is determined internally using type information on the MDEventType.
signal | : intensity |
errorSQ | : squared value of the error |
expInfoIndex | : associated experiment-info index (index into the vector of ExperimentInfo) |
goniometerIndex | 0-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().
|
inlineprivate |
Creates a FULL MDEvent and adds it to the MDEW.
signal | : intensity |
errorSQ | : squared value of the error |
expInfoIndex | : associated experiment-info index |
goniometerIndex | 0-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.
|
inlineprivate |
Creates a LEAN MDEvent and adds it to the MDEW.
signal | : intensity |
errorSQ | : squared value of the error |
coords | : pointer to coordinates array |
Definition at line 74 of file MDEventInserter.h.
|
private |
shared pointer to MDEW to add to.
Definition at line 66 of file MDEventInserter.h.