Skip to content
Snippets Groups Projects
  • Martyn Gigg's avatar
    b573d4dd
    Replace boost::random with std::random · b573d4dd
    Martyn Gigg authored
    This includes dragging the libcxx implementation of normal_distribution
    and uniform_int_distribution into our source. MSVC, clang and gcc don't
    agree on how this should be implemented leading to problems with
    comparing test results across platforms. Using a single implementation
    gives the same results on each platform.
    b573d4dd
    History
    Replace boost::random with std::random
    Martyn Gigg authored
    This includes dragging the libcxx implementation of normal_distribution
    and uniform_int_distribution into our source. MSVC, clang and gcc don't
    agree on how this should be implemented leading to problems with
    comparing test results across platforms. Using a single implementation
    gives the same results on each platform.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
CalculateCountRate-v1.rst 3.63 KiB

Description

The algorithm works with event workspaces produced by instruments operating in event mode and calculates the rate at which an instrument counts neutrons as function of the experiment time. Then it adds the time series log containing this rate, with the name, defined by CountRateLogName property to the source workspace.

Additionally it can also calculate 2D matrix workspace, which contains count rate as function of experiment time and neutrons time of flight or energy or other neutron property related to the time of flight in the range XMin-XMax in the units defined by RangeUnits property.

In normal circumstances the instrument count rate does not change. Unfortunately, Data Acquisition Electronics sometimes randomly generates spurious signals, appearing randomly at some moments of the experiment time. Such signals distort real physical image, obtained in experiment and should be removed.

The picture below gives example of counting rate log, calculated by the algorithm together with image of the visualization workspace, which shows the spurious signal as function of experiment time and neutron energy.

/images/SpurionReal.png

The calculated log above can be used as input for :ref:`algm-FilterByLogValue` algorithm to filter events recorded around 200sec of experiment time to remove spurious signal at 2.9mEv.

The algorithm can also be used to evaluate changes of sample reflectivity as function of some slow changing experiment's parameter e.g. temperature, magnetic field or pressure.

NOTE: Normally one wants to divide the count rate by a value, proportional to incident neutron flux to avoid count rate dependency from changing incident beam intensity. Usually algorithm just divides the neutron counts by proton_charge log values, normally recorded per frame basis. If this log is not available, other logs can be used to estimate incident beam intensity. Visualization workspace is usually calculated with much more coarse time step than the count_rate log, so the normalization used in visualization workspace is just the sum of all values of the log used for normalization falling within the visualization time step.

Usage

Example - Calculate Count Rate