35 throw std::runtime_error(
"Incompatible workspace types passed to PlusMD.");
43 size_t initial_numEvents = ws1->getNPoints();
51 if (box && !box->getIsMasked()) {
58 prog.
report(
"Adding Events");
61 this->progress(0.41,
"Splitting Boxes");
64 auto prog2 =
new Progress(
this, 0.4, 0.9, 100);
67 ws1->splitAllIfNeeded(ts);
68 prog2->resetNumSteps(ts->
size(), 0.4, 0.6);
114 this->progress(0.95,
"Refreshing cache");
119 if (ws1->getNPoints() != initial_numEvents)
120 ws1->setFileNeedsUpdating(
true);
132 throw std::runtime_error(
"Cannot sum a MDHistoWorkspace and a "
133 "MDEventWorkspace (only MDEventWorkspace + "
134 "MDEventWorkspace is allowed).");
136 throw std::runtime_error(
"Cannot sum a MDEventWorkspace and a scalar "
137 "(only MDEventWorkspace + MDEventWorkspace is "
153 out->add(scalar->y(0)[0], scalar->e(0)[0]);
#define DECLARE_ALGORITHM(classname)
static std::unique_ptr< QThreadPool > tp
#define CALL_MDEVENT_FUNCTION(funcname, workspace)
Macro that makes it possible to call a templated method for a MDEventWorkspace using a IMDEventWorksp...
size_t getTotalNumMDBoxes() const
Return the total number of MD Boxes, irrespective of depth.
Helper class for reporting progress from algorithms.
Templated super-class of a multi-dimensional event "box".
virtual size_t addEvents(const std::vector< MDE > &events)
Mantid::API::BoxController * getBoxController() const override
MDBoxIterator: iterate through MDBoxBase hierarchy down to a given maximum depth.
bool next() override
Advance to the next cell.
MDBoxBase< MDE, nd > * getBox() const
Return a pointer to the current box pointed to by the iterator.
Templated class for a multi-dimensional event "box".
const std::vector< MDE > & getConstEvents() const
Get vector of constant events to use.
Templated class for the multi-dimensional event workspace.
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
MDBoxBase< MDE, nd > * getBox()
Templated class holding data about a neutron detection event in N-dimensions (for example,...
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
A Thread Pool implementation that keeps a certain number of threads running (normally,...
A First-In-First-Out Thread Scheduler.
The ThreadScheduler object defines how tasks are allocated to threads and in what order.
virtual size_t size()=0
Returns the size of the queue.
Mantid::API::IMDEventWorkspace_sptr m_rhs_event
Mantid::API::IMDEventWorkspace_sptr m_lhs_event
For checkInputs.
Mantid::DataObjects::WorkspaceSingleValue_sptr m_rhs_scalar
Mantid::DataObjects::WorkspaceSingleValue_sptr m_lhs_scalar
Mantid::DataObjects::MDHistoWorkspace_sptr m_rhs_histo
Mantid::DataObjects::MDHistoWorkspace_sptr m_lhs_histo
Mantid::API::IMDEventWorkspace_sptr m_out_event
Output MDEventWorkspace.
Sum two MDWorkspaces together.
bool commutative() const override
Is the operation commutative?
void execHistoScalar(Mantid::DataObjects::MDHistoWorkspace_sptr out, Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) override
Run the algorithm with a MDHisotWorkspace as output, scalar and operand.
void checkInputs() override
Check the inputs and throw if the algorithm cannot be run.
void doPlus(typename Mantid::DataObjects::MDEventWorkspace< MDE, nd >::sptr ws)
Perform the adding.
void execHistoHisto(Mantid::DataObjects::MDHistoWorkspace_sptr out, Mantid::DataObjects::MDHistoWorkspace_const_sptr operand) override
Run the algorithm with a MDHisotWorkspace as output and operand.
void execEvent() override
Run the algorithm with an MDEventWorkspace as output.
std::shared_ptr< const WorkspaceSingleValue > WorkspaceSingleValue_const_sptr
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
std::shared_ptr< const MDHistoWorkspace > MDHistoWorkspace_const_sptr
A shared pointer to a const MDHistoWorkspace.