Mantid
Loading...
Searching...
No Matches
MonteCarloAbsorption.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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
9//------------------------------------------------------------------------------
10// Includes
11//------------------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
13#include "MantidAlgorithms/DllConfig.h"
19
20namespace Mantid {
21namespace API {
22class Sample;
23}
24namespace Geometry {
25class Instrument;
26}
27
28namespace Algorithms {
29class DetectorGridDefinition;
30class MCInteractionVolume;
31
36class MANTID_ALGORITHMS_DLL MonteCarloAbsorption : public API::Algorithm {
37public:
38 virtual ~MonteCarloAbsorption() override = default;
40 const std::string name() const override { return "MonteCarloAbsorption"; }
42 int version() const override { return 1; }
43 const std::vector<std::string> seeAlso() const override {
44 return {"MayersSampleCorrection", "CarpenterSampleCorrection", "PearlMCAbsorption", "VesuvioCalculateMS"};
45 }
47 const std::string category() const override { return "CorrectionFunctions\\AbsorptionCorrections"; }
49 const std::string summary() const override {
50 return "Calculates attenuation due to absorption and scattering in a "
51 "sample & its environment using a Monte Carlo.";
52 }
53
54protected:
55 [[nodiscard]] virtual std::shared_ptr<IMCAbsorptionStrategy>
56 createStrategy(std::shared_ptr<IMCInteractionVolume> interactionVol, const IBeamProfile &beamProfile,
57 Kernel::DeltaEMode::Type EMode, const size_t nevents, const size_t maxScatterPtAttempts,
58 const bool regenerateTracksForEachLambda);
59 virtual std::shared_ptr<SparseWorkspace> createSparseWorkspace(const API::MatrixWorkspace &modelWS,
60 const size_t wavelengthPoints, const size_t rows,
61 const size_t columns);
62 virtual std::unique_ptr<InterpolationOption> createInterpolateOption();
63 std::unique_ptr<IBeamProfile> createBeamProfile(const Geometry::Instrument &instrument,
64 const API::Sample &sample) const;
65
66private:
67 void init() override;
68 void exec() override;
69 std::map<std::string, std::string> validateInputs() override;
70
71 API::MatrixWorkspace_uptr doSimulation(const API::MatrixWorkspace &inputWS, const size_t nevents,
72 const bool simulateTracksForEachWavelength, const int seed,
73 const InterpolationOption &interpolateOpt, const bool useSparseInstrument,
74 const size_t maxScatterPtAttempts,
76 API::MatrixWorkspace_uptr createOutputWorkspace(const API::MatrixWorkspace &inputWS) const;
77 void interpolateFromSparse(API::MatrixWorkspace &targetWS, const SparseWorkspace &sparseWS,
79};
80} // namespace Algorithms
81} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Base MatrixWorkspace Abstract Class.
This class stores information about the sample used in particular run.
Definition Sample.h:33
Base class for all classes defining a beam profile.
Class to provide a consistent interface to an interpolation option on algorithms.
Calculates attenuation due to absorption and scattering in a sample + its environment using a Monte C...
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::unique_ptr< IBeamProfile > createBeamProfile(const Geometry::Instrument &instrument, const API::Sample &sample) const
const std::string summary() const override
Summary of algorithms purpose.
virtual ~MonteCarloAbsorption() override=default
int version() const override
Algorithm's version.
Defines functions and utilities to create and deal with sparse instruments.
Base Instrument Class.
Definition Instrument.h:47
std::unique_ptr< MatrixWorkspace > MatrixWorkspace_uptr
unique pointer to Mantid::API::MatrixWorkspace
Helper class which provides the Collimation Length for SANS instruments.
Type
Define the available energy transfer modes It is important to assign enums proper numbers,...
Definition DeltaEMode.h:29