FlatBackground

From MantidProject

Jump to: navigation, search

Contents

Summary

Finds a constant value fit to an appropriate range of each desired spectrum and subtracts that value from the entire spectrum.

Properties

Order Name Direction Type Default Description
1 InputWorkspace Input Workspace Mandatory An input workspace with either constant width X bins or the Y values are a rate (i.e. distribution workspace). All spectra must have the same X bin boundaries
2 OutputWorkspace Output Workspace Mandatory The name to use for the output workspace.
3 StartX Input double Mandatory The X value at which to start the background fit.
4 EndX Input double Mandatory The X value at which to end the background fit.
5 WorkspaceIndexList Input integer list All spectra The workspace indices of the spectra to fit background to.
6 Mode Input string Linear Fit Must be either Linear Fit or Mean and specifies how the background count rate is estimated

Description

This algorithm takes a list of spectra and for each spectra calculates a background value which it then subtracts from the values in all the spectrum's bins. However, no bin will take a negative value as negative values are set to zero (and their error is set to the backgound value). This background value is estimated in one of two ways. When Mode is set to 'Mean' it is the sum of the values in the bins in the background region divided by the number of such bins. Selecting 'Linear Fit' sets the background value to the height in the centre of the background region of a line of best fit through that region.

The error on the background value is only calculated when 'Mean' is used. It is the errors in all the bins in the background region summed in quadrature divided by the number of those bins. This background error value is added in quadrature to the errors in each bin.

Subalgorithms used

The Linear algorithm is used when the Mode = Linear Fit. From the resulting line of best fit a constant value taken as the value of the line at the centre of the fitted range.

Source Code

Header FlatBackground.h

Source FlatBackground.cpp

Personal tools
Create a book