Ticket #4960 (closed: fixed)
Implement Tobyfit like insturment resolution methods for quantification
Reported by: | Ronald Fowler | Owned by: | Ronald Fowler |
---|---|---|---|
Priority: | major | Milestone: | Release 2.1 |
Component: | VATES | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Alex Buts |
Description (last modified by Alex Buts) (diff)
The quantification aspect of mantid requires the ability to perform an instrument resolution calculation, as is done in the current Tobyfit code. This will be used in simulation of the expected scattering of a foreground model and in fitting that model to experimental data within the GenericFit algorithm. A base class which performs the simultation will be inherited by each foreground function. This will be used in conjunction with the user defined S(Q,w) to calculate the expected scattering.
The simulation needs access to run data and to models for the effects of the moderator, the chopper, instrument dimensions, etc. Each MDEvent needs to represent the total signal in a single detector pixel.
Change History
comment:2 Changed 9 years ago by Ronald Fowler
Adding instrument resolution class and models
Adding first parts of Tobyfit style instrument resolution simulation function Re #4960 . Class SimulateResolution will be inherited by user simulation functions and invoked via GenericFit algorithm.
Changeset: a48d3886040303f20153285311d1b8826aac9374
comment:3 Changed 9 years ago by Ronald Fowler
Re #4960 Update to simulate resolution function
Extended the models of resolution effects to include most of the tobyfit features. Still need to add the matrices mapping from one space to another and the extraction of parameters from ExperimentInfo.
Changeset: f63d622cb7cf8aa720efc9ce5ac0ee2e3c19cc62
comment:4 Changed 9 years ago by Ronald Fowler
Re #4960 correct comments in simulate resolution
Corrected a few comments and minor change to function call. Added a throw if SimulateResolution called without correct initialisation.
Changeset: bd9c9f0edf5675a66cdfda1b4b1f50b997ea004c
comment:5 Changed 8 years ago by Ronald Fowler
Re #4960 Updates to Tobyfit resolution methods
Added to code to SimulateResolution and RunParam to implement most of the operations in Tobyfit. While the basic structure is in place and individual procedures pass some tests, it still omits important functionality such as getting correct detector information from the instrument and any attempt to read from log files. CobaltSpinWave example has been updated for these changes, but no significant tests have yet been written. The test has been re-enabled in the CMakefile.txt.
Changeset: 855c489e1566fe6b846affbfddfeb1c2883ae9ce
comment:6 Changed 8 years ago by Ronald Fowler
Re #4960 Updates to Tobyfit resolution methods
Basic simulation of resolution function is now possible for a foreground function such as CobaltSpinWaveDSHO. However the input data, including chopper and moderator parameters and detector information is read from a RunParam object. Much of this data should be extracted from the Instrument, the Sample and log files, though may be stored in the RunParam objects. Simple tests are consistent with Tobyfit results. A bug exists in taking account of sample shape.
Changeset: 24c6b5135d2ce01c9eb37384e4592e5ec39b093c
comment:7 Changed 8 years ago by Ronald Fowler
Re #4960 Updates to Tobyfit resolution methods
QuadEnBackgroundTest.h changed to not check for success in one case. Test OK on Linux but fails on Windows, Mac.
Changeset: 1183d67a20a54fbb3d2de7b3238f1e844f786d46
comment:8 Changed 8 years ago by Ronald Fowler
Re #4960 Updates to Tobyfit resolution methods
Added to code to SimulateResolution and RunParam to implement most of the operations in Tobyfit. While the basic structure is in place and individual procedures pass some tests, it still omits important functionality such as getting correct detector information from the instrument and any attempt to read from log files. CobaltSpinWave example has been updated for these changes, but no significant tests have yet been written. The test has been re-enabled in the CMakefile.txt.
Changeset: 855c489e1566fe6b846affbfddfeb1c2883ae9ce
comment:9 Changed 8 years ago by Ronald Fowler
Re #4960 Updates to Tobyfit resolution methods
Basic simulation of resolution function is now possible for a foreground function such as CobaltSpinWaveDSHO. However the input data, including chopper and moderator parameters and detector information is read from a RunParam object. Much of this data should be extracted from the Instrument, the Sample and log files, though may be stored in the RunParam objects. Simple tests are consistent with Tobyfit results. A bug exists in taking account of sample shape.
Changeset: 24c6b5135d2ce01c9eb37384e4592e5ec39b093c
comment:10 Changed 8 years ago by Ronald Fowler
Re #4960 Updates to Tobyfit resolution methods
QuadEnBackgroundTest.h changed to not check for success in one case. Test OK on Linux but fails on Windows, Mac.
Changeset: 1183d67a20a54fbb3d2de7b3238f1e844f786d46
comment:11 Changed 8 years ago by Ronald Fowler
Re #4960 Added an additional foreground model
Added Tobyfit model 111, Damped Hisenberg Spin Wave. This is model 111 in TF. Simple tests on one point are consistent with TF, without sample shape effects.
Changeset: b3803866f50c8b3fd7407826eda6e84c63d4c763
comment:12 Changed 8 years ago by Ronald Fowler
Re #4960 Added an additional foreground model
Warning fix for above change.
Changeset: c2643b46ecf67fea574176348efcb0750305a073
comment:14 Changed 8 years ago by Ronald Fowler
- Status changed from accepted to verify
- Resolution set to fixed
Basic simulation gives results that agree with Tobyfit for single test case on two foreground models. Actually extracting the correct information from Instrument, Sample and log files remains to be done, as does data fitting. These parts will be new tickets.
comment:15 follow-up: ↓ 16 Changed 8 years ago by Andrei Savici
How is the MagneticFormFactor class different than the older (and more complete - has multiple js, not only j0. this allows better description of transition metal ions and rare earths) MagneticIon?
comment:16 in reply to: ↑ 15 Changed 8 years ago by Ronald Fowler
Replying to Andrei Savici:
How is the MagneticFormFactor class different than the older (and more complete - has multiple js, not only j0. this allows better description of transition metal ions and rare earths) MagneticIon?
I am sorry, I never thought to check for an existing Magnetic form factor class in Mantid. As it appears more comprehensive then the Tobyfit version it certainly makes more sense to use it in place of the current one. I probably will not have time to alter this for the current release.
comment:17 Changed 8 years ago by Alex Buts
- Status changed from verify to verifying
- Tester set to Alex Buts
comment:18 Changed 8 years ago by Alex Buts
- Status changed from verifying to closed
- Description modified (diff)
interesting piece of code.
This class does everything what Mantid do with neutrons in one go.
Problems are obvious: only 10-component chopper instrument with fixed instrument components and implicit component models is implemented for indirect scattering only. Only user scattering model can be changed.
It would not be difficult to plug this block into an algorithm and use it as test bench for productivity/physical results comparison -- it should already work for the single case it was written and be very efficient.
Any modifications would request reimplementing it in terms of existing Mantid components and it is not only Magnetic ion but almost everything else from physical constants to units conversion
It is a pity it is not embedded in an algorithm -- then would be useful as a test-bench allowing to see resolution effects right now.
With this remark I would close this ticket for now.
comment:19 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 5806
Adding instrument resolution class and models
Adding first parts of Tobyfit style instrument resolution simulation function Re #4960 . Class SimulateResolution will be inherited by user simulation functions and invoked via GenericFit algorithm.