Component Manual for the Xray-Tracing Package McXtrace, version 3.8.6

3  Source components

McXtrace contains a number of different source components, and any simulation will usually contain exactly one of these sources. The main function of a source is to determine a set of initial parameters \((\mathbf {r}, \mathbf {k}, t)\) for each photon ray. This is done by Monte Carlo choices from suitable distributions. For example, in most present sources the initial position is found from a uniform distribution over the source surface. The initial photon wavenumber is selected within an interval of either the corresponding energy or the corresponding wavelength.

For pulsed sources, the choice of the emission time, \(t\), is being made on basis of detailed analytical expressions. For other sources, \(t\) is set to zero. In the case one would like to use a steady state source with time-of-flight settings, the emission time of each photon ray should be determined using a Monte Carlo choice. This may be achieved by the EXTEND keyword in the instrument description source as in the example below:

  TRACE

  COMPONENT MySource=Source_pt(...) AT (...)
  EXTEND
  %{
    t = 1e-3*randpm1(); /* set time to +/- 1 ms */
  %}

Also take a look at the Chopper_simple component.

3.0.1 Photon flux and Brilliance
3.1 The Source_pt McXtrace Component
Identification
Description
Input parameters
Links
A mathematical point emitting photons with a spectrum either uniform, gaussian or generated from a datafile
3.2 The Source_flat McXtrace Component
Identification
Description
Input parameters
Links
A flat surface emitting photons with a spectrum either uniform, gaussian or generated from a datafile
3.3 The Source_div McXtrace Component
Identification
Description
Input parameters
Links
A continuous source with specified divergence
3.4 The Source_gaussian McXtrace Component
Identification
Description
Input parameters
Links
the model has a gaussian distribution of intensity
3.5 The Source_lab McXtrace Component
Identification
Description
Input parameters
Links
X-ray tube laboratory source
3.6 Other sources components: virtual sources (event files)

3.0.1  Photon flux and Brilliance

The flux of the sources deserves special attention. The total intensity is defined as the sum of weights of all emitted x-rays during one simulation (the unit of total photon weight is thus photons per second). The flux, \(\psi \), at an instrument is defined as intensity per area perpendicular to the beam direction.

The source Brilliance, \(\Phi \), is defined in different units (See e.g. [ANM11]): the number of photon rays emitted per second from a \(1\) \(\mathrm {m}^{2}\mathrm {m}\) area on the source surface, with direction within a 1 \(\mathrm {m}^{2}\mathrm {rad}\) angle window, and with wavelength within a 1% interval. The total intensity of real photons emitted towards a given diaphragm (units: ph./s) is therefore (for constant \(\Phi \)): \begin {equation} I_\mathrm {total} = \Phi A \Delta \Omega \Delta \lambda , \end {equation} where \(A\) is the source area, \(\Delta \Omega \) is the solid angle of the diaphragm as seen from the source surface, and \(\Delta \lambda \) is the width of the wavelength interval in which photons are emitted (assuming a uniform wavelength spectrum).

The simulations are performed so that detector intensities are independent of the number of photon histories simulated (although more photon histories will give better statistics). If \(N_\mathrm {sim}\) denotes the number of x-ray histories to simulate, the initial photon weight \(p_0\) must be set to \begin {equation} \label {proprule} p_0 = \frac {N_\mathrm {total}}{N_\mathrm {sim}} = \frac {\Phi (\lambda )}{N_\mathrm {sim}} A \Omega \Delta \lambda , \end {equation} where the source brilliance is now given a \(\lambda \)-dependence.

As a start, we recommend new McXtrace users to use the Source_flat component. For a slightly more realistic sources are supply Source_flat with a spectrum file (for instance generated by SPECTRA [TK01]) or Source_gaussian.

Optimizers can dramatically improve the statistics, but may occasionally give wrong results, due to misleaded optimization. You should always check such simulations with (shorter) non-optimized ones.

Other ways to speed-up simulations are to read events from a file. See section 3.6 for details.


PIC


Figure 3.1.: A circular source component (at z=0) emitting photon rays randomly, either from a model, or from a data file.