\(\renewcommand\AA{\unicode{x212B}}\)
PlusMD v1¶
Summary¶
Sum two MDHistoWorkspaces or merges two MDEventWorkspaces together by combining their events together in one workspace.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
LHSWorkspace |
Input |
IMDWorkspace |
Mandatory |
An MDEventWorkspace, MDHistoWorkspace or WorkspaceSingleValue as the left-hand side of the operation. |
RHSWorkspace |
Input |
IMDWorkspace |
Mandatory |
An MDEventWorkspace, MDHistoWorkspace or WorkspaceSingleValue as the right-hand side of the operation. |
OutputWorkspace |
Output |
IMDWorkspace |
Mandatory |
Name of the output MDEventWorkspace or MDHistoWorkspace. |
Description¶
This algorithm sums two MDHistoWorkspaces or merges two MDEventWorkspaces together.
MDHistoWorkspaces¶
MDHistoWorkspace + MDHistoWorkspace
The operation is performed element-by-element.
MDHistoWorkspace + Scalar or Scalar + MDHistoWorkspace
The scalar is subtracted from every element of the MDHistoWorkspace. The squares of errors are summed.
MDEventWorkspaces¶
This algorithm operates similarly to calling Plus on two EventWorkspaces: it combines the events from the two workspaces together to form one large workspace.
Note for file-backed workspaces¶
The algorithm uses CloneMDWorkspace v1 to create the output workspace, except when adding in place (e.g. \(A = A + B\) ). See CloneMDWorkspace v1 for details, but note that a file-backed MDEventWorkspace will have its file copied.
If A is in memory and B is file-backed, the operation \(C = A + B\) will clone the B file-backed workspace and add A to it.
However, the operation \(A = A + B\) will clone the A workspace and add B into memory (which might be too big!)
Also, be aware that events added to a MDEventWorkspace are currently added in memory and are not cached to file until SaveMD v2 or another algorithm requiring it is called. The workspace is marked as ‘requiring file update’.
Categories: AlgorithmIndex | MDAlgorithms\MDArithmetic
Source¶
C++ header: PlusMD.h
C++ source: PlusMD.cpp