Mantid
Loading...
Searching...
No Matches
CreateSampleWorkspace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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#pragma once
8
11#include "MantidAlgorithms/DllConfig.h"
16
17namespace Mantid {
18namespace Algorithms {
19
23class MANTID_ALGORITHMS_DLL CreateSampleWorkspace final : public API::Algorithm {
24public:
26
27 const std::string name() const override;
28 int version() const override;
29 const std::vector<std::string> seeAlso() const override { return {"CreateWorkspace"}; }
30 const std::string category() const override;
32 const std::string summary() const override {
33 return "Creates sample workspaces for usage examples and other situations.";
34 }
35
36private:
37 void init() override;
38 void exec() override;
39
40 DataObjects::EventWorkspace_sptr createEventWorkspace(int numPixels, int numBins, int numMonitors, int numEvents,
41 double x0, double binDelta,
42 const Geometry::Instrument_sptr &inst,
43 const std::string &functionString, bool isRandom);
44 API::MatrixWorkspace_sptr createHistogramWorkspace(int numPixels, int numBins, int numMonitors, double x0,
45 double binDelta, const Geometry::Instrument_sptr &inst,
46 const std::string &functionString, bool isRandom);
47 API::MatrixWorkspace_sptr createScanningWorkspace(int numBins, double x0, double binDelta,
48 const Geometry::Instrument_sptr &inst,
49 const std::string &functionString, bool isRandom,
50 int numScanPoints);
51 Geometry::Instrument_sptr createTestInstrumentRectangular(API::Progress &progress, int numBanks, int numMonitors,
52 int pixels, double pixelDiameter, double pixelHeight,
53 double pixelSpacing, const double bankDistanceFromSample,
54 const double sourceSampleDistance,
55 const std::string &instrName);
56 Geometry::IObject_sptr createCappedCylinder(double radius, double height, const Kernel::V3D &baseCentre,
57 const Kernel::V3D &axis, const std::string &id);
58 Geometry::IObject_sptr createSphere(double radius, const Kernel::V3D &centre, const std::string &id);
59 std::vector<double> evalFunction(const std::string &functionString, const std::vector<double> &xVal,
60 double noiseScale);
61 void replaceAll(std::string &str, const std::string &from, const std::string &to);
62 void addChopperParameters(API::MatrixWorkspace_sptr &ws);
63
65 std::unique_ptr<Kernel::PseudoRandomNumberGenerator> m_randGen;
66 std::map<std::string, std::string> m_preDefinedFunctionmap;
67};
68
69} // namespace Algorithms
70} // namespace Mantid
double height
Definition: GetAllEi.cpp:155
double radius
Definition: Rasterize.cpp:31
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
CreateSampleWorkspace : This algorithm is intended for the creation of sample workspaces for usage ex...
std::unique_ptr< Kernel::PseudoRandomNumberGenerator > m_randGen
A pointer to the random number generator.
const std::string summary() const override
Algorithm's summary.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::map< std::string, std::string > m_preDefinedFunctionmap
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::shared_ptr< Instrument > Instrument_sptr
Shared pointer to an instrument object.
std::shared_ptr< IObject > IObject_sptr
Typdef for a shared pointer.
Definition: IObject.h:92
Helper class which provides the Collimation Length for SANS instruments.