17namespace MDAlgorithms {
31 if (ws->getNumDims() < 3)
34 for (
size_t i = 0; i < 3; ++i)
35 if (!ws->getDimension(i)->getMDFrame().isQ())
39 }
else if (ws->getDimension(0)->getName() ==
"|Q|") {
51 "An input MDEventWorkspace. Must be in Q.");
53 "The output MDEventWorkspace with correction applied.");
57 std::map<std::string, std::string> result;
60 if (getNumQDimensions(input_ws) == 0)
61 result[
"InputWorkspace"] =
"Input workspace must be in Q_sample or Q_lab frame. Either Q3D or Q1D with |Q|.";
72 if (output_ws != input_ws)
73 output_ws = input_ws->clone();
80 output_ws->refreshCache();
85template <
typename MDE,
size_t nd>
89 std::vector<API::IMDNode *> boxes;
91 auto numBoxes = int(boxes.size());
94 for (
int i = 0; i < numBoxes; ++i) {
97 if (box && !box->getIsMasked()) {
98 std::vector<MDE> &events = box->
getEvents();
99 for (
auto it = events.begin(); it != events.end(); ++it) {
103 qsqr += it->getCenter(
d) * it->getCenter(
d);
108 const auto intensity = it->getSignal() *
correction;
109 it->setSignal(
static_cast<float>(intensity));
111 it->setErrorSquared(
static_cast<float>(error2));
115 box->releaseEvents();
#define CALL_MDEVENT_FUNCTION(funcname, workspace)
Macro that makes it possible to call a templated method for a MDEventWorkspace using a IMDEventWorksp...
#define PARALLEL_START_INTERRUPT_REGION
Begins a block to skip processing is the algorithm has been interupted Note the end of the block if n...
#define PARALLEL_END_INTERRUPT_REGION
Ends a block to skip processing is the algorithm has been interupted Note the start of the block if n...
#define PRAGMA_OMP(expression)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
virtual void getBoxes(std::vector< IMDNode * > &boxes, size_t maxDepth, bool leafOnly)=0
Fill a vector with all the boxes who are the childred of this one up to a certain depth.
A property class for workspaces.
Templated super-class of a multi-dimensional event "box".
Templated class for a multi-dimensional event "box".
std::vector< MDE > & getEvents()
Get vector of events to change.
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
bool isFileBacked() const override
MDBoxBase< MDE, nd > * getBox()
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
Helper class which provides the Collimation Length for SANS instruments.
Describes the direction (within an algorithm) of a Property.
@ Input
An input workspace.
@ Output
An output workspace.