Mantid
Loading...
Searching...
No Matches
WorkspaceCreationHelper.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/*********************************************************************************
8 * PLEASE READ THIS!!!!!!!
9 *
10 * This header MAY NOT be included in any test from a package below DataObjects
11 * (e.g. Kernel, Geometry, API).
12 * Conversely, this file (and its cpp) MAY NOT be modified to use anything from
13 *a
14 * package higher than DataObjects (e.g. any algorithm), even if via the
15 *factory.
16 *********************************************************************************/
17#pragma once
18
19#include "MantidAPI/Algorithm.h"
23#include "MantidAPI/Run.h"
32
33#include <gmock/gmock.h>
34
35#include <string>
36#include <vector>
37
38namespace Mantid {
39namespace DataObjects {
40class PeaksWorkspace;
41class LeanElasticPeaksWorkspace;
42} // namespace DataObjects
43namespace Kernel {
44class Logger;
45class V3D;
46} // namespace Kernel
47} // namespace Mantid
48
51template <typename T> struct FibSeries {
52private:
53 T x1;
54 T x2;
55public:
56 inline FibSeries() : x1(1), x2(1) {}
57 inline T operator()() {
58 const T out(x1 + x2);
59 x1 = x2;
60 x2 = out;
61 return out;
62 }
63};
66public:
67 StubAlgorithm(size_t nSteps = 100);
69 const std::string name() const override { return "MockAlgorithm"; }
71 int version() const override { return 1; }
73 const std::string category() const override { return "Test"; }
75 const std::string summary() const override { return "Test summary."; }
76
78
80 void resetProgress(size_t nSteps) { m_Progress = std::make_unique<Mantid::API::Progress>(this, 0.0, 1.0, nSteps); }
81
82private:
83 void init() override {}
84 void exec() override {}
85
86 std::unique_ptr<Mantid::API::Progress> m_Progress;
89};
90
94 enum class FitStatus { SUCCESS, FAILURE };
95
97 EPPTableRow() = default;
99 EPPTableRow(const double peakCentre, const double sigma, const double height, const FitStatus fitStatus);
101 EPPTableRow(const int index, const double peakCentre, const double sigma, const double height,
102 const FitStatus fitStatus);
104 double peakCentre = 0;
105 double peakCentreError = 0;
106 double sigma = 0;
107 double sigmaError = 0;
108 double height = 0;
109 double heightError = 0;
110 double chiSq = 0;
112};
113
119template <typename WSType> void storeWS(const std::string &name, WSType &ws) {
120 Mantid::API::AnalysisDataService::Instance().add(name, ws);
121}
123void removeWS(const std::string &name);
125template <typename T> std::shared_ptr<T> getWS(const std::string &name) {
126 return Mantid::API::AnalysisDataService::Instance().retrieveWS<T>(name);
127}
128
131template <typename YType, typename EType>
132Mantid::HistogramData::Histogram createHisto(bool isHistogram, YType &&yAxis, EType &&eAxis);
134Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceConstant(int size, double value, double error, bool isHisto);
137 double xError, bool isHisto = true);
138Mantid::DataObjects::Workspace2D_sptr create2DWorkspace(size_t nhist, size_t numBoundaries);
141create2DWorkspace123(int64_t nHist, int64_t nBins, bool isHist = false,
142 const std::set<int64_t> &maskedWorkspaceIndices = std::set<int64_t>(), bool hasDx = false);
144create2DWorkspace154(int64_t nHist, int64_t nBins, bool isHist = false,
145 const std::set<int64_t> &maskedWorkspaceIndices = std::set<int64_t>(), bool hasDx = false);
147create2DWorkspaceWithValuesAndXerror(int64_t nHist, int64_t nBins, bool isHist, double xVal, double yVal, double eVal,
148 double dxVal,
149 const std::set<int64_t> &maskedWorkspaceIndices = std::set<int64_t>());
151 const std::set<int64_t> &maskedWorkspaceIndices);
155Mantid::API::WorkspaceGroup_sptr createWorkspaceGroup(int nEntries, int nHist, int nBins, const std::string &stem);
159Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceBinned(size_t nhist, size_t numVals, double x0 = 0.0,
160 double deltax = 1.0);
161
166
170Mantid::DataObjects::Workspace2D_sptr create2DWorkspacePoints(size_t nhist, size_t numVals, double x0 = 0.0,
171 double deltax = 1.0);
172
178create2DWorkspaceNonUniformlyBinned(int nhist, const int numBoundaries, const double xBoundaries[], bool hasDx = false);
179
180struct ReturnOne {
181 double operator()(const double, std::size_t) { return 1.0; };
182};
183
196template <typename fT, typename gT = ReturnOne>
198 double dx, bool isHist = false,
199 gT eFunc = ReturnOne()) {
200 int nX = int((x1 - x0) / dx) + 1;
201 int nY = nX - (isHist ? 1 : 0);
202 if (nY <= 0)
203 throw std::invalid_argument("Number of bins <=0. Cannot create an empty workspace");
204
205 auto ws = std::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
206 Mantid::API::WorkspaceFactory::Instance().create("Workspace2D", nSpec, nX, nY));
207
208 for (int iSpec = 0; iSpec < nSpec; iSpec++) {
209 auto &X = ws->mutableX(iSpec);
210 auto &Y = ws->mutableY(iSpec);
211 auto &E = ws->mutableE(iSpec);
212 for (int i = 0; i < nY; i++) {
213 double x = x0 + dx * i;
214 X[i] = x;
215 Y[i] = yFunc(x, iSpec);
216 E[i] = eFunc(x, iSpec);
217 }
218 if (isHist)
219 X.back() = X[nY - 1] + dx;
220 }
221 return ws;
222}
223
225void addNoise(const Mantid::API::MatrixWorkspace_sptr &ws, double noise, const double lower = -0.5,
226 const double upper = 0.5);
227
230create2DWorkspaceWithFullInstrument(int nhist, int nbins, bool includeMonitors = false, bool startYNegative = false,
231 bool isHistogram = true,
232 const std::string &instrumentName = std::string("testInst"), bool hasDx = false);
233
242create2DDetectorScanWorkspaceWithFullInstrument(int nhist, int nbins, size_t nTimeIndexes, size_t startTime = 0,
243 size_t firstInterval = 1, bool includeMonitors = false,
244 bool startYNegative = false, bool isHistogram = true,
245 const std::string &instrumentName = std::string("testInst"));
246
248 const int nlat, const int nlong, const double anginc, int nbins, const double x0 = 0.5, const double deltax = 1.0,
249 const std::string &instrumentName = std::string("testInst"), const std::string &xunit = std::string("Momentum"));
250
257
259create2DWorkspaceWithRectangularInstrument(int numBanks, int numPixels, int numBins,
260 const std::string &instrumentName = "basic_rect");
261
263 int maskedWorkspaceIndex, int maskedBinIndex);
264
268 bool clearEvents = true);
269
273 bool clearEvents = true);
274
288
298
305Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace2(int numPixels = 50, int numBins = 100);
306
308 double x0 = 0.0, double binDelta = 1.0,
309 int eventPattern = 1, int start_at_pixelID = 0);
310
312 int numPixels, int numBins, int numEvents = 100, double x0 = 0.0, double binDelta = 1.0, int eventPattern = 1,
313 int start_at_pixelID = 0,
314 Mantid::Types::Core::DateAndTime run_start = Mantid::Types::Core::DateAndTime("2010-01-01T00:00:00"));
315
316Mantid::DataObjects::EventWorkspace_sptr createGroupedEventWorkspace(std::vector<std::vector<int>> const &groups,
317 int numBins, double binDelta = 1.,
318 double xOffset = 0.);
319
321 double bin_delta = 1.0);
322
323Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2D(size_t numHist, int numBins, double binDelta);
324// grouped workspace with detectors arranges in rings in center and into boxes
325// outside
326Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2DWithRingsAndBoxes(size_t RootOfNumHist = 10, int numBins = 10,
327 double binDelta = 1.0);
328// not strictly creating a workspace, but really helpful to see what one
329// contains
331// not strictly creating a workspace, but really helpful to see what one
332// contains
334// not strictly creating a workspace, but really helpful to see what one
335// contains
337// not strictly creating a workspace, but really helpful to see what one
338// contains
340
341void addTSPEntry(Mantid::API::Run &runInfo, const std::string &name, double val);
342void setOrientedLattice(const Mantid::API::MatrixWorkspace_sptr &ws, double a, double b, double c);
343void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &ws, double phi, double chi, double omega);
344
345// create workspace which should be result of homering (transform to energy in
346// inelastic)
348 size_t numBins = 20,
349 bool has_oriented_lattice = true);
350
351// Create a workspace with all components needed for inelastic analysis;
353 const std::vector<double> &polar,
354 const std::vector<double> &azimutal, size_t numBins = 4,
355 double Emin = -10, double Emax = 10, double Ei = 11);
356
358createEventWorkspace3(const Mantid::DataObjects::EventWorkspace_const_sptr &sourceWS, const std::string &wsname,
360
363
366template <typename T>
367void populateWsWithInitList(T &destination, size_t startingIndex, const std::initializer_list<double> &values);
368
370std::shared_ptr<Mantid::DataObjects::PeaksWorkspace> createPeaksWorkspace(const int numPeaks,
371 const bool createOrientedLattice = false);
374std::shared_ptr<Mantid::DataObjects::PeaksWorkspace> createPeaksWorkspace(const int numPeaks,
375 const Mantid::Kernel::DblMatrix &ubMat);
376
378std::shared_ptr<Mantid::DataObjects::LeanElasticPeaksWorkspace>
379createLeanPeaksWorkspace(const int numPeaks, const bool createOrientedLattice = false);
382std::shared_ptr<Mantid::DataObjects::LeanElasticPeaksWorkspace>
383createLeanPeaksWorkspace(const int numPeaks, const Mantid::Kernel::DblMatrix &ubMat);
384
387std::shared_ptr<Mantid::DataObjects::TableWorkspace>
389// create range of angular detectors positions
390void create2DAngles(std::vector<double> &L2, std::vector<double> &polar, std::vector<double> &azim, size_t nPolar = 10,
391 size_t nAzim = 10, double polStart = 0, double polEnd = 90, double azimStart = -30,
392 double azimEnd = 30);
393
397 const double startX = 0.0, const Mantid::Kernel::V3D &slit1Pos = Mantid::Kernel::V3D(0, 0, 0),
398 const Mantid::Kernel::V3D &slit2Pos = Mantid::Kernel::V3D(0, 0, 1), const double vg1 = 0.5, const double vg2 = 1.0,
399 const Mantid::Kernel::V3D &sourcePos = Mantid::Kernel::V3D(0, 0, 0),
400 const Mantid::Kernel::V3D &monitorPos = Mantid::Kernel::V3D(14, 0, 0),
401 const Mantid::Kernel::V3D &samplePos = Mantid::Kernel::V3D(15, 0, 0),
402 const Mantid::Kernel::V3D &detectorPos = Mantid::Kernel::V3D(20, (20 - 15), 0), const int nBins = 100,
403 const double deltaX = 2000.0);
404
408 const double startX = 0.0, const double detSize = 0.0,
409 const Mantid::Kernel::V3D &slit1Pos = Mantid::Kernel::V3D(0, 0, 0),
410 const Mantid::Kernel::V3D &slit2Pos = Mantid::Kernel::V3D(0, 0, 1), const double vg1 = 0.5, const double vg2 = 1.0,
411 const Mantid::Kernel::V3D &sourcePos = Mantid::Kernel::V3D(0, 0, 0),
412 const Mantid::Kernel::V3D &monitorPos = Mantid::Kernel::V3D(14, 0, 0),
413 const Mantid::Kernel::V3D &samplePos = Mantid::Kernel::V3D(15, 0, 0),
414 const Mantid::Kernel::V3D &detectorCenterPos = Mantid::Kernel::V3D(20, (20 - 15), 0), const int nSpectra = 4,
415 const int nBins = 20, const double deltaX = 5000.0);
416
418 const Mantid::Kernel::V3D &samplePosition,
419 const Mantid::Kernel::V3D &sourcePosition,
420 const std::vector<Mantid::Kernel::V3D> &detectorPositions);
421
423Mantid::API::ITableWorkspace_sptr createEPPTableWorkspace(const std::vector<EPPTableRow> &rows = {});
424
429Mantid::API::MatrixWorkspace_sptr createSNAPLiteInstrument(const std::string &wkspName, const double ang1 = -65.3,
430 const double ang2 = 104.95);
432 const std::string &groupingAlg,
433 const std::string &groupingDescr,
434 const double ang1 = -65.3,
435 const double ang2 = 104.95);
436} // namespace WorkspaceCreationHelper
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
double error
IPeaksWorkspace_sptr workspace
std::map< DeltaEMode::Type, std::string > index
int64_t nSpectra
double lower
lower and upper bounds on the multiplier, if known
double upper
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Helper class for reporting progress from algorithms.
Definition Progress.h:25
This class stores information regarding an experimental run as a series of log entries.
Definition Run.h:35
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Class for 3D vectors.
Definition V3D.h:34
Stub algorithm for doing logging/progress reporting.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
std::unique_ptr< Mantid::API::Progress > m_Progress
const std::string summary() const override
Algorithm's summary.
const std::string name() const override
Algorithm's name for identification.
void init() override
Virtual method - must be overridden by concrete algorithm.
void exec() override
Virtual method - must be overridden by concrete algorithm.
static Mantid::Kernel::Logger & g_log
logger -> to provide logging,
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
static MatrixWorkspace_sptr createWorkspaceSingleValue(const double &rhsValue)
Creates a temporary single value workspace the error is set to zero.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::size_t numEvents(Nexus::File &file, bool &hasTotalCounts, bool &oldNeXusFileNames, const std::string &prefix, const Nexus::NexusDescriptor &descriptor)
Get the number of events in the currently opened group.
std::shared_ptr< WorkspaceSingleValue > WorkspaceSingleValue_sptr
shared pointer to the WorkspaceSingleValue class
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
std::shared_ptr< RebinnedOutput > RebinnedOutput_sptr
shared pointer to the RebinnedOutput class
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
Helper class which provides the Collimation Length for SANS instruments.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWhereYIsWorkspaceIndex(int nhist, int numBoundaries)
Create a Workspace2D where the Y value at each bin is == to the workspace index.
Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceConstant(int size, double value, double error, bool isHisto)
void setOrientedLattice(const Mantid::API::MatrixWorkspace_sptr &ws, double a, double b, double c)
Sets the OrientedLattice in the crystal as an crystal with given lattice lengths, angles of 90 deg.
void createInstrumentForWorkspaceWithDistances(const Mantid::API::MatrixWorkspace_sptr &workspace, const Mantid::Kernel::V3D &samplePosition, const Mantid::Kernel::V3D &sourcePosition, const std::vector< Mantid::Kernel::V3D > &detectorPositions)
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWithGeographicalDetectors(const int nlat, const int nlong, const double anginc, int nbins, const double x0=0.5, const double deltax=1.0, const std::string &instrumentName=std::string("testInst"), const std::string &xunit=std::string("Momentum"))
Create an Workspace2D with an instrument that contains detectors arranged at even latitude/longitude ...
Mantid::API::MatrixWorkspace_sptr create2DWorkspaceWithReflectometryInstrumentMultiDetector(const double startX=0.0, const double detSize=0.0, const Mantid::Kernel::V3D &slit1Pos=Mantid::Kernel::V3D(0, 0, 0), const Mantid::Kernel::V3D &slit2Pos=Mantid::Kernel::V3D(0, 0, 1), const double vg1=0.5, const double vg2=1.0, const Mantid::Kernel::V3D &sourcePos=Mantid::Kernel::V3D(0, 0, 0), const Mantid::Kernel::V3D &monitorPos=Mantid::Kernel::V3D(14, 0, 0), const Mantid::Kernel::V3D &samplePos=Mantid::Kernel::V3D(15, 0, 0), const Mantid::Kernel::V3D &detectorCenterPos=Mantid::Kernel::V3D(20,(20 - 15), 0), const int nSpectra=4, const int nBins=20, const double deltaX=5000.0)
Create a 2D workspace with one monitor and three detectors based around a virtual reflectometry instr...
void displayData(const Mantid::API::MatrixWorkspace_const_sptr &ws)
Mantid::API::MatrixWorkspace_sptr createProcessedInelasticWS(const std::vector< double > &L2, const std::vector< double > &polar, const std::vector< double > &azimutal, size_t numBins=4, double Emin=-10, double Emax=10, double Ei=11)
Create a workspace with all components needed for inelastic analysis and 3 detectors in specific plac...
Mantid::API::ITableWorkspace_sptr createEPPTableWorkspace(const std::vector< EPPTableRow > &rows={})
Create a table workspace corresponding to what the FindEPP algorithm gives.
void displayDataY(const Mantid::API::MatrixWorkspace_const_sptr &ws)
Mantid::DataObjects::WorkspaceSingleValue_sptr createWorkspaceSingleValueWithError(double value, double error)
void create2DAngles(std::vector< double > &L2, std::vector< double > &polar, std::vector< double > &azim, size_t nPolar=10, size_t nAzim=10, double polStart=0, double polEnd=90, double azimStart=-30, double azimEnd=30)
Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceConstantWithXerror(int size, double value, double error, double xError, bool isHisto=true)
Mantid::API::MatrixWorkspace_sptr create2DWorkspaceRagged(int version=0)
Create a 2D ragged workspace.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceBinned(size_t nhist, size_t numVals, double x0=0.0, double deltax=1.0)
Create a 2D workspace with this many histograms and bins.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWithRectangularInstrument(int numBanks, int numPixels, int numBins, const std::string &instrumentName="basic_rect")
Create an Workspace2D with an instrument that contains RectangularDetector's.
void populateWsWithInitList(T &destination, size_t startingIndex, const std::initializer_list< double > &values)
Populates a mutable reference from initializer list starting at user specified index.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceNonUniformlyBinned(int nhist, const int numBoundaries, const double xBoundaries[], bool hasDx=false)
Create a 2D workspace with this many histograms and bins.
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspaceWithFullInstrument(int numBanks, int numPixels, bool clearEvents=true)
Create an Eventworkspace with an instrument that contains RectangularDetector's.
Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceFib(int size, bool isHisto)
std::shared_ptr< Mantid::DataObjects::PeaksWorkspace > createPeaksWorkspace(const int numPeaks, const bool createOrientedLattice=false)
Create a simple peaks workspace containing the given number of peaks.
void addNoise(const Mantid::API::MatrixWorkspace_sptr &ws, double noise, const double lower=-0.5, const double upper=0.5)
Add random noise to a 2D workspace.
Mantid::DataObjects::EventWorkspace_sptr createGroupedEventWorkspace(std::vector< std::vector< int > > const &groups, int numBins, double binDelta=1., double xOffset=0.)
Create event workspace, with several detector IDs in one event list.
void removeWS(const std::string &name)
Deletes a workspace.
void displayDataE(const Mantid::API::MatrixWorkspace_const_sptr &ws)
void storeWS(const std::string &name, WSType &ws)
Adds a workspace to the ADS.
Mantid::HistogramData::Histogram createHisto(bool isHistogram, YType &&yAxis, EType &&eAxis)
Creates and returns point or bin based histograms with the data specified in parameters.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWithValuesAndXerror(int64_t nHist, int64_t nBins, bool isHist, double xVal, double yVal, double eVal, double dxVal, const std::set< int64_t > &maskedWorkspaceIndices=std::set< int64_t >())
Mantid::API::WorkspaceGroup_sptr createWorkspaceGroup(int nEntries, int nHist, int nBins, const std::string &stem)
Create a WorkspaceGroup with N workspaces and the specified parameters.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspace154(int64_t nHist, int64_t nBins, bool isHist=false, const std::set< int64_t > &maskedWorkspaceIndices=std::set< int64_t >(), bool hasDx=false)
std::shared_ptr< Mantid::DataObjects::LeanElasticPeaksWorkspace > createLeanPeaksWorkspace(const int numPeaks, const bool createOrientedLattice=false)
Create a simple lean peaks workspace containing the given number of peaks.
Mantid::DataObjects::EventWorkspace_sptr createRandomEventWorkspace(size_t numbins, size_t numpixels, double bin_delta=1.0)
Create an event workspace with randomized TOF and pulsetimes.
Mantid::API::MatrixWorkspace_sptr create2DWorkspaceWithReflectometryInstrument(const double startX=0.0, const Mantid::Kernel::V3D &slit1Pos=Mantid::Kernel::V3D(0, 0, 0), const Mantid::Kernel::V3D &slit2Pos=Mantid::Kernel::V3D(0, 0, 1), const double vg1=0.5, const double vg2=1.0, const Mantid::Kernel::V3D &sourcePos=Mantid::Kernel::V3D(0, 0, 0), const Mantid::Kernel::V3D &monitorPos=Mantid::Kernel::V3D(14, 0, 0), const Mantid::Kernel::V3D &samplePos=Mantid::Kernel::V3D(15, 0, 0), const Mantid::Kernel::V3D &detectorPos=Mantid::Kernel::V3D(20,(20 - 15), 0), const int nBins=100, const double deltaX=2000.0)
Create a 2D workspace with one detector and one monitor based around a virtual reflectometry instrume...
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspaceWithStartTime(int numPixels, int numBins, int numEvents=100, double x0=0.0, double binDelta=1.0, int eventPattern=1, int start_at_pixelID=0, Mantid::Types::Core::DateAndTime run_start=Mantid::Types::Core::DateAndTime("2010-01-01T00:00:00"))
void addTSPEntry(Mantid::API::Run &runInfo, const std::string &name, double val)
Utility function to add a TimeSeriesProperty with a name and value.
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace()
Create event workspace with: 500 pixels 1000 histogrammed bins.
Mantid::API::MatrixWorkspace_sptr createFocusedSNAPLiteInstrument(const std::string &wkspName, const std::string &groupingAlg, const std::string &groupingDescr, const double ang1=-65.3, const double ang2=104.95)
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceFromFunction(fT yFunc, int nSpec, double x0, double x1, double dx, bool isHist=false, gT eFunc=ReturnOne())
Creates a 2D workspace from taking the function values from the input function.
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace3(const Mantid::DataObjects::EventWorkspace_const_sptr &sourceWS, const std::string &wsname, Mantid::API::Algorithm *alg)
Mantid::API::MatrixWorkspace_sptr create2DDetectorScanWorkspaceWithFullInstrument(int nhist, int nbins, size_t nTimeIndexes, size_t startTime=0, size_t firstInterval=1, bool includeMonitors=false, bool startYNegative=false, bool isHistogram=true, const std::string &instrumentName=std::string("testInst"))
Create a workspace as for create2DWorkspaceWithFullInstrument, but including time indexing,...
std::shared_ptr< T > getWS(const std::string &name)
Returns a workspace of a given type.
Mantid::API::MatrixWorkspace_sptr createSNAPLiteInstrument(const std::string &wkspName, const double ang1=-65.3, const double ang2=104.95)
Create a copy of the SNAP "lite" instrument.
Mantid::API::MatrixWorkspace_sptr createProcessedWorkspaceWithCylComplexInstrument(size_t numPixels=100, size_t numBins=20, bool has_oriented_lattice=true)
Mantid::DataObjects::Workspace2D_sptr create2DWorkspace123(int64_t nHist, int64_t nBins, bool isHist=false, const std::set< int64_t > &maskedWorkspaceIndices=std::set< int64_t >(), bool hasDx=false)
Mantid::DataObjects::Workspace2D_sptr maskSpectra(Mantid::DataObjects::Workspace2D_sptr workspace, const std::set< int64_t > &maskedWorkspaceIndices)
Mantid::DataObjects::RebinnedOutput_sptr createRebinnedOutputWorkspace()
Function to create a fixed RebinnedOutput workspace.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceThetaVsTOF(int nHist, int nBins)
Create a test workspace with a Theta numeric axis instead of a spectrum axis the values run from 1 to...
void displayDataX(const Mantid::API::MatrixWorkspace_const_sptr &ws)
Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceRand(int size, bool isHisto)
Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2DWithRingsAndBoxes(size_t RootOfNumHist=10, int numBins=10, double binDelta=1.0)
Mantid::DataObjects::Workspace2D_sptr create2DWorkspace123WithMaskedBin(int numHist, int numBins, int maskedWorkspaceIndex, int maskedBinIndex)
void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &ws, double phi, double chi, double omega)
Create a default universal goniometer and set its angles.
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspaceWithNonUniformInstrument(int numBanks, bool clearEvents)
Creates an event workspace with instrument which consists of cylindrical detectors.
std::shared_ptr< Mantid::DataObjects::TableWorkspace > buildPreprocessedDetectorsWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws)
Build table workspace with preprocessed detectors for existing workspace with instrument.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWithFullInstrument(int nhist, int nbins, bool includeMonitors=false, bool startYNegative=false, bool isHistogram=true, const std::string &instrumentName=std::string("testInst"), bool hasDx=false)
Create a test workspace with a fully defined instrument.
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspaceWithFullInstrument2(int numBanks, int numPixels, bool clearEvents=true)
Create an Eventworkspace with instrument 2.0 that contains RectangularDetector's.
Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace2(int numPixels=50, int numBins=100)
Create event workspace with: 50 pixels 100 histogrammed bins from 0.0 in steps of 1....
Mantid::DataObjects::Workspace2D_sptr create2DWorkspace(size_t nhist, size_t numBoundaries)
Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2D(size_t numHist, int numBins, double binDelta)
Create Workspace2d, with numHist spectra, each with 9 detectors, with IDs 1-9, 10-18,...
void eventWorkspace_Finalize(const Mantid::DataObjects::EventWorkspace_sptr &ew)
Perform some finalization on event workspace stuff.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspacePoints(size_t nhist, size_t numVals, double x0=0.0, double deltax=1.0)
Create a 2D workspace with this many point-histograms and bins.
A struct containing the cells of an EPP table row.
EPPTableRow()=default
Construct a row with the default values.
FitStatus
FindEPP algorithm fitting success status.
double operator()(const double, std::size_t)