McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding

Download
 Components
 Other Downloads (share)

Mailing list

Search web/mailinglist

Documentation
 Wiki (GitHub)
 McStas manual
 Publications

Links

Report bugs (GitHub)

Code-repository (GitHub)


McStas: MCViNE_Broadened_E_Q

[ Identification | Description | Input parameters | Links ]

The MCViNE_Broadened_E_Q Component

Isotropic dispersion E(Q) broadened by a Gaussian of Q-dependent width.

Identification

  • Author: Fahima Islam (McStas port of the MCViNE Broadened_E_Q_Kernel; MCViNE by J. Y. Y. Lin et al.)
  • Origin: MCViNE, https://github.com/mcvine/mcvine (mccomponents/lib/kernels/sample/Broadened_E_Q_Kernel.icc)
  • Date: 2026-09-29

Description

S(Q,E) = S(Q) G(E - E(Q); sigma(Q)) with G a normalised Gaussian of standard
deviation sigma(Q).
Q is sampled uniformly in [Qmin,Qmax]; the energy offset is sampled from the
line shape (up to 100 attempts). Neutrons with Ei below min(E(Q)-3w(Q)) do not
scatter.

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_Broadened_E_Q(E_Q="20*sin(Q*1.5)^2", S_Q="1", sigma_Q="0.5", Qmin=0, Qmax=10, scattering_coefficient=10, radius=0.01, yheight=0.05)

Input parameters

Parameters in boldface are required; the others are optional.
NameUnitDescriptionDefault
E_QstrE(Q) expression [meV], variable Q [AA^-1]"10"
S_QstrS(Q) expression"1"
sigma_QstrGaussian sigma(Q) [meV]"1"
QminAA^-1Lower Q bound0
QmaxAA^-1Upper Q bound10
unbiased10: MCViNE sampling (retries without acceptance correction: over-weights when part of the Q range is forbidden). 1: single attempt, unbiased0
absorption_coefficientm^-1Absorption coefficient at 2200 m/s (MCViNE convention; scales as 1/v)0
scattering_coefficientm^-1Scattering coefficient0
sigma_absbarnAlternative: absorption cross section per unit cell at 2200 m/s (used when Vc>0)0
sigma_scatbarnAlternative: scattering cross section per unit cell (used when Vc>0)0
VcAA^3Unit cell volume; when >0, coefficients are computed from sigma_abs, sigma_scat0
radiusmOuter radius of a cylinder (with yheight) or of a sphere (yheight=0)0
xwidthmWidth of a box sample0
yheightmHeight of a box or cylinder sample0
zdepthmDepth of a box sample0
thicknessmWall thickness of a hollow cylinder (0: filled)0
pack1Packing factor (scales absorption and scattering coefficients)1
p_transmit1Monte Carlo fraction of events kept as unscattered transmitted beam (0: always scatter)0
order1Maximum number of scattering events per neutron (1: single scattering)1
AT ( , , ) RELATIVE
ROTATED ( , , ) RELATIVE

Links

  • Source code for MCViNE_Broadened_E_Q.comp.
  • MCViNE documentation: https://mcvine.github.io

[ Identification | Description | Examples | Input parameters | Links ]

Generated on mcstas 3.9.2


Last Modified: Tuesday, 06-Oct-2026 21:19:12 CEST
Search website mailinglist archive GitHub repos