Plus

From MantidProject

Jump to: navigation, search

Contents

Summary

The Plus algorithm will add the data values and calculate the corresponding error values in two compatible workspaces.

Properties

Order Name Direction Type Default Description
1 LHSWorkspace Input Workspace Mandatory The workspace to be added to, this can be considered to be the workspace on the left hand side of the +.
2 RHSWorkspace Input Workspace Mandatory The workspace to be added, this can be considered to be the workspace on the right hand side of the +.
3 OutputWorkspace Output Workspace Mandatory The name of the workspace to be created as the output of the algorithm. A workspace of this name will be created and stored in the Analysis Data Service.

Description

The algorithm plus will add the data and associated errors from any two compatible workspaces. Workspaces are compatible if:

  • The sizes of the two workspaces are compatible (see below)
  • If the two workspaces contain Y bins then the values in these must be identical
  • the units of the axes match
  • the distribution status/counts units match

Compatible Sizes

Workspaces are compatible if they are identically sized in which case the values of each cell within each histogram are added individually. The green arrows shows the order in which the data is added.
They are also compatible if they match the size dimension horizontally, in which case the same values are added to each histogram in the workspace.
If they match in size vertically then the data values will be added to each bin of the histogram.

Finally a workspace containing a single value is compatible to any workspace, in which case the same value will be added uniformly to every bin in each histogram.

Usage

Python

Plus("w1","w2","output")

C++ Within an Algorithm
The usage of basic workspace mathematical operations has been specially simplified for use within algorithms

//w1 and w2 are workspaces
Workspace output = w1 + w2;

Source Code

Header Plus.h

Source Plus.cpp

Personal tools
Create a book