Mantid
Loading...
Searching...
No Matches
SetSample.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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
10#include "MantidDataHandling/DllConfig.h"
13
14namespace Mantid {
15namespace Geometry {
16class ReferenceFrame;
17class SampleEnvironment;
18} // namespace Geometry
19namespace API {
20class ExperimentInfo;
21} // namespace API
22namespace DataHandling {
23
27class MANTID_DATAHANDLING_DLL SetSample final : public API::Algorithm {
28public:
29 const std::string name() const override final;
30 int version() const override final;
31 const std::vector<std::string> seeAlso() const override {
32 return {"SetSampleMaterial", "CreateSampleShape", "CopySample", "SetBeam"};
33 }
34 const std::string category() const override final;
35 const std::string summary() const override final;
36
37private:
38 std::map<std::string, std::string> validateInputs() override final;
39 void init() override final;
40 void exec() override final;
41
42 const Geometry::SampleEnvironment *setSampleEnvironmentFromFile(API::ExperimentInfo &experiment,
43 const Kernel::PropertyManager_const_sptr &args);
44 const Geometry::SampleEnvironment *
45 setSampleEnvironmentFromXML(API::ExperimentInfo &experiment,
46 const Kernel::PropertyManager_const_sptr &canGeometryArgs,
47 const Kernel::PropertyManager_const_sptr &canMaterialArgs);
48 void setSampleShape(API::ExperimentInfo &experiment, const Kernel::PropertyManager_const_sptr &args,
49 const Geometry::SampleEnvironment *sampleEnv);
50 std::string tryCreateXMLFromArgsOnly(const Kernel::PropertyManager &args, const Geometry::ReferenceFrame &refFrame);
51 std::string createFlatPlateXML(const Kernel::PropertyManager &args, const Geometry::ReferenceFrame &refFrame,
52 const std::string &id = "sample-shape") const;
53 std::string createFlatPlateHolderXML(const Kernel::PropertyManager &args,
54 const Geometry::ReferenceFrame &refFrame) const;
55 std::string createHollowCylinderHolderXML(const Kernel::PropertyManager &args,
56 const Geometry::ReferenceFrame &refFrame) const;
57 std::string createCylinderLikeXML(const Kernel::PropertyManager &args, const Geometry::ReferenceFrame &refFrame,
58 bool hollow, const std::string &id = "sample-shape") const;
59 std::string createSphereXML(const Kernel::PropertyManager &args) const;
60 void validateGeometry(std::map<std::string, std::string> &errors, const Kernel::PropertyManager &args,
61 const std::string &flavour);
62 void validateMaterial(std::map<std::string, std::string> &errors, const Kernel::PropertyManager &inputArgs,
63 const std::string &flavour);
64 void assertNonNegative(std::map<std::string, std::string> &errors, const Kernel::PropertyManager &args,
65 const std::string &flavour, const std::vector<const std::string *> &keys);
66 void setMaterial(ReadMaterial::MaterialParameters &materialParams, const Kernel::PropertyManager &materialArgs);
67 Kernel::PropertyManager materialSettingsEnsureLegacyCompatibility(const Kernel::PropertyManager &materialArgs);
68 bool isDictionaryPopulated(const Kernel::PropertyManager_const_sptr &dict) const;
69};
70
71} // namespace DataHandling
72} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
This class is shared by a few Workspace types and holds information related to a particular experimen...
This class contains code for interpreting a material input for SetSampleMaterial, validating the para...
Definition: ReadMaterial.h:26
High-level interface for setting sample metadata on a workspace.
Definition: SetSample.h:27
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: SetSample.h:31
ReferenceFrame : Holds reference frame information from the geometry description file.
Defines a single instance of a SampleEnvironment.
Property manager helper class.
std::shared_ptr< const PropertyManager > PropertyManager_const_sptr
shared pointer to Mantid::Kernel::PropertyManager(const version)
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.