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_LorentzianBroadened_E_Q_process

[ Identification | Description | Input parameters | Links ]

The MCViNE_LorentzianBroadened_E_Q_process Component

Union process: Isotropic dispersion E(Q) broadened by a Lorentzian of Q-dependent width.

Identification

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

Description

S(Q,E) = S(Q) L(E - E(Q); gamma(Q)) with L a Lorentzian of half width at half
maximum gamma(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.

Union process. Part of the Union components: define this process, collect it
into a material with Union_make_material (absorption is set there with
my_absorption, the absorption inverse penetration depth at 2200 m/s), assign
the material to Union_box/Union_cylinder/Union_sphere/Union_mesh geometries,
and add a Union_master after them. Geometry, attenuation and multiple
scattering are handled by Union_master; this component provides the MCViNE
kernel: the scattering coefficient and the final-state sampling (weight).
Isotropic process (powder/liquid-like); rotation is irrelevant.
The kernel code is shared with the standalone component MCViNE_LorentzianBroadened_E_Q (mcvine-lib.c).
Uses share/mcvine-lib.h/.c and share/mcvine-union-lib.h/.c; the process type
MCViNE is declared in share/union-lib.h and registered with Union_master in
share/mcvine-union-lib.h.

Example: MCViNE_LorentzianBroadened_E_Q_process(E_Q="20*sin(Q*1.5)^2", S_Q="1", gamma_Q="0.5", Qmin=0, Qmax=10, scattering_coefficient=10)

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"
gamma_QstrLorentzian HWHM gamma(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
scattering_coefficientm^-1Scattering coefficient (inverse penetration depth for scattering)0
sigma_scatbarnAlternative: scattering cross section per unit cell (used when Vc>0)0
VcAA^3Unit cell volume; when >0 the coefficient is sigma_scat/Vc0
packing_factor1Packing factor (scales the scattering coefficient)1
interact_fraction1Union: fraction of interactions forced to this process (-1: by cross section)-1
initstringDeprecated and unused, accepted like on the other Union components (see Union_init).""
AT ( , , ) RELATIVE
ROTATED ( , , ) RELATIVE

Links

  • Source code for MCViNE_LorentzianBroadened_E_Q_process.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