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