# Optimizations

## Optimum Counting Time Distributions for Asymmetry/Flipping Ratios Measurements

Here is the list of functions used to optimize the asymmetry and flipping ratios measurements that are provided by the "Neutron Scattering" XOP. In the equations presented below, Cte is defined by:

#### OptCountingTimeTpp(Rpp, Rbp, Rpm, Rbm, T)

The OptCountingTimeTpp function returns the optimum counting time for the Bragg peak position and the [+] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This optimum counting time is defined by:

#### OptCountingTimeTppSDev(Rpp, Rbp, Rpm, Rbm, T, RppSDev, RbpSDev, RpmSDev, RbmSDev)

The OptCountingTimeTppSDev function returns the standard deviation of the optimum counting time for the Bragg peak position and the [+] polarisation state to measure an asymmetry or  flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This standard deviation is defined by:

#### OptCountingTimeTbp(Rpp, Rbp, Rpm, Rbm, T)

The OptCountingTimeTbp function returns the optimum counting time for the background and the [+] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This optimum counting time is defined by:

#### OptCountingTimeTbpSDev(Rpp, Rbp, Rpm, Rbm, T, RppSDev, RbpSDev, RpmSDev, RbmSDev)

The OptCountingTimeTbpSDev function returns the standard deviation of the optimum counting time for the background and the [+] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This standard deviation is defined by:

#### OptCountingTimeTpm(Rpp, Rbp, Rpm, Rbm, T)

The OptCountingTimeTpm function returns the optimum counting time for the Bragg peak position and the [-] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This optimum counting time is defined by:

#### OptCountingTimeTpmSDev(Rpp, Rbp, Rpm, Rbm, T, RppSDev, RbpSDev, RpmSDev, RbmSDev)

The OptCountingTimeTpmSDev function returns the standard deviation of the optimum counting time for the Bragg peak position and the [-] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This standard deviation is defined by:

#### OptCountingTimeTbm(Rpp, Rbp, Rpm, Rbm, T)

The OptCountingTimeTbm function returns the optimum counting time for the background and the [-] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This optimum counting time is defined by:

#### OptCountingTimeTbmSDev(Rpp, Rbp, Rpm, Rbm, T, RppSDev, RbpSDev, RpmSDev, RbmSDev)

The OptCountingTimeTbmSDev function returns the standard deviation of the optimum counting time for the background and the [-] polarisation state to measure an asymmetry or flipping ratio from the count rates Rpp, Rbp, Rpm and Rbm during the total time T. Rpp and Rbp are the peak and background count rates for the [+] polarisation state. Rpm and Rbm are the peak and background count rates for the [-] polarisation state. This standard deviation is defined by: