\(\renewcommand\AA{\unicode{x212B}}\)

VesuvioCalculateMS v1

../_images/VesuvioCalculateMS-v1_dlg.png

VesuvioCalculateMS dialog.

Summary

Calculates the contributions of multiple scattering on a flat plate sample for VESUVIO

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory Input workspace to be corrected, in units of TOF.
NoOfMasses Input number Mandatory The number of masses contained within the sample
SampleDensity Input number Mandatory The density of the sample in gm/cm^3
AtomicProperties Input dbl list Mandatory Atomic properties of masses within the sample. The expected format is 3 consecutive values per mass: mass(amu), cross-section (barns) & s.d of Compton profile.
BeamRadius Input number Mandatory Radius, in cm, of beam
Seed Input number 123456789 Seed the random number generator with this value
NumScatters Input number 3 Number of scattering orders to calculate
NumRuns Input number 10 Number of simulated runs per spectrum
NumEventsPerRun Input number 50000 Number of events per run
TotalScatteringWS Output MatrixWorkspace Mandatory Workspace to store the calculated total scattering counts
MultipleScatteringWS Output MatrixWorkspace Mandatory Workspace to store the calculated multiple scattering counts summed for all orders

Description

Calculates the multiple scattering contribution for deep inelastic neutron scattering on the Vesuvio instrument at ISIS. The algorithm follows the procedures defined by J. Mayers et al. [1].

Usage

runs = "" # fill in run numbers here
ip_file = "" # fill in IP file here
data = LoadVesuvio(Filename=, SpectrumList=spectra,
                   Mode="SingleDifference", InstrumentParFile=ip_file)
# Cut it down to the typical range
data = CropWorkspace(raw_ws,XMin=50.0,XMax=562.0)
# Coarser binning
data = Rebin(raw_ws, Params=[49.5, 1.0, 562.5])

# Create sample shape
height = 0.1 # y-dir (m)
width = 0.1 # x-dir (m)
thick = 0.005 # z-dir (m)

half_height, half_width, half_thick = 0.5*height, 0.5*width, 0.5*thick
xml_str = \
   " <cuboid id=\"sample-shape\"> " \
    + "<left-front-bottom-point x=\"%f\" y=\"%f\" z=\"%f\" /> " % (half_width,-half_height,half_thick) \
    + "<left-front-top-point x=\"%f\" y=\"%f\" z=\"%f\" /> " % (half_width, half_height, half_thick) \
    + "<left-back-bottom-point x=\"%f\" y=\"%f\" z=\"%f\" /> " % (half_width, -half_height, -half_thick) \
    + "<right-front-bottom-point x=\"%f\" y=\"%f\" z=\"%f\" /> " % (-half_width, -half_height, half_thick) \
    + "</cuboid>"
CreateSampleShape(data, xml_str)
atom_props = [1.007900, 0.9272392, 5.003738,
              16.00000, 3.2587662E-02, 13.92299,
              27.50000, 4.0172841E-02, 15.07701]
tot_scatter, ms_scatter = \
    VesuvioCalculateMS(data, NoOfMasses=3, SampleDensity=241, AtomicProperties=atom_props,
                       BeamRadius=2.5)

Source

C++ header: VesuvioCalculateMS.h (last modified: 2021-03-31)

C++ source: VesuvioCalculateMS.cpp (last modified: 2021-03-31)