Isotropic S(Q,E) scatterer from an analytic expression or grid, with optional final-energy focusing.
Author: Fahima Islam (McStas port of the MCViNE SQEkernel / SQE_EnergyFocusing_Kernel (+ SQE_fromexpression); MCViNE by J. Y. Y. Lin et al.)
Origin: MCViNE, https://github.com/mcvine/mcvine (mccomponents/lib/kernels/sample/SQEkernel.cc, SQE_EnergyFocusing_Kernel.cc)
Date: 2026-09-29
Isotropic (powder / liquid) S(|Q|,E). E is sampled uniformly in [Emin, min(Ei,Emax)] and |Q| uniformly in the kinematically allowed part of [Qmin,Qmax]. S(Q,E) is an expression in Q [Å^-1] and E [meV], or a grid file in the Isotropic_Sqw format (first numeric row: q values; second: energy values; then nq rows of nw values), bilinearly interpolated. For grid data McStas’ Isotropic_Sqw already exists; the new parts are the analytic S(Q,E) and the energy focusing: when dEf>0, E is restricted so that Ef lies in [Ef-dEf, Ef+dEf] (MCViNE SQE_EnergyFocusing_Kernel).
Functions are given as strings evaluated at run time (MCViNE uses fparser): + - * / ^ (or **), % , comparisons, && ||, if(c,a,b), sin cos tan asin acos atan sinh cosh tanh exp log log10 log2 sqrt abs floor ceil int sign cbrt, pow atan2 min max hypot fmod, constants pi and e.
Transport (same as MCViNE HomogeneousNeutronScatterer): on the first passage the neutron is forced to scatter at a uniformly chosen depth, weighted by path length, attenuation exp(-(mu+sigma)x) and the scattering coefficient; on exit it is attenuated by exp(-(mu+sigma)L_out). With order>1 further scatterings are sampled analogically (truncated exponential). With p_transmit>0 that fraction of events is kept as the attenuated direct beam. mu(v) = absorption_coefficient*2200/v. Events for which the kernel cannot scatter (kinematically forbidden) are absorbed.
Geometry: box (xwidth,yheight,zdepth), cylinder (radius,yheight), hollow cylinder (+thickness) or sphere (radius only). All vectors (Q, targets, reciprocal vectors, atom positions) are in the component’s local frame.
Uses the shared runtime share/mcvine-lib.h/.c.
Example: MCViNE_SQE(SQE="exp(-(E-10)^2/2)*Q^2*exp(-Q^2/4)", Qmin=0, Qmax=10, Emin=-5, Emax=30, sigma_scat=5, sigma_abs=0.5, Vc=50, radius=0.01, yheight=0.05)
Parameters in boldface are required; the others are optional.
|
Name |
Unit |
Description |
Default |
|
|
|||
|
SQE |
str |
S(Q,E) expression (ignored if SQE_file given) |
"1" |
|
SQE_file |
str |
S(q,w) grid file (Isotropic_Sqw layout) |
0 |
|
Qmin |
Å\(^{-1}\) |
Lower Q bound |
0 |
|
Qmax |
Å\(^{-1}\) |
Upper Q bound |
10 |
|
Emin |
meV |
Lower energy transfer bound |
-10 |
|
Emax |
meV |
Upper energy transfer bound |
10 |
|
Ef |
meV |
Final-energy focusing centre (used when dEf>0) |
0 |
|
dEf |
meV |
Final-energy focusing half range; 0 disables focusing |
0 |
|
absorption_coefficient |
m\(^{-1}\) |
Absorption coefficient at 2200 m/s (MCViNE convention; scales as 1/v) |
0 |
|
scattering_coefficient |
m\(^{-1}\) |
Scattering coefficient |
0 |
|
sigma_abs |
barn |
Alternative: absorption cross section per unit cell at 2200 m/s (used when Vc>0) |
0 |
|
sigma_scat |
barn |
Alternative: scattering cross section per unit cell (used when Vc>0) |
0 |
|
Vc |
Å\(^{3}\) |
Unit cell volume; when >0, coefficients are computed from sigma_abs, sigma_scat |
0 |
|
radius |
m |
Outer radius of a cylinder (with yheight) or of a sphere (yheight=0) |
0 |
|
xwidth |
m |
Width of a box sample |
0 |
|
yheight |
m |
Height of a box or cylinder sample |
0 |
|
zdepth |
m |
Depth of a box sample |
0 |
|
thickness |
m |
Wall thickness of a hollow cylinder (0: filled) |
0 |
|
pack |
1 |
Packing factor (scales absorption and scattering coefficients) |
1 |
|
p_transmit |
1 |
Monte Carlo fraction of events kept as unscattered transmitted beam (0: always scatter) |
0 |
|
order |
1 |
Maximum number of scattering events per neutron (1: single scattering) |
1 |
|
|
|||
|
|
|||
|
|
|||
Component source code found in file MCViNE_SQE.comp.
MCViNE documentation: https://mcvine.github.io