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;
41}
42namespace Kernel {
43class Logger;
44class V3D;
45} // namespace Kernel
46} // namespace Mantid
47
50template <typename T> struct FibSeries {
51private:
52 T x1;
53 T x2;
54public:
55 inline FibSeries() : x1(1), x2(1) {}
56 inline T operator()() {
57 const T out(x1 + x2);
58 x1 = x2;
59 x2 = out;
60 return out;
61 }
62};
65public:
66 StubAlgorithm(size_t nSteps = 100);
68 const std::string name() const override { return "MockAlgorithm"; }
70 int version() const override { return 1; }
72 const std::string category() const override { return "Test"; }
74 const std::string summary() const override { return "Test summary."; }
75
77
79 void resetProgress(size_t nSteps) { m_Progress = std::make_unique<Mantid::API::Progress>(this, 0.0, 1.0, nSteps); }
80
81private:
82 void init() override {}
83 void exec() override {}
84
85 std::unique_ptr<Mantid::API::Progress> m_Progress;
88};
89
93 enum class FitStatus { SUCCESS, FAILURE };
94
96 EPPTableRow() = default;
98 EPPTableRow(const double peakCentre, const double sigma, const double height, const FitStatus fitStatus);
100 EPPTableRow(const int index, const double peakCentre, const double sigma, const double height,
101 const FitStatus fitStatus);
103 double peakCentre = 0;
104 double peakCentreError = 0;
105 double sigma = 0;
106 double sigmaError = 0;
107 double height = 0;
108 double heightError = 0;
109 double chiSq = 0;
111};
112
118template <typename WSType> void storeWS(const std::string &name, WSType &ws) {
120}
122void removeWS(const std::string &name);
124template <typename T> std::shared_ptr<T> getWS(const std::string &name) {
125 return Mantid::API::AnalysisDataService::Instance().retrieveWS<T>(name);
126}
127
130template <typename YType, typename EType>
131Mantid::HistogramData::Histogram createHisto(bool isHistogram, YType &&yAxis, EType &&eAxis);
133Mantid::DataObjects::Workspace2D_sptr create1DWorkspaceConstant(int size, double value, double error, bool isHisto);
136 double xError, bool isHisto = true);
137Mantid::DataObjects::Workspace2D_sptr create2DWorkspace(size_t nhist, size_t numBoundaries);
140create2DWorkspace123(int64_t nHist, int64_t nBins, bool isHist = false,
141 const std::set<int64_t> &maskedWorkspaceIndices = std::set<int64_t>(), bool hasDx = false);
143create2DWorkspace154(int64_t nHist, int64_t nBins, bool isHist = false,
144 const std::set<int64_t> &maskedWorkspaceIndices = std::set<int64_t>(), bool hasDx = false);
146create2DWorkspaceWithValuesAndXerror(int64_t nHist, int64_t nBins, bool isHist, double xVal, double yVal, double eVal,
147 double dxVal,
148 const std::set<int64_t> &maskedWorkspaceIndices = std::set<int64_t>());
150 const std::set<int64_t> &maskedWorkspaceIndices);
154Mantid::API::WorkspaceGroup_sptr createWorkspaceGroup(int nEntries, int nHist, int nBins, const std::string &stem);
158Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceBinned(size_t nhist, size_t numVals, double x0 = 0.0,
159 double deltax = 1.0);
160
164Mantid::DataObjects::Workspace2D_sptr create2DWorkspacePoints(size_t nhist, size_t numVals, double x0 = 0.0,
165 double deltax = 1.0);
166
172create2DWorkspaceNonUniformlyBinned(int nhist, const int numBoundaries, const double xBoundaries[], bool hasDx = false);
173
174struct ReturnOne {
175 double operator()(const double, std::size_t) { return 1.0; };
176};
177
190template <typename fT, typename gT = ReturnOne>
192 double dx, bool isHist = false,
193 gT eFunc = ReturnOne()) {
194 int nX = int((x1 - x0) / dx) + 1;
195 int nY = nX - (isHist ? 1 : 0);
196 if (nY <= 0)
197 throw std::invalid_argument("Number of bins <=0. Cannot create an empty workspace");
198
199 auto ws = std::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D>(
200 Mantid::API::WorkspaceFactory::Instance().create("Workspace2D", nSpec, nX, nY));
201
202 for (int iSpec = 0; iSpec < nSpec; iSpec++) {
203 auto &X = ws->mutableX(iSpec);
204 auto &Y = ws->mutableY(iSpec);
205 auto &E = ws->mutableE(iSpec);
206 for (int i = 0; i < nY; i++) {
207 double x = x0 + dx * i;
208 X[i] = x;
209 Y[i] = yFunc(x, iSpec);
210 E[i] = eFunc(x, iSpec);
211 }
212 if (isHist)
213 X.back() = X[nY - 1] + dx;
214 }
215 return ws;
216}
217
219void addNoise(const Mantid::API::MatrixWorkspace_sptr &ws, double noise, const double lower = -0.5,
220 const double upper = 0.5);
221
224create2DWorkspaceWithFullInstrument(int nhist, int nbins, bool includeMonitors = false, bool startYNegative = false,
225 bool isHistogram = true,
226 const std::string &instrumentName = std::string("testInst"), bool hasDx = false);
227
236create2DDetectorScanWorkspaceWithFullInstrument(int nhist, int nbins, size_t nTimeIndexes, size_t startTime = 0,
237 size_t firstInterval = 1, bool includeMonitors = false,
238 bool startYNegative = false, bool isHistogram = true,
239 const std::string &instrumentName = std::string("testInst"));
240
242 const int nlat, const int nlong, const double anginc, int nbins, const double x0 = 0.5, const double deltax = 1.0,
243 const std::string &instrumentName = std::string("testInst"), const std::string &xunit = std::string("Momentum"));
244
251
253 int numBins);
255 int maskedWorkspaceIndex, int maskedBinIndex);
256
260 bool clearEvents = true);
261
265 bool clearEvents = true);
266
280
290
297Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace2(int numPixels = 50, int numBins = 100);
298
300 double x0 = 0.0, double binDelta = 1.0,
301 int eventPattern = 1, int start_at_pixelID = 0);
302
304 int numPixels, int numBins, int numEvents = 100, double x0 = 0.0, double binDelta = 1.0, int eventPattern = 1,
305 int start_at_pixelID = 0,
306 Mantid::Types::Core::DateAndTime run_start = Mantid::Types::Core::DateAndTime("2010-01-01T00:00:00"));
307
308Mantid::DataObjects::EventWorkspace_sptr createGroupedEventWorkspace(std::vector<std::vector<int>> groups, int numBins,
309 double binDelta = 1., double xOffset = 0.);
310
312 double bin_delta = 1.0);
313
314Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2D(size_t numHist, int numBins, double binDelta);
315// grouped workspace with detectors arranges in rings in center and into boxes
316// outside
317Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2DWithRingsAndBoxes(size_t RootOfNumHist = 10, int numBins = 10,
318 double binDelta = 1.0);
319// not strictly creating a workspace, but really helpful to see what one
320// contains
322// not strictly creating a workspace, but really helpful to see what one
323// contains
325// not strictly creating a workspace, but really helpful to see what one
326// contains
328// not strictly creating a workspace, but really helpful to see what one
329// contains
331
332void addTSPEntry(Mantid::API::Run &runInfo, const std::string &name, double val);
333void setOrientedLattice(const Mantid::API::MatrixWorkspace_sptr &ws, double a, double b, double c);
334void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &ws, double phi, double chi, double omega);
335
336// create workspace which should be result of homering (transform to energy in
337// inelastic)
339 size_t numBins = 20,
340 bool has_oriented_lattice = true);
341
342// Create a workspace with all components needed for inelastic analysis;
344 const std::vector<double> &polar,
345 const std::vector<double> &azimutal, size_t numBins = 4,
346 double Emin = -10, double Emax = 10, double Ei = 11);
347
349createEventWorkspace3(const Mantid::DataObjects::EventWorkspace_const_sptr &sourceWS, const std::string &wsname,
351
354
357template <typename T>
358void populateWsWithInitList(T &destination, size_t startingIndex, const std::initializer_list<double> &values);
359
361std::shared_ptr<Mantid::DataObjects::PeaksWorkspace> createPeaksWorkspace(const int numPeaks,
362 const bool createOrientedLattice = false);
365std::shared_ptr<Mantid::DataObjects::PeaksWorkspace> createPeaksWorkspace(const int numPeaks,
366 const Mantid::Kernel::DblMatrix &ubMat);
369std::shared_ptr<Mantid::DataObjects::TableWorkspace>
371// create range of angular detectors positions
372void create2DAngles(std::vector<double> &L2, std::vector<double> &polar, std::vector<double> &azim, size_t nPolar = 10,
373 size_t nAzim = 10, double polStart = 0, double polEnd = 90, double azimStart = -30,
374 double azimEnd = 30);
375
379 const double startX = 0.0, const Mantid::Kernel::V3D &slit1Pos = Mantid::Kernel::V3D(0, 0, 0),
380 const Mantid::Kernel::V3D &slit2Pos = Mantid::Kernel::V3D(0, 0, 1), const double vg1 = 0.5, const double vg2 = 1.0,
381 const Mantid::Kernel::V3D &sourcePos = Mantid::Kernel::V3D(0, 0, 0),
382 const Mantid::Kernel::V3D &monitorPos = Mantid::Kernel::V3D(14, 0, 0),
383 const Mantid::Kernel::V3D &samplePos = Mantid::Kernel::V3D(15, 0, 0),
384 const Mantid::Kernel::V3D &detectorPos = Mantid::Kernel::V3D(20, (20 - 15), 0), const int nBins = 100,
385 const double deltaX = 2000.0);
386
390 const double startX = 0.0, const double detSize = 0.0,
391 const Mantid::Kernel::V3D &slit1Pos = Mantid::Kernel::V3D(0, 0, 0),
392 const Mantid::Kernel::V3D &slit2Pos = Mantid::Kernel::V3D(0, 0, 1), const double vg1 = 0.5, const double vg2 = 1.0,
393 const Mantid::Kernel::V3D &sourcePos = Mantid::Kernel::V3D(0, 0, 0),
394 const Mantid::Kernel::V3D &monitorPos = Mantid::Kernel::V3D(14, 0, 0),
395 const Mantid::Kernel::V3D &samplePos = Mantid::Kernel::V3D(15, 0, 0),
396 const Mantid::Kernel::V3D &detectorCenterPos = Mantid::Kernel::V3D(20, (20 - 15), 0), const int nSpectra = 4,
397 const int nBins = 20, const double deltaX = 5000.0);
398
400 const Mantid::Kernel::V3D &samplePosition,
401 const Mantid::Kernel::V3D &sourcePosition,
402 const std::vector<Mantid::Kernel::V3D> &detectorPositions);
403
405Mantid::API::ITableWorkspace_sptr createEPPTableWorkspace(const std::vector<EPPTableRow> &rows);
406
407} // namespace WorkspaceCreationHelper
double value
The value of the point.
Definition: FitMW.cpp:51
double error
Definition: IndexPeaks.cpp:133
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
int 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:85
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:38
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
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 NexusHDF5Descriptor &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.
Mantid::DataObjects::Workspace2D_sptr create2DWorkspaceWithRectangularInstrument(int numBanks, int numPixels, int numBins)
Create an Workspace2D with an instrument that contains RectangularDetector's.
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...
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::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.
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 the signalcreate2DWorkspaceWithFullInstrument.
Mantid::API::ITableWorkspace_sptr createEPPTableWorkspace(const std::vector< EPPTableRow > &rows)
Create a table workspace corresponding to what the FindEPP algorithm gives.
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)
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::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 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 createGroupedEventWorkspace(std::vector< std::vector< int > > groups, int numBins, double binDelta=1., double xOffset=0.)
Create event workspace, with several detector IDs in one event list.
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)