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
17#include <span>
18
19namespace Mantid {
20namespace Algorithms {
21
25class MANTID_ALGORITHMS_DLL CreateSampleWorkspace final : public API::Algorithm {
26public:
28
29 const std::string name() const override;
30 int version() const override;
31 const std::vector<std::string> seeAlso() const override { return {"CreateWorkspace"}; }
32 const std::string category() const override;
34 const std::string summary() const override {
35 return "Creates sample workspaces for usage examples and other situations.";
36 }
37
38private:
39 void init() override;
40 void exec() override;
41
42 DataObjects::EventWorkspace_sptr createEventWorkspace(int numPixels, int numBins, int numMonitors, int numEvents,
43 double x0, double binDelta,
44 const Geometry::Instrument_sptr &inst,
45 const std::string &functionString, bool isRandom);
46 API::MatrixWorkspace_sptr createHistogramWorkspace(int numPixels, int numBins, int numMonitors, double x0,
47 double binDelta, const Geometry::Instrument_sptr &inst,
48 const std::string &functionString, bool isRandom);
49 API::MatrixWorkspace_sptr createScanningWorkspace(int numBins, double x0, double binDelta,
50 const Geometry::Instrument_sptr &inst,
51 const std::string &functionString, bool isRandom,
52 int numScanPoints);
53 Geometry::Instrument_sptr createTestInstrumentRectangular(API::Progress &progress, int numBanks, int numMonitors,
54 int pixels, double pixelDiameter, double pixelHeight,
55 double pixelSpacing, const double bankDistanceFromSample,
56 const double sourceSampleDistance,
57 const std::string &instrName);
58 Geometry::IObject_sptr createCappedCylinder(double radius, double height, const Kernel::V3D &baseCentre,
59 const Kernel::V3D &axis, const std::string &id);
60 Geometry::IObject_sptr createSphere(double radius, const Kernel::V3D &centre, const std::string &id);
61 std::vector<double> evalFunction(const std::string &functionString, std::span<double const> xVal, double noiseScale);
62 void replaceAll(std::string &str, const std::string &from, const std::string &to);
63 void addChopperParameters(API::MatrixWorkspace_sptr &ws);
64
66 std::unique_ptr<Kernel::PseudoRandomNumberGenerator> m_randGen;
67 std::map<std::string, std::string> m_preDefinedFunctionmap;
68};
69
70} // namespace Algorithms
71} // namespace Mantid
std::string name
Definition Run.cpp:60
double centre
double height
Definition GetAllEi.cpp:155
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
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:93
Helper class which provides the Collimation Length for SANS instruments.