23 std::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>> ws =
24 std::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>(
27 auto numBins = description.
getNBins();
31 for (
size_t d = 0;
d < nd;
d++) {
59template <>
void MDEventWSWrapper::createEmptyEventWS<0>(
const MDWSDescription & ) {
60 throw(std::invalid_argument(
"MDEventWSWrapper:createEmptyEventWS can not be "
61 "initiated with 0 dimensions"));
86 const uint32_t *detId,
const coord_t *Coord,
size_t dataSize)
const {
90 for (
size_t i = 0; i < dataSize; i++) {
92 *(goniometerIndex + i), *(detId + i), (Coord + i * nd)));
99 throw std::runtime_error(
"Bad Cast: Target MD workspace to add events "
100 "does not correspond to type of events you try "
103 for (
size_t i = 0; i < dataSize; i++) {
112void MDEventWSWrapper::addMDDataND<0>(
const float * ,
const uint16_t * ,
113 const uint16_t * ,
const uint32_t * ,
114 const coord_t * ,
size_t )
const {
115 throw(std::invalid_argument(
" class has not been initiated, can not add data "
116 "to 0-dimensional workspace"));
122 throw(std::bad_cast());
127template <>
void MDEventWSWrapper::splitBoxList<0>() {
128 throw(std::invalid_argument(
" class has not been initiated, can not split "
129 "0-dimensional workspace boxes"));
138 throw(std::bad_cast());
144template <>
void MDEventWSWrapper::calcCentroidND<0>() {
145 throw(std::invalid_argument(
" class has not been initiated"));
152 throw(std::invalid_argument(
"The workspace has not been initiated yet"));
170 " instantiated during compilation\n";
171 throw(std::invalid_argument(ERR));
205 std::vector<uint16_t> &goniometerIndex, std::vector<uint32_t> &detId,
206 std::vector<coord_t> &Coord,
size_t dataSize)
const {
230template <
size_t i>
class LOOP {
234 pH->
wsCreator[i] = &MDEventWSWrapper::createEmptyEventWS<i>;
245 pH->
wsCreator[0] = &MDEventWSWrapper::createEmptyEventWS<0>;
MDEventFactory : collection of methods to create MDLeanEvent* instances, by specifying the number of ...
Templated class for the multi-dimensional event workspace.
size_t addEvent(const MDE &event)
Templated class holding data about a neutron detection event in N-dimensions (for example,...
Templated class holding data about a neutron detection event in N-dimensions (for example,...
GeneralFrame : Any MDFrame that isn't related to momemtum transfer.
static void EXEC(MDEventWSWrapper *pH)
static void EXEC(MDEventWSWrapper *pH)
void releaseWorkspace()
releases the shared pointer to the MD workspace, stored by the class and makes the class instance und...
std::vector< fpCreateWS > wsCreator
VECTORS OF FUNCTION POINTERS to different number of dimensions methdods vector holding function point...
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 expect...
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.
size_t m_NDimensions
actual number of dimensions, initiated in current MD workspace; 0 if not initated;
size_t nDimensions() const
get number of dimensions, for the workspace, currently accessed by the algorithm.
API::IMDEventWorkspace_sptr m_Workspace
pointer to taret MD workspace:
void setMDWS(API::IMDEventWorkspace_sptr spWS)
initiate the class with pointer to existing MD workspace
std::vector< fpVoidMethod > mdBoxListSplitter
vector holding function pointers to the code, which split list of boxes need splitting
std::vector< fpVoidMethod > mdCalCentroid
vector holding function pointers to the code, which refreshes centroid (could it be moved to IMD?...
MDEventWSWrapper()
constructor
API::IMDEventWorkspace_sptr createEmptyMDWS(const MDWSDescription &WSD)
function creates empty MD event workspace with given parameters (workspace factory) and stores intern...
void createEmptyEventWS(const MDWSDescription &description)
internal helper function to create empty MDEventWorkspace with nd dimensions and set up internal poin...
void calcCentroidND()
helper function to refresh centroid on MDEventWorkspace with nd dimensions
std::vector< fpAddData > mdEvAddAndForget
vector holding function pointers to the code, which adds diffrent dimension number events to the work...
helper class describes the properties of target MD workspace, which should be obtained as the result ...
bool isQ3DMode() const
Is the algorithm running in Q3D mode?
std::vector< std::string > getDimIDs() const
Geometry::MDFrame_uptr getFrame(size_t d) const
Retrieve the md frame.
std::vector< std::string > getDimNames() const
std::vector< size_t > getNBins() const
std::vector< std::string > getDimUnits() const
unsigned int nDimensions() const
std::vector< double > getDimMin() const
Kernel::DblMatrix m_Wtransf
std::vector< double > getDimMax() const
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< MDHistoDimension > MDHistoDimension_sptr
Shared pointer to a MDHistoDimension.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
std::string to_string(const wide_integer< Bits, Signed > &n)