Mantid
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
WorkspaceCreationHelper.h File Reference
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/ITableWorkspace_fwd.h"
#include "MantidAPI/MatrixWorkspace_fwd.h"
#include "MantidAPI/Run.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidAPI/WorkspaceGroup_fwd.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/RebinnedOutput.h"
#include "MantidDataObjects/TableWorkspace.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidDataObjects/WorkspaceSingleValue.h"
#include "MantidGeometry/Instrument/Detector.h"
#include <gmock/gmock.h>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  WorkspaceCreationHelper::EPPTableRow
 A struct containing the cells of an EPP table row. More...
 
struct  WorkspaceCreationHelper::FibSeries< T >
 Create a Fibonacci series. More...
 
struct  WorkspaceCreationHelper::ReturnOne
 
class  WorkspaceCreationHelper::StubAlgorithm
 Stub algorithm for doing logging/progress reporting. More...
 

Namespaces

namespace  Mantid
 Helper class which provides the Collimation Length for SANS instruments.
 
namespace  Mantid::DataObjects
 
namespace  Mantid::Kernel
 
namespace  WorkspaceCreationHelper
 

Functions

void WorkspaceCreationHelper::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. More...
 
void WorkspaceCreationHelper::addTSPEntry (Run &runInfo, const std::string &name, double val)
 Utility function to add a TimeSeriesProperty with a name and value. More...
 
std::shared_ptr< Mantid::DataObjects::TableWorkspaceWorkspaceCreationHelper::buildPreprocessedDetectorsWorkspace (const Mantid::API::MatrixWorkspace_sptr &ws)
 Build table workspace with preprocessed detectors for existing workspace with instrument. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create1DWorkspaceConstant (int size, double value, double error, bool isHisto)
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create1DWorkspaceConstantWithXerror (int size, double value, double error, double xError, bool isHisto=true)
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create1DWorkspaceFib (int size, bool isHisto)
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create1DWorkspaceRand (int size, bool isHisto)
 
void WorkspaceCreationHelper::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::API::MatrixWorkspace_sptr WorkspaceCreationHelper::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, i.e. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create2DWorkspace (size_t nhist, size_t numBoundaries)
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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 WorkspaceCreationHelper::create2DWorkspace123WithMaskedBin (int numHist, int numBins, int maskedWorkspaceIndex, int maskedBinIndex)
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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::Workspace2D_sptr WorkspaceCreationHelper::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. More...
 
template<typename fT , typename gT = ReturnOne>
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create2DWorkspaceNonUniformlyBinned (int nhist, const int numBoundaries, const double xBoundaries[], bool hasDx=false)
 Create a 2D workspace with this many histograms and bins. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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 nhist Data filled with: Y: 2.0, E: sqrt(2.0), X: nbins of width 1 starting at 0. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create2DWorkspaceWhereYIsWorkspaceIndex (int nhist, int numBoundaries)
 Create a Workspace2D where the Y value at each bin is == to the workspace index. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create2DWorkspaceWithGeographicalDetectors (const int nlat, const int nlong, const double anginc, const int nbins, const double x0, const double deltax, const std::string &instrumentName, const std::string &xunit)
 Create an Workspace2D with an instrument that contains detectors arranged at even latitude/longitude values. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::create2DWorkspaceWithRectangularInstrument (int numBanks, int numPixels, int numBins)
 Create an Workspace2D with an instrument that contains RectangularDetector's. More...
 
Mantid::API::MatrixWorkspace_sptr WorkspaceCreationHelper::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 instrument. More...
 
Mantid::API::MatrixWorkspace_sptr WorkspaceCreationHelper::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 instrument. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::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::ITableWorkspace_sptr WorkspaceCreationHelper::createEPPTableWorkspace (const std::vector< EPPTableRow > &rows)
 Create a table workspace corresponding to what the FindEPP algorithm gives. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspace ()
 Create event workspace with: 500 pixels 1000 histogrammed bins. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspace (int numPixels, int numBins, int numEvents, double x0, double binDelta, int eventPattern, int start_at_pixelID)
 Create event workspace. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspace2 (int numPixels=50, int numBins=100)
 Create event workspace with: 50 pixels 100 histogrammed bins from 0.0 in steps of 1.0 200 events; two in each bin, at time 0.5, 1.5, etc. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspace3 (const Mantid::DataObjects::EventWorkspace_const_sptr &sourceWS, const std::string &wsname, Mantid::API::Algorithm *alg)
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspaceWithFullInstrument (int numBanks, int numPixels, bool clearEvents=true)
 Create an Eventworkspace with an instrument that contains RectangularDetector's. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspaceWithFullInstrument2 (int numBanks, int numPixels, bool clearEvents=true)
 Create an Eventworkspace with instrument 2.0 that contains RectangularDetector's. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createEventWorkspaceWithNonUniformInstrument (int numBanks, bool clearEvents)
 Creates an event workspace with instrument which consists of cylindrical detectors. More...
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::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"))
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createGroupedEventWorkspace (std::vector< std::vector< int > > groups, int numBins, double binDelta, double xOffset)
 Create event workspace, with several detector IDs in one event list. More...
 
Mantid::API::MatrixWorkspace_sptr WorkspaceCreationHelper::createGroupedWorkspace2D (size_t numHist, int numBins, double binDelta)
 Create Workspace2d, with numHist spectra, each with 9 detectors, with IDs 1-9, 10-18, 19-27. More...
 
Mantid::API::MatrixWorkspace_sptr WorkspaceCreationHelper::createGroupedWorkspace2DWithRingsAndBoxes (size_t RootOfNumHist=10, int numBins=10, double binDelta=1.0)
 
template<typename YType , typename EType >
Mantid::HistogramData::Histogram WorkspaceCreationHelper::createHisto (bool isHistogram, YType &&yAxis, EType &&eAxis)
 Creates and returns point or bin based histograms with the data specified in parameters. More...
 
void WorkspaceCreationHelper::createInstrumentForWorkspaceWithDistances (const Mantid::API::MatrixWorkspace_sptr &workspace, const Mantid::Kernel::V3D &samplePosition, const Mantid::Kernel::V3D &sourcePosition, const std::vector< Mantid::Kernel::V3D > &detectorPositions)
 
std::shared_ptr< Mantid::DataObjects::PeaksWorkspaceWorkspaceCreationHelper::createPeaksWorkspace (const int numPeaks, const bool createOrientedLattice=false)
 Create a simple peaks workspace containing the given number of peaks. More...
 
std::shared_ptr< Mantid::DataObjects::PeaksWorkspaceWorkspaceCreationHelper::createPeaksWorkspace (const int numPeaks, const Mantid::Kernel::DblMatrix &ubMat)
 Create a simple peaks workspace containing the given number of peaks and UB matrix. More...
 
Mantid::API::MatrixWorkspace_sptr WorkspaceCreationHelper::createProcessedInelasticWS (const std::vector< double > &L2, const std::vector< double > &polar, const std::vector< double > &azimutal, size_t numBins, double Emin, double Emax, double Ei)
 Create a workspace with all components needed for inelastic analysis and 3 detectors in specific places. More...
 
Mantid::API::MatrixWorkspace_sptr WorkspaceCreationHelper::createProcessedWorkspaceWithCylComplexInstrument (size_t numPixels=100, size_t numBins=20, bool has_oriented_lattice=true)
 
Mantid::DataObjects::EventWorkspace_sptr WorkspaceCreationHelper::createRandomEventWorkspace (size_t numbins, size_t numpixels, double bin_delta)
 Create an event workspace with randomized TOF and pulsetimes. More...
 
Mantid::DataObjects::RebinnedOutput_sptr WorkspaceCreationHelper::createRebinnedOutputWorkspace ()
 Function to create a fixed RebinnedOutput workspace. More...
 
Mantid::API::WorkspaceGroup_sptr WorkspaceCreationHelper::createWorkspaceGroup (int nEntries, int nHist, int nBins, const std::string &stem)
 Create a WorkspaceGroup with N workspaces and the specified parameters. More...
 
Mantid::DataObjects::WorkspaceSingleValue_sptr WorkspaceCreationHelper::createWorkspaceSingleValue (double value)
 
Mantid::DataObjects::WorkspaceSingleValue_sptr WorkspaceCreationHelper::createWorkspaceSingleValueWithError (double value, double error)
 
void WorkspaceCreationHelper::displayData (const Mantid::API::MatrixWorkspace_const_sptr &ws)
 
void WorkspaceCreationHelper::displayDataE (const Mantid::API::MatrixWorkspace_const_sptr &ws)
 
void WorkspaceCreationHelper::displayDataX (const Mantid::API::MatrixWorkspace_const_sptr &ws)
 
void WorkspaceCreationHelper::displayDataY (const Mantid::API::MatrixWorkspace_const_sptr &ws)
 
void WorkspaceCreationHelper::eventWorkspace_Finalize (const Mantid::DataObjects::EventWorkspace_sptr &ew)
 Perform some finalization on event workspace stuff. More...
 
template<typename T >
std::shared_ptr< T > WorkspaceCreationHelper::getWS (const std::string &name)
 Returns a workspace of a given type. More...
 
Mantid::DataObjects::Workspace2D_sptr WorkspaceCreationHelper::maskSpectra (Mantid::DataObjects::Workspace2D_sptr workspace, const std::set< int64_t > &maskedWorkspaceIndices)
 
template<typename T >
void WorkspaceCreationHelper::populateWsWithInitList (T &destination, size_t startingIndex, const std::initializer_list< double > &values)
 Populates a mutable reference from initializer list starting at user specified index. More...
 
void WorkspaceCreationHelper::removeWS (const std::string &name)
 Deletes a workspace. More...
 
void WorkspaceCreationHelper::setGoniometer (const Mantid::API::MatrixWorkspace_sptr &ws, double phi, double chi, double omega)
 Create a default universal goniometer and set its angles. More...
 
void WorkspaceCreationHelper::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. More...
 
template<typename WSType >
void WorkspaceCreationHelper::storeWS (const std::string &name, WSType &ws)
 Adds a workspace to the ADS. More...