Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix period subtraction in MuonCalculateAsymmetry #14018

Merged

Conversation

raquelalvarezbanos
Copy link
Contributor

Fixes #13952

MuonCalculateAsymmetry is used in the MuonAnalysis interface. It is a workflow algorithm that can take two input workspaces and combine them to calculate the asymmetry. There are two possible operations on the input workspaces: period addition (+) and period subtraction (-). In the first case, the input workspaces must be summed first and then the asymmetry must be calculated. In the latter case, the asymmetry must be calculated first and then the workspaces must be subtracted.

Before #13102, the period addition (+) was not working as expected, as the asymmetry was calculated before adding the counts. When fixing this, I broke the period subtraction (-), as I was not aware that the two operations are not equivalent. This PR is to fix the "-" operation I broke in #13102.

For tester:

There are two things to test here: period addition and period subtraction.

  • Period subtraction: I've restored the previous reference file used in MuonLoad system test. Everything is OK if this test passes.
  • Period addition:
    • Open Interfaces > Muon > Muon Analysis. Load "HIFI00084447.nxs" (can be found here \HIFI\Data).
    • A graph will appear, make sure this corresponds to period 1 and that "None" is selected as the second period. Plot type should be "Asymmetry" and "Dead Time Correction" (section "Instrument") should be set to "From Data File". Go to "Data Analysis" and add FlatBackground + ExpDecayMuon. Fit the data (fitting range [0.11, 12.67])and write down the fitting results (A0, A and Lambda values).
    • Go back to "Home" tab and select period 3 (again "None" should be the second period). Repeat the fit and write down the fitting results.
  • Now go back to "Home" tab and select period 3 + 1. Go to "Data Analysis" and fit the data. The fit parameters should all be the average of those found in the individual period fits.

As an example, my fitting results are:

Period 1: A=0.109808(0.016461) Lambda=0.078193(0.015791) A0=0.052417(0.016830)
Period 3: A=0.128165(0.022629) Lambda= 0.065989(0.015012) A0= 0.033689(0.023000)
Period 1+3: A= 0.117273(0.013306) Lambda= 0.072781(0.010908) A0= 0.044780(0.013567)

you should get similar results.

Release notes: http://www.mantidproject.org/index.php?title=Release_Notes_3_6_MuonAnalysis&diff=25401&oldid=25396

@raquelalvarezbanos raquelalvarezbanos added the Muon Issues and pull requests related to muons label Oct 16, 2015
@raquelalvarezbanos raquelalvarezbanos added this to the Release 3.6 milestone Oct 16, 2015
@raquelalvarezbanos raquelalvarezbanos added the Patch Candidate Urgent issues that must be included in a patch following a release label Oct 16, 2015
…_Fix_period_subtraction_in_MuonCalculateAsymmetry
@KarlPalmen
Copy link
Contributor

I got similar results and they were within the error value of the average.

KarlPalmen added a commit that referenced this pull request Oct 20, 2015
…tion_in_MuonCalculateAsymmetry

Fix period subtraction in MuonCalculateAsymmetry
@KarlPalmen KarlPalmen merged commit 08a3350 into master Oct 20, 2015
@KarlPalmen KarlPalmen deleted the 13952_Fix_period_subtraction_in_MuonCalculateAsymmetry branch October 20, 2015 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Muon Issues and pull requests related to muons Patch Candidate Urgent issues that must be included in a patch following a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix period subtraction in MuonCalculateAsymmetry
2 participants