Mantid
|
#include <MDEventWSWrapper.h>
Public Member Functions | |
void | addMDData (std::vector< float > &sigErr, std::vector< uint16_t > &expInfoIndex, std::vector< uint16_t > &goniometerIndex, std::vector< uint32_t > &detId, std::vector< coord_t > &Coord, size_t dataSize) const |
add the data to the internal workspace. More... | |
API::IMDEventWorkspace_sptr | createEmptyMDWS (const MDWSDescription &WSD) |
function creates empty MD event workspace with given parameters (workspace factory) and stores internal pointer to this workspace for further usage More... | |
bool | ifNeedsSplitting () const |
the accessor verify if there are boxes in box-splitter cash which need splitting; More... | |
MDEventWSWrapper () | |
constructor More... | |
size_t | nDimensions () const |
get number of dimensions, for the workspace, currently accessed by the algorithm. More... | |
API::IMDEventWorkspace_sptr | pWorkspace () |
get access to the internal workspace More... | |
void | releaseWorkspace () |
releases the shared pointer to the MD workspace, stored by the class and makes the class instance undefined; More... | |
void | setMDWS (API::IMDEventWorkspace_sptr spWS) |
initiate the class with pointer to existing MD workspace More... | |
void | splitList (Kernel::ThreadScheduler *) |
method splits list of boxes not yet uses thread sheduler but may be later More... | |
virtual | ~MDEventWSWrapper ()=default |
Static Public Member Functions | |
static size_t | getMaxNDim () |
get maximal number of dimensions, allowed for the algorithm and embedded in algorithm during compilation time. More... | |
Private Types | |
enum | { MAX_N_DIM = 8 } |
maximal nuber of dimensions, currently supported by the class; More... | |
Private Member Functions | |
template<size_t nd> | |
void | addAndTraceMDDataND (float *sig_err, uint16_t *expInfoIndex, uint16_t *goniometerIndex, uint32_t *det_id, coord_t *Coord, size_t data_size) const |
template<> | |
void | addMDDataND (const float *, const uint16_t *, const uint16_t *, const uint32_t *, const coord_t *, size_t) const |
the function used in template metaloop termination on 0 dimensions and to throw the error in attempt to add data to 0-dimension workspace More... | |
template<size_t nd> | |
void | addMDDataND (const float *sigErr, const uint16_t *expInfoIndex, const uint16_t *goniometerIndex, const uint32_t *detId, const coord_t *Coord, size_t dataSize) const |
templated by number of dimensions function to add multidimensional data to the workspace it is expected that all MD coordinates are within the ranges of MD defined workspace, so no checks are performed More... | |
template<size_t nd> | |
void | calcCentroidND () |
helper function to refresh centroid on MDEventWorkspace with nd dimensions More... | |
template<> | |
void | calcCentroidND () |
the function used in template metaloop termination on 0 dimensions and as the function which will throw the error on undefined MDWorkspaceWrapper More... | |
template<> | |
void | createEmptyEventWS (const MDWSDescription &) |
terminator for attempting initiate 0 dimensions workspace, will throw. More... | |
template<size_t nd> | |
void | createEmptyEventWS (const MDWSDescription &description) |
internal helper function to create empty MDEventWorkspace with nd dimensions and set up internal pointer to this workspace template parameter: nd – number of dimensions More... | |
template<size_t nd> | |
void | splitBoxList () |
template<> | |
void | splitBoxList () |
Private Attributes | |
size_t | m_NDimensions |
actual number of dimensions, initiated in current MD workspace; 0 if not initated; More... | |
bool | m_needSplitting |
API::IMDEventWorkspace_sptr | m_Workspace |
pointer to taret MD workspace: More... | |
std::vector< fpVoidMethod > | mdBoxListSplitter |
vector holding function pointers to the code, which split list of boxes need splitting More... | |
std::vector< fpVoidMethod > | mdCalCentroid |
vector holding function pointers to the code, which refreshes centroid (could it be moved to IMD?) More... | |
std::vector< fpAddData > | mdEvAddAndForget |
vector holding function pointers to the code, which adds diffrent dimension number events to the workspace More... | |
std::vector< fpCreateWS > | wsCreator |
VECTORS OF FUNCTION POINTERS to different number of dimensions methdods vector holding function pointers to the code, creating different number of dimension worspace as function of dimensions number. More... | |
Friends | |
template<size_t i> | |
class | LOOP |
Definition at line 43 of file MDEventWSWrapper.h.
|
private |
maximal nuber of dimensions, currently supported by the class;
Enumerator | |
---|---|
MAX_N_DIM |
Definition at line 80 of file MDEventWSWrapper.h.
Mantid::MDAlgorithms::MDEventWSWrapper::MDEventWSWrapper | ( | ) |
constructor
Definition at line 253 of file MDEventWSWrapper.cpp.
References Mantid::DataObjects::LOOP< nd >::EXEC(), MAX_N_DIM, mdBoxListSplitter, mdCalCentroid, mdEvAddAndForget, and wsCreator.
|
virtualdefault |
|
private |
void Mantid::MDAlgorithms::MDEventWSWrapper::addMDData | ( | std::vector< float > & | sigErr, |
std::vector< uint16_t > & | expInfoIndex, | ||
std::vector< uint16_t > & | goniometerIndex, | ||
std::vector< uint32_t > & | detId, | ||
std::vector< coord_t > & | Coord, | ||
size_t | dataSize | ||
) | const |
add the data to the internal workspace.
method adds the data to the workspace which was initiated before;
The workspace has to exist and be initiated
sigErr | : pointer to the beginning of 2*data_size array containing signal and squared error |
expInfoIndex | : pointer to the beginnign of data_size containing associated experiment-info index |
goniometerIndex | : 0-based index determines the goniometer settings when this event occurred |
detId | : pointer to the beginning of dataSize array containing detector id-s |
Coord | : pointer to the beginning of dataSize*nd array containig the coordinates od nd-dimensional events |
dataSize | – the length of the vector of MD events |
Definition at line 204 of file MDEventWSWrapper.cpp.
References m_NDimensions, and mdEvAddAndForget.
|
private |
the function used in template metaloop termination on 0 dimensions and to throw the error in attempt to add data to 0-dimension workspace
Definition at line 112 of file MDEventWSWrapper.cpp.
|
private |
templated by number of dimensions function to add multidimensional data to the workspace it is expected that all MD coordinates are within the ranges of MD defined workspace, so no checks are performed
tempate parameter: nd – number of dimensions
sigErr | – pointer to the beginning of 2*data_size array containing signal and squared error |
expInfoIndex | – pointer to the beginning of data_size containing associated experiment-info index |
goniometerIndex | – 0-based index determines the goniometer settings when this event occurred |
detId | – pointer to the beginning of dataSize array containing detector id-s |
Coord | – pointer to the beginning of dataSize*nd array containing the coordinates of nd-dimensional events |
dataSize | – the length of the vector of MD events |
Definition at line 85 of file MDEventWSWrapper.cpp.
References Mantid::DataObjects::MDEventWorkspace::addEvent(), and m_Workspace.
|
private |
helper function to refresh centroid on MDEventWorkspace with nd dimensions
Definition at line 133 of file MDEventWSWrapper.cpp.
References m_Workspace.
|
private |
the function used in template metaloop termination on 0 dimensions and as the function which will throw the error on undefined MDWorkspaceWrapper
Definition at line 144 of file MDEventWSWrapper.cpp.
|
private |
terminator for attempting initiate 0 dimensions workspace, will throw.
Definition at line 59 of file MDEventWSWrapper.cpp.
|
private |
internal helper function to create empty MDEventWorkspace with nd dimensions and set up internal pointer to this workspace template parameter: nd – number of dimensions
description | : MDWorkspaceDescription memento. |
Definition at line 21 of file MDEventWSWrapper.cpp.
References Mantid::Geometry::d, Mantid::MDAlgorithms::MDWSDescription::getDimIDs(), Mantid::MDAlgorithms::MDWSDescription::getDimMax(), Mantid::MDAlgorithms::MDWSDescription::getDimMin(), Mantid::MDAlgorithms::MDWSDescription::getDimNames(), Mantid::MDAlgorithms::MDWSDescription::getDimUnits(), Mantid::MDAlgorithms::MDWSDescription::getFrame(), Mantid::MDAlgorithms::MDWSDescription::getNBins(), Mantid::MDAlgorithms::MDWSDescription::isQ3DMode(), and m_Workspace.
API::IMDEventWorkspace_sptr Mantid::MDAlgorithms::MDEventWSWrapper::createEmptyMDWS | ( | const MDWSDescription & | WSD | ) |
function creates empty MD event workspace with given parameters (workspace factory) and stores internal pointer to this workspace for further usage
function creates empty MD event workspace with given parameters (workspace factory) and stores internal pointer to this workspace for further usage.
IT ASLO SETS UP W-TRANSFORMATON. TODO: reconcile w-transformation with MD geometry.
WSD | the class which describes an MD workspace |
Definition at line 165 of file MDEventWSWrapper.cpp.
References m_NDimensions, m_Workspace, Mantid::MDAlgorithms::MDWSDescription::m_Wtransf, MAX_N_DIM, Mantid::MDAlgorithms::MDWSDescription::nDimensions(), std::to_string(), and wsCreator.
|
inlinestatic |
get maximal number of dimensions, allowed for the algorithm and embedded in algorithm during compilation time.
Definition at line 49 of file MDEventWSWrapper.h.
|
inline |
the accessor verify if there are boxes in box-splitter cash which need splitting;
Definition at line 74 of file MDEventWSWrapper.h.
size_t Mantid::MDAlgorithms::MDEventWSWrapper::nDimensions | ( | ) | const |
get number of dimensions, for the workspace, currently accessed by the algorithm.
function returns the number of dimensions in current MDEvent workspace or throws if the workspace has not been defined
Definition at line 150 of file MDEventWSWrapper.cpp.
References m_NDimensions.
|
inline |
get access to the internal workspace
Definition at line 66 of file MDEventWSWrapper.h.
void Mantid::MDAlgorithms::MDEventWSWrapper::releaseWorkspace | ( | ) |
releases the shared pointer to the MD workspace, stored by the class and makes the class instance undefined;
method should be called at the end of the algorithm, to let the workspace manager know that it has whole responsibility for the workspace (As the algorithm is static, it will hold the pointer to the workspace otherwise, not allowing the WS manager to delete WS on request or when it finds this usefull)
Definition at line 220 of file MDEventWSWrapper.cpp.
References m_NDimensions, and m_Workspace.
void Mantid::MDAlgorithms::MDEventWSWrapper::setMDWS | ( | API::IMDEventWorkspace_sptr | spWS | ) |
initiate the class with pointer to existing MD workspace
set up existing workspace pointer as internal pointer for the class to perform proper MD operations on this workspace
Definition at line 187 of file MDEventWSWrapper.cpp.
References m_NDimensions, and m_Workspace.
|
private |
Definition at line 119 of file MDEventWSWrapper.cpp.
References m_needSplitting, and m_Workspace.
|
private |
Definition at line 127 of file MDEventWSWrapper.cpp.
|
inline |
method splits list of boxes not yet uses thread sheduler but may be later
Definition at line 76 of file MDEventWSWrapper.h.
|
friend |
Definition at line 102 of file MDEventWSWrapper.h.
|
private |
actual number of dimensions, initiated in current MD workspace; 0 if not initated;
Definition at line 83 of file MDEventWSWrapper.h.
Referenced by addMDData(), createEmptyMDWS(), nDimensions(), releaseWorkspace(), and setMDWS().
|
mutableprivate |
Definition at line 122 of file MDEventWSWrapper.h.
Referenced by splitBoxList().
|
private |
pointer to taret MD workspace:
Definition at line 85 of file MDEventWSWrapper.h.
Referenced by addMDDataND(), calcCentroidND(), createEmptyEventWS(), createEmptyMDWS(), releaseWorkspace(), setMDWS(), and splitBoxList().
|
private |
vector holding function pointers to the code, which split list of boxes need splitting
Definition at line 99 of file MDEventWSWrapper.h.
Referenced by Mantid::MDAlgorithms::LOOP< i >::EXEC(), Mantid::MDAlgorithms::LOOP< 0 >::EXEC(), and MDEventWSWrapper().
|
private |
vector holding function pointers to the code, which refreshes centroid (could it be moved to IMD?)
Definition at line 96 of file MDEventWSWrapper.h.
Referenced by Mantid::MDAlgorithms::LOOP< i >::EXEC(), Mantid::MDAlgorithms::LOOP< 0 >::EXEC(), and MDEventWSWrapper().
|
private |
vector holding function pointers to the code, which adds diffrent dimension number events to the workspace
Definition at line 93 of file MDEventWSWrapper.h.
Referenced by addMDData(), Mantid::MDAlgorithms::LOOP< i >::EXEC(), Mantid::MDAlgorithms::LOOP< 0 >::EXEC(), and MDEventWSWrapper().
|
private |
VECTORS OF FUNCTION POINTERS to different number of dimensions methdods vector holding function pointers to the code, creating different number of dimension worspace as function of dimensions number.
Definition at line 90 of file MDEventWSWrapper.h.
Referenced by createEmptyMDWS(), Mantid::MDAlgorithms::LOOP< i >::EXEC(), Mantid::MDAlgorithms::LOOP< 0 >::EXEC(), and MDEventWSWrapper().