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: NCrystal_filter

[ Identification | Description | Input parameters | Links ]

The NCrystal_filter Component

Filter or window (box or cylinder) of a material from NCrystal, which only attenuates the beam. Simple, fast and GPU friendly.

Identification

  • Author: Thomas Kittelmann
  • Origin: ESS
  • Date: 2026

Description

A filter or window of an isotropic material, which attenuates the beam
according to the total cross section (scattering plus absorption) of the
material, as provided by the NCrystal library. Neutrons are not scattered:
the weight of a neutron travelling a distance L through the material is
multiplied by exp(-sigma*L), where sigma is the macroscopic cross section
at its wavelength. This is suitable for e.g. Be filters or Al windows, where
the scattered neutrons are not of interest. For the full NCrystal physics,
use NCrystal_sample or the Union components instead.

The cross sections are tabulated during initialisation, so the component can
also be used on GPUs. The table is provided by NCrystal itself, unless the C
API function ncrystal_filtertable is not available, in which case the
component will create the table itself as a fallback workaround.

The material is given by an NCrystal cfg-string, e.g.
"stdlib::Be_sg194.ncmat;temp=80K" for a cooled Be filter, or "mycrystal.ncmat"
for a local file. Oriented materials such as single crystals are not
supported, but a fast sapphire filter can be emulated with an assumption that
no reflections satisfy the Bragg condition:
"stdlib::Al2O3_sg167_Corundum.ncmat;bragg=0;temp=200K". Multiphase materials
are also supported:
"phases<0.98*stdlib::Al_sg225.ncmat&0.01*stdlib::Fe_sg229_Iron-alpha.ncmat&0.01*stdlib::Si_sg227.ncmat>;temp=180K".

The geometry is a box (xwidth, yheight, zdepth) or a cylinder (radius,
yheight) along the y axis.

Input parameters

Parameters in boldface are required; the others are optional.
NameUnitDescriptionDefault
cfgstrNCrystal material configuration string (details on this page)."void"
xwidthmx-dimension (width) of the filter, for a box0
yheightmy-dimension (height) of the filter, for a box or cylinder0
zdepthmz-dimension (depth) of the filter, for a box0
radiusmradius of the filter, for a cylinder0
AT ( , , ) RELATIVE
ROTATED ( , , ) RELATIVE

Links


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

Generated on mcstas 3.9.2


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