Mantid
Loading...
Searching...
No Matches
BinMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
18#include "MantidKernel/VMD.h"
20
21namespace Mantid {
22namespace Geometry {
23// Forward declaration
24class MDImplicitFunction;
25} // namespace Geometry
26namespace MDAlgorithms {
27
37class MANTID_MDALGORITHMS_DLL BinMD : public SlicingAlgorithm {
38public:
39 BinMD();
40
42 const std::string name() const override { return "BinMD"; }
44 const std::string summary() const override {
45 return "Take a MDEventWorkspace and bin into into a dense, "
46 "multi-dimensional histogram workspace (MDHistoWorkspace).";
47 }
48
50 int version() const override { return 1; }
51 const std::vector<std::string> seeAlso() const override { return {"SliceMDHisto", "ProjectMD", "CutMD", "SliceMD"}; }
53 const std::string category() const override { return "MDAlgorithms\\Slicing"; }
54
55private:
57 void init() override;
59 void exec() override;
60
62 template <typename MDE, size_t nd> void binByIterating(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
63
65 template <typename MDE, size_t nd>
66 void binMDBox(DataObjects::MDBox<MDE, nd> *box, const size_t *const chunkMin, const size_t *const chunkMax);
67
71 std::unique_ptr<Mantid::API::Progress> prog = nullptr;
73 std::unique_ptr<Mantid::Geometry::MDImplicitFunction> implicitFunction;
74
76 std::vector<size_t> indexMultiplier;
80 bool m_accumulate{false};
81};
82
83} // namespace MDAlgorithms
84} // namespace Mantid
Templated class for a multi-dimensional event "box".
Definition: MDBox.h:45
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
Take a MDEventWorkspace and bin it to a dense histogram in a MDHistoWorkspace.
Definition: BinMD.h:37
const std::string category() const override
Algorithm's category for identification.
Definition: BinMD.h:53
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: BinMD.h:51
std::unique_ptr< Mantid::Geometry::MDImplicitFunction > implicitFunction
ImplicitFunction used.
Definition: BinMD.h:73
signal_t * numEvents
Definition: BinMD.h:79
std::vector< size_t > indexMultiplier
Cached values for speed up.
Definition: BinMD.h:76
int version() const override
Algorithm's version for identification.
Definition: BinMD.h:50
const std::string name() const override
Algorithm's name for identification.
Definition: BinMD.h:42
Mantid::DataObjects::MDHistoWorkspace_sptr outWS
The output MDHistoWorkspace.
Definition: BinMD.h:69
const std::string summary() const override
Summary of algorithms purpose.
Definition: BinMD.h:44
Abstract Algorithm class that will be used by: BinMD and SliceMD and shares code for getting a slice ...
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
Helper class which provides the Collimation Length for SANS instruments.
double signal_t
Typedef for the signal recorded in a MDBox, etc.
Definition: MDTypes.h:36