Mantid
Loading...
Searching...
No Matches
ReflectometryHelper.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
11
12#include <string>
13#include <vector>
14
15namespace Mantid {
16
17using namespace API;
18
19namespace FrameworkTestHelpers {
20
21// Create a workspace equipped with fake instrument from
22// unit_testing/REFL_Definition.xml IDF.
23// @param nBins :: Number of bins in each spectrum.
24// @param startX :: Start value of the x-axis in TOF
25// @param endX :: End value of the x-axis in TOF
26// @param values :: Y-values. The created workspace will have as many spectra as
27// there are values -
28// one value per spectrum.
29// @param paramsType :: Defines which instrument parameters file to load.
30// paramsType is appended to
31// "REFL_Parameters_" to form the name for the file to load.
32MatrixWorkspace_sptr createREFL_WS(size_t nBins, double startX, double endX, std::vector<double> const &values,
33 std::string const &paramsType = "", std::string const &instrumentSuffix = "");
34
35// Create a group of workspaces created with createREFL_WS(...) function and
36// store it in the ADS.
37// Ys get some hard-coded values.
38// @param name :: Group's name in the ADS.
39// @param size :: Size of the group.
40void prepareInputGroup(std::string const &name, std::string const &paramsType = "", size_t size = 4,
41 double const startX = 5000.0, double const endX = 100000.0, size_t const nBins = 10);
42
43// Retrieve wprkspace group with name name, cast its items to MatrixWorkspace
44// and return a vector of those.
45std::vector<MatrixWorkspace_sptr> retrieveOutWS(std::string const &name);
46
47// Apply some polarization efficiencies (Fredrikze) to a workspace such that
48// when it's run
49// through the polarization correction algorithm it gets restored to the
50// original.
51void applyPolarizationEfficiencies(std::string const &name);
52
53MatrixWorkspace_sptr createWorkspaceSingle(const double startX, const int nBins, const double deltaX,
54 const std::vector<double> &yValues);
55
56MatrixWorkspace_sptr createWorkspaceSingle(const double startX = 1, const int nBins = 3, const double deltaX = 1);
57} // namespace FrameworkTestHelpers
58} // namespace Mantid
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void prepareInputGroup(std::string const &name, std::string const &paramsType="", size_t size=4, double const startX=5000.0, double const endX=100000.0, size_t const nBins=10)
MatrixWorkspace_sptr createWorkspaceSingle(const double startX, const int nBins, const double deltaX, const std::vector< double > &yValues)
MatrixWorkspace_sptr createREFL_WS(size_t nBins, double startX, double endX, std::vector< double > const &values, std::string const &paramsType="", std::string const &instrumentSuffix="")
void applyPolarizationEfficiencies(std::string const &name)
std::vector< MatrixWorkspace_sptr > retrieveOutWS(std::string const &name)
Helper class which provides the Collimation Length for SANS instruments.