-
Sullivan, Brendan T authoredSullivan, Brendan T authored
Description
This algorithm performs integration of single crystal Bragg peaks by fitting the intensity distribution as a 3D distribution made of an Ikeda-Carpenter function (TOF coordinate) and a bivariate Normal distribution.
Similar algorithms
See :ref:`algm-IntegratePeaksMD` or :ref:`algm-IntegrateEllipsoids` for peak-minus-background integration algorithms in reciprocal space.
Inputs
The algorithms takes two input workspaces:
- A MDEventWorkspace containing the events in multi-dimensional space. This would be the output of :ref:`algm-ConvertToMD`.
- As well as a PeaksWorkspace containing single-crystal peak locations. This could be the output of :ref:`algm-FindPeaksMD` or :ref:`algm-PredictPeaks`
- The OutputPeaksWorkspace will contain a copy of the input PeaksWorkspace, with the integrated intensities and errors changed.
- The OutputParamsWorkspace is a TableWorkspace containing the fit parameters. Peaks which could not be fit are omitted.
Instrument-Defined Parameters
In addition to the input parameters defined above, there are several other parameters to be aware of which are pre-defined for each instrument. The instrument is determined from the instrument that is loaded into PeaksWorkspace. If the instrument parameters file does not contain paramters, the algorithm defaults to MaNDi parameters. Default values are below:
Parameter | Description | MaNDi | TOPAZ | CORELLI |
---|---|---|---|---|
DQPixel | The side length for each voxel used for fitting. Units: 1/Angstrom | 0.003 | 0.01 | 0.007 |
FracHKL | The distance between peaks (in fraction of hkl) that is used for fitting. | 0.4 | 0.4 | 0.4 |
MinDtBinWidth | The smallest time bin used for fitting the TOF profile Units: microseconds | 15 | 2 | 2 |
MaxDtBinWidth | The largest time bin used for fitting the TOF profile Units: microseconds | 50 | 15 | 60 |
NTheta | The number of bins along the scattering direction used for BVG fitting. | 50 | 50 | 50 |
NPhi | The number of bins along the azimuthal direction used for BVG fitting. | 50 | 50 | 50 |
Calculations
This algorithm will fit a set of peaks in a PeaksWorkspace. The intensity profile is fit to an MDHisto workspace formed around the peak location.
Constructing the Measured Intensity Distribution
To construct the measured distribution to be fit, a histogram of events is made around the peak. This histogram is in (qx, qy, qz) and composed of voxels of side length dQPixel. To minimize the effect of neighboring peaks on profile fitting, the variable qMask is used to only consider a region around the peak in (h,k,l) space. It will filter voxels outside of (h ± fracHKL, k ± fracHKL, l ± fracHKL) from calculations used for profile fitting. In practice, values of 0.35 < fracHKL < 0.5 seem to work best.
Fitting the Time-of-Flight Coordinate
The time-of-flight (TOF), t, of each voxel is determined as:
t = k \times \frac{(L_1 + L_2)\sin(\theta)}{|\vec{q}|}
The events are histogrammed by their t values to create a TOF profile. This profile can then be fit to the Ikeda Carpenter function. To separate the peak and background, different levels of intensity are filtered out. The predicted background level is determined as the average background not near the peak or off the edge and values within minppl_frac and maxppl_frac times the predicted value are tried. The best fit to the expected moderator emission (determined by the moderator coefficients defined in ModeratorCoefficientsFile) is taken and these voxels are considered to be signal.
Fitting the Non-TOF Coordinate
TOF goes as 1/|\vec{q}| and so it is natural to use spherical coordinate. In that sense, the other two coordinates are (q_{\theta} , q_{\phi_az}) - along the scattering angle and azimuthal angle, respectively. From the MDHisto Workspace (filtered by qMask and using only the signal voxels from the TOF fight), a 2D histogram is constructed which is fit to a bivariate normal distribution. The histogram has nTheta \times nPhi bins.
For weak peaks or peaks near detector edges, the 2D histogram likely does not reflect the full profile. To address this, the profile of the nearest strong peaks is forced when doing the BVG fit. The profile is fit (allowed to vary 10% in \sigma_x, \sigma_y, \rho ) and location and amplitude are not fixed. Weak peaks are defined as peaks with fewer than forceCutoff counts from peak-minus-background integration or within dEdge pixels of the detector edge.
Integrating the Model
The final intensity profile is given by
Y(\vec{q}) = A \times Y_{TOF}(\vec{q}) \times Y_{BVG}(\vec{q}) + B
where A and B are scaling constants. Here the background is assumed to be constant B over the volume of the peak, so the model of the peak itself is Y_{model}(\vec{q}) = A \times Y_{TOF}(\vec{q}) \times Y_{BVG}(\vec{q}). The peak intensity I, is given by summing Y_{model}(\vec{q}) over voxels which are greater than FracStop of the maximum.
\sigma(I) is given as
\sigma(I) = \sqrt{\Sigma N_{obs} + \Sigma N_{BG} + \frac{\Sigma N_{obs}(N_{obs}-N_{model})^2}{\Sigma N_{obs}}}
where the first two terms come from Poissionian statistics and the final term is the variance of the fit. Those sums are over the same voxels used to calculate intensity.
Usage
Example - IntegratePeaksProfileFitting