AsymmetryCalc

From MantidProject

Jump to: navigation, search

Contents

Summary

Calculates the asymmetry between two groups of detectors for a muon workspace.

Properties

Order Name Direction Type Default Description
1 InputWorkspace Input Workspace Mandatory The name of the input workspace.
2 OutputWorkspace Output Workspace Mandatory The name of the output workspace.
3 ForwardSpectra Input Integer array Mandatory The detector number of the forward group.
4 BackwardSpectra Input Integer array Mandatory The detector number of the backward group.
5 Alpha Input Double 1.0 The balance parameter α

Description

This algorithm is used to calculate the asymmetry for a muon workspace. The asymmetry is given by:

 Asymmetry = \frac{F-\alpha B}{F+\alpha B}

where F is the front spectra, B is the back spectra and a is alpha.

The errors in F-aB and F+aB are calculated by adding the errors in F and B in quadrature; any errors in alpha are ignored. The errors for the asymmetry are then calculated using the fractional error method with the values for the errors in F-aB and F+aB.

The output workspace contains one set of data for the time of flight, the asymmetry and the asymmetry errors.

Note: this algorithm does not perform any grouping; the grouping must be done via the GroupDetectors algorithm or when the NeXus file is loaded auto_group must be set to true.

Usage

Python

   AsymmetryCalc("EmuData","OutWS","1.0","0,1,2,3,4","16,17,18,19,20")

C++

   IAlgorithm* alg = FrameworkManager::Instance().createAlgorithm("AsymmetryCalc");
   alg->setPropertyValue("InputWorkspace", "EmuData");
   alg->setPropertyValue("OutputWorkspace", "OutWS");
   alg->setPropertyValue("Alpha", "1.0");
   alg->setPropertyValue("ForwardSpectra", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15");
   alg->setPropertyValue("BackwardSpectra", "16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31");
   alg->execute();
   Workspace* ws = FrameworkManager::Instance().getWorkspace("OutWS");

Source Code

Header MuonAsymmetryCalc.h

Source MuonAsymmetryCalc.cpp

Personal tools
Create a book