20namespace DataObjects {
30template <
size_t nd>
class LOOP;
38 enum { MAX_MD_DIMENSIONS_NUM = 9 };
46 MDGridBoxWithLean = 1,
53 size_t nd,
const std::string &eventType =
"MDLeanEvent",
62 const uint32_t depth = 0,
const size_t nBoxEvents =
UNDEF_SIZET,
66 static size_t getMaxNumDim() {
return size_t(MAX_MD_DIMENSIONS_NUM); }
71 const uint32_t,
const size_t,
const size_t);
97 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID);
101 const uint32_t depth,
const size_t nBoxEvents,
const size_t boxID);
106 const uint32_t depth,
const size_t nBoxEvents = 0,
const size_t boxID = 0);
111 const uint32_t depth,
const size_t nBoxEvents = 0,
const size_t boxID = 0);
115 const uint32_t,
const size_t,
const size_t);
118 template <
size_t nd>
friend class LOOP;
137#define CALL_MDEVENT_FUNCTION(funcname, workspace) \
139 MDEventWorkspace<MDLeanEvent<1>, 1>::sptr MDEW_MDLEANEVENT_1 = \
140 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<1>, 1>>(workspace); \
141 if (MDEW_MDLEANEVENT_1) \
142 funcname<MDLeanEvent<1>, 1>(MDEW_MDLEANEVENT_1); \
143 MDEventWorkspace<MDLeanEvent<2>, 2>::sptr MDEW_MDLEANEVENT_2 = \
144 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<2>, 2>>(workspace); \
145 if (MDEW_MDLEANEVENT_2) \
146 funcname<MDLeanEvent<2>, 2>(MDEW_MDLEANEVENT_2); \
147 MDEventWorkspace<MDLeanEvent<3>, 3>::sptr MDEW_MDLEANEVENT_3 = \
148 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<3>, 3>>(workspace); \
149 if (MDEW_MDLEANEVENT_3) \
150 funcname<MDLeanEvent<3>, 3>(MDEW_MDLEANEVENT_3); \
151 MDEventWorkspace<MDLeanEvent<4>, 4>::sptr MDEW_MDLEANEVENT_4 = \
152 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<4>, 4>>(workspace); \
153 if (MDEW_MDLEANEVENT_4) \
154 funcname<MDLeanEvent<4>, 4>(MDEW_MDLEANEVENT_4); \
155 MDEventWorkspace<MDLeanEvent<5>, 5>::sptr MDEW_MDLEANEVENT_5 = \
156 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<5>, 5>>(workspace); \
157 if (MDEW_MDLEANEVENT_5) \
158 funcname<MDLeanEvent<5>, 5>(MDEW_MDLEANEVENT_5); \
159 MDEventWorkspace<MDLeanEvent<6>, 6>::sptr MDEW_MDLEANEVENT_6 = \
160 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<6>, 6>>(workspace); \
161 if (MDEW_MDLEANEVENT_6) \
162 funcname<MDLeanEvent<6>, 6>(MDEW_MDLEANEVENT_6); \
163 MDEventWorkspace<MDLeanEvent<7>, 7>::sptr MDEW_MDLEANEVENT_7 = \
164 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<7>, 7>>(workspace); \
165 if (MDEW_MDLEANEVENT_7) \
166 funcname<MDLeanEvent<7>, 7>(MDEW_MDLEANEVENT_7); \
167 MDEventWorkspace<MDLeanEvent<8>, 8>::sptr MDEW_MDLEANEVENT_8 = \
168 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<8>, 8>>(workspace); \
169 if (MDEW_MDLEANEVENT_8) \
170 funcname<MDLeanEvent<8>, 8>(MDEW_MDLEANEVENT_8); \
171 MDEventWorkspace<MDLeanEvent<9>, 9>::sptr MDEW_MDLEANEVENT_9 = \
172 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<9>, 9>>(workspace); \
173 if (MDEW_MDLEANEVENT_9) \
174 funcname<MDLeanEvent<9>, 9>(MDEW_MDLEANEVENT_9); \
175 MDEventWorkspace<MDEvent<1>, 1>::sptr MDEW_MDEVENT_1 = \
176 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<1>, 1>>(workspace); \
177 if (MDEW_MDEVENT_1) \
178 funcname<MDEvent<1>, 1>(MDEW_MDEVENT_1); \
179 MDEventWorkspace<MDEvent<2>, 2>::sptr MDEW_MDEVENT_2 = \
180 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<2>, 2>>(workspace); \
181 if (MDEW_MDEVENT_2) \
182 funcname<MDEvent<2>, 2>(MDEW_MDEVENT_2); \
183 MDEventWorkspace<MDEvent<3>, 3>::sptr MDEW_MDEVENT_3 = \
184 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<3>, 3>>(workspace); \
185 if (MDEW_MDEVENT_3) \
186 funcname<MDEvent<3>, 3>(MDEW_MDEVENT_3); \
187 MDEventWorkspace<MDEvent<4>, 4>::sptr MDEW_MDEVENT_4 = \
188 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<4>, 4>>(workspace); \
189 if (MDEW_MDEVENT_4) \
190 funcname<MDEvent<4>, 4>(MDEW_MDEVENT_4); \
191 MDEventWorkspace<MDEvent<5>, 5>::sptr MDEW_MDEVENT_5 = \
192 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<5>, 5>>(workspace); \
193 if (MDEW_MDEVENT_5) \
194 funcname<MDEvent<5>, 5>(MDEW_MDEVENT_5); \
195 MDEventWorkspace<MDEvent<6>, 6>::sptr MDEW_MDEVENT_6 = \
196 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<6>, 6>>(workspace); \
197 if (MDEW_MDEVENT_6) \
198 funcname<MDEvent<6>, 6>(MDEW_MDEVENT_6); \
199 MDEventWorkspace<MDEvent<7>, 7>::sptr MDEW_MDEVENT_7 = \
200 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<7>, 7>>(workspace); \
201 if (MDEW_MDEVENT_7) \
202 funcname<MDEvent<7>, 7>(MDEW_MDEVENT_7); \
203 MDEventWorkspace<MDEvent<8>, 8>::sptr MDEW_MDEVENT_8 = \
204 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<8>, 8>>(workspace); \
205 if (MDEW_MDEVENT_8) \
206 funcname<MDEvent<8>, 8>(MDEW_MDEVENT_8); \
207 MDEventWorkspace<MDEvent<9>, 9>::sptr MDEW_MDEVENT_9 = \
208 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<9>, 9>>(workspace); \
209 if (MDEW_MDEVENT_9) \
210 funcname<MDEvent<9>, 9>(MDEW_MDEVENT_9); \
220#define CALL_MDEVENT_FUNCTION3(funcname, workspace) \
222 MDEventWorkspace<MDLeanEvent<3>, 3>::sptr MDEW_MDLEANEVENT_3 = \
223 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<3>, 3>>(workspace); \
224 if (MDEW_MDLEANEVENT_3) \
225 funcname<MDLeanEvent<3>, 3>(MDEW_MDLEANEVENT_3); \
226 MDEventWorkspace<MDLeanEvent<4>, 4>::sptr MDEW_MDLEANEVENT_4 = \
227 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<4>, 4>>(workspace); \
228 if (MDEW_MDLEANEVENT_4) \
229 funcname<MDLeanEvent<4>, 4>(MDEW_MDLEANEVENT_4); \
230 MDEventWorkspace<MDLeanEvent<5>, 5>::sptr MDEW_MDLEANEVENT_5 = \
231 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<5>, 5>>(workspace); \
232 if (MDEW_MDLEANEVENT_5) \
233 funcname<MDLeanEvent<5>, 5>(MDEW_MDLEANEVENT_5); \
234 MDEventWorkspace<MDLeanEvent<6>, 6>::sptr MDEW_MDLEANEVENT_6 = \
235 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<6>, 6>>(workspace); \
236 if (MDEW_MDLEANEVENT_6) \
237 funcname<MDLeanEvent<6>, 6>(MDEW_MDLEANEVENT_6); \
238 MDEventWorkspace<MDLeanEvent<7>, 7>::sptr MDEW_MDLEANEVENT_7 = \
239 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<7>, 7>>(workspace); \
240 if (MDEW_MDLEANEVENT_7) \
241 funcname<MDLeanEvent<7>, 7>(MDEW_MDLEANEVENT_7); \
242 MDEventWorkspace<MDLeanEvent<8>, 8>::sptr MDEW_MDLEANEVENT_8 = \
243 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<8>, 8>>(workspace); \
244 if (MDEW_MDLEANEVENT_8) \
245 funcname<MDLeanEvent<8>, 8>(MDEW_MDLEANEVENT_8); \
246 MDEventWorkspace<MDLeanEvent<9>, 9>::sptr MDEW_MDLEANEVENT_9 = \
247 std::dynamic_pointer_cast<MDEventWorkspace<MDLeanEvent<9>, 9>>(workspace); \
248 if (MDEW_MDLEANEVENT_9) \
249 funcname<MDLeanEvent<9>, 9>(MDEW_MDLEANEVENT_9); \
250 MDEventWorkspace<MDEvent<3>, 3>::sptr MDEW_MDEVENT_3 = \
251 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<3>, 3>>(workspace); \
252 if (MDEW_MDEVENT_3) \
253 funcname<MDEvent<3>, 3>(MDEW_MDEVENT_3); \
254 MDEventWorkspace<MDEvent<4>, 4>::sptr MDEW_MDEVENT_4 = \
255 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<4>, 4>>(workspace); \
256 if (MDEW_MDEVENT_4) \
257 funcname<MDEvent<4>, 4>(MDEW_MDEVENT_4); \
258 MDEventWorkspace<MDEvent<5>, 5>::sptr MDEW_MDEVENT_5 = \
259 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<5>, 5>>(workspace); \
260 if (MDEW_MDEVENT_5) \
261 funcname<MDEvent<5>, 5>(MDEW_MDEVENT_5); \
262 MDEventWorkspace<MDEvent<6>, 6>::sptr MDEW_MDEVENT_6 = \
263 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<6>, 6>>(workspace); \
264 if (MDEW_MDEVENT_6) \
265 funcname<MDEvent<6>, 6>(MDEW_MDEVENT_6); \
266 MDEventWorkspace<MDEvent<7>, 7>::sptr MDEW_MDEVENT_7 = \
267 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<7>, 7>>(workspace); \
268 if (MDEW_MDEVENT_7) \
269 funcname<MDEvent<7>, 7>(MDEW_MDEVENT_7); \
270 MDEventWorkspace<MDEvent<8>, 8>::sptr MDEW_MDEVENT_8 = \
271 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<8>, 8>>(workspace); \
272 if (MDEW_MDEVENT_8) \
273 funcname<MDEvent<8>, 8>(MDEW_MDEVENT_8); \
274 MDEventWorkspace<MDEvent<9>, 9>::sptr MDEW_MDEVENT_9 = \
275 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<9>, 9>>(workspace); \
276 if (MDEW_MDEVENT_9) \
277 funcname<MDEvent<9>, 9>(MDEW_MDEVENT_9); \
287#define CONST_CALL_MDEVENT_FUNCTION(funcname, workspace) \
289 const MDEventWorkspace<MDLeanEvent<1>, 1>::sptr CONST_MDEW_MDLEANEVENT_1 = \
290 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<1>, 1>>(workspace); \
291 if (CONST_MDEW_MDLEANEVENT_1) \
292 funcname<MDLeanEvent<1>, 1>(CONST_MDEW_MDLEANEVENT_1); \
293 const MDEventWorkspace<MDLeanEvent<2>, 2>::sptr CONST_MDEW_MDLEANEVENT_2 = \
294 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<2>, 2>>(workspace); \
295 if (CONST_MDEW_MDLEANEVENT_2) \
296 funcname<MDLeanEvent<2>, 2>(CONST_MDEW_MDLEANEVENT_2); \
297 const MDEventWorkspace<MDLeanEvent<3>, 3>::sptr CONST_MDEW_MDLEANEVENT_3 = \
298 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<3>, 3>>(workspace); \
299 if (CONST_MDEW_MDLEANEVENT_3) \
300 funcname<MDLeanEvent<3>, 3>(CONST_MDEW_MDLEANEVENT_3); \
301 const MDEventWorkspace<MDLeanEvent<4>, 4>::sptr CONST_MDEW_MDLEANEVENT_4 = \
302 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<4>, 4>>(workspace); \
303 if (CONST_MDEW_MDLEANEVENT_4) \
304 funcname<MDLeanEvent<4>, 4>(CONST_MDEW_MDLEANEVENT_4); \
305 const MDEventWorkspace<MDLeanEvent<5>, 5>::sptr CONST_MDEW_MDLEANEVENT_5 = \
306 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<5>, 5>>(workspace); \
307 if (CONST_MDEW_MDLEANEVENT_5) \
308 funcname<MDLeanEvent<5>, 5>(CONST_MDEW_MDLEANEVENT_5); \
309 const MDEventWorkspace<MDLeanEvent<6>, 6>::sptr CONST_MDEW_MDLEANEVENT_6 = \
310 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<6>, 6>>(workspace); \
311 if (CONST_MDEW_MDLEANEVENT_6) \
312 funcname<MDLeanEvent<6>, 6>(CONST_MDEW_MDLEANEVENT_6); \
313 const MDEventWorkspace<MDLeanEvent<7>, 7>::sptr CONST_MDEW_MDLEANEVENT_7 = \
314 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<7>, 7>>(workspace); \
315 if (CONST_MDEW_MDLEANEVENT_7) \
316 funcname<MDLeanEvent<7>, 7>(CONST_MDEW_MDLEANEVENT_7); \
317 const MDEventWorkspace<MDLeanEvent<8>, 8>::sptr CONST_MDEW_MDLEANEVENT_8 = \
318 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<8>, 8>>(workspace); \
319 if (CONST_MDEW_MDLEANEVENT_8) \
320 funcname<MDLeanEvent<8>, 8>(CONST_MDEW_MDLEANEVENT_8); \
321 const MDEventWorkspace<MDLeanEvent<9>, 9>::sptr CONST_MDEW_MDLEANEVENT_9 = \
322 std::dynamic_pointer_cast<const MDEventWorkspace<MDLeanEvent<9>, 9>>(workspace); \
323 if (CONST_MDEW_MDLEANEVENT_9) \
324 funcname<MDLeanEvent<9>, 9>(CONST_MDEW_MDLEANEVENT_9); \
325 const MDEventWorkspace<MDEvent<1>, 1>::sptr CONST_MDEW_MDEVENT_1 = \
326 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<1>, 1>>(workspace); \
327 if (CONST_MDEW_MDEVENT_1) \
328 funcname<MDEvent<1>, 1>(CONST_MDEW_MDEVENT_1); \
329 const MDEventWorkspace<MDEvent<2>, 2>::sptr CONST_MDEW_MDEVENT_2 = \
330 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<2>, 2>>(workspace); \
331 if (CONST_MDEW_MDEVENT_2) \
332 funcname<MDEvent<2>, 2>(CONST_MDEW_MDEVENT_2); \
333 const MDEventWorkspace<MDEvent<3>, 3>::sptr CONST_MDEW_MDEVENT_3 = \
334 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<3>, 3>>(workspace); \
335 if (CONST_MDEW_MDEVENT_3) \
336 funcname<MDEvent<3>, 3>(CONST_MDEW_MDEVENT_3); \
337 const MDEventWorkspace<MDEvent<4>, 4>::sptr CONST_MDEW_MDEVENT_4 = \
338 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<4>, 4>>(workspace); \
339 if (CONST_MDEW_MDEVENT_4) \
340 funcname<MDEvent<4>, 4>(CONST_MDEW_MDEVENT_4); \
341 const MDEventWorkspace<MDEvent<5>, 5>::sptr CONST_MDEW_MDEVENT_5 = \
342 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<5>, 5>>(workspace); \
343 if (CONST_MDEW_MDEVENT_5) \
344 funcname<MDEvent<5>, 5>(CONST_MDEW_MDEVENT_5); \
345 const MDEventWorkspace<MDEvent<6>, 6>::sptr CONST_MDEW_MDEVENT_6 = \
346 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<6>, 6>>(workspace); \
347 if (CONST_MDEW_MDEVENT_6) \
348 funcname<MDEvent<6>, 6>(CONST_MDEW_MDEVENT_6); \
349 const MDEventWorkspace<MDEvent<7>, 7>::sptr CONST_MDEW_MDEVENT_7 = \
350 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<7>, 7>>(workspace); \
351 if (CONST_MDEW_MDEVENT_7) \
352 funcname<MDEvent<7>, 7>(CONST_MDEW_MDEVENT_7); \
353 const MDEventWorkspace<MDEvent<8>, 8>::sptr CONST_MDEW_MDEVENT_8 = \
354 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<8>, 8>>(workspace); \
355 if (CONST_MDEW_MDEVENT_8) \
356 funcname<MDEvent<8>, 8>(CONST_MDEW_MDEVENT_8); \
357 const MDEventWorkspace<MDEvent<9>, 9>::sptr CONST_MDEW_MDEVENT_9 = \
358 std::dynamic_pointer_cast<const MDEventWorkspace<MDEvent<9>, 9>>(workspace); \
359 if (CONST_MDEW_MDEVENT_9) \
360 funcname<MDEvent<9>, 9>(CONST_MDEW_MDEVENT_9); \
This class is used by MDBox and MDGridBox in order to intelligently determine optimal behavior.
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
MDEventFactory : collection of methods to create MDLeanEvent* instances, by specifying the number of ...
MDBin : Class describing a single bin in a dense, Multidimensional histogram.
Templated super-class of a multi-dimensional event "box".
Templated class for a multi-dimensional event "box".
API::IMDNode *(*)(API::BoxController *, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &, const uint32_t, const size_t, const size_t) fpCreateBox
static LOOP< MAX_MD_DIMENSIONS_NUM > CODE_GENERATOR
BoxType
enum defines fifferent box types generated by createBox factory We will use typecast from integer to ...
static std::vector< fpCreateMDWS > wsCreatorFP
static size_t getMaxNumDim()
Returns max number of MD dimensions allowed by current Mantid version.
API::IMDEventWorkspace *(*)(const std::string &, const Mantid::API::MDNormalization &, const Mantid::API::MDNormalization &) fpCreateMDWS
static std::vector< fpCreateBox > boxCreatorFP
static vector, conaining the pointers to the functions creating MD boxes
Templated class for the multi-dimensional event workspace.
Templated class for a GRIDDED multi-dimensional event "box".
Simple class that holds the extents (min/max) of a given dimension in a MD workspace or MDBox.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< BoxController > BoxController_sptr
Shared ptr to BoxController.
MDNormalization
Enum describing different ways to normalize the signal in a MDWorkspace.
@ VolumeNormalization
Divide the signal by the volume of the box/bin.
Helper class which provides the Collimation Length for SANS instruments.