Newer
Older
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
#ifndef MANTID_TESTHELPERS_REFLECTOMETRYHELPER_H_
#define MANTID_TESTHELPERS_REFLECTOMETRYHELPER_H_
#include "MantidAPI/MatrixWorkspace_fwd.h"
#include "MantidAPI/WorkspaceGroup_fwd.h"
#include <vector>
namespace Mantid {
using namespace API;
namespace TestHelpers {
// Create a workspace equipped with fake instrument from IDFs_for_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 = "");
// 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);
// 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);
} // namespace TestHelpers
} // namespace Mantid
#endif // MANTID_TESTHELPERS_REFLECTOMETRYHELPER_H_