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() = 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 virtual std::shared_ptr<IMCAbsorptionStrategy>
56 createStrategy(IMCInteractionVolume &interactionVol, const IBeamProfile &beamProfile, Kernel::DeltaEMode::Type EMode,
57 const size_t nevents, const size_t maxScatterPtAttempts, const bool regenerateTracksForEachLambda);
58 virtual std::shared_ptr<IMCInteractionVolume>
59 createInteractionVolume(const API::Sample &sample, const size_t maxScatterPtAttempts,
61 virtual std::shared_ptr<SparseWorkspace> createSparseWorkspace(const API::MatrixWorkspace &modelWS,
62 const size_t wavelengthPoints, const size_t rows,
63 const size_t columns);
64 virtual std::unique_ptr<InterpolationOption> createInterpolateOption();
65 std::unique_ptr<IBeamProfile> createBeamProfile(const Geometry::Instrument &instrument,
66 const API::Sample &sample) const;
67
68private:
69 void init() override;
70 void exec() override;
71 std::map<std::string, std::string> validateInputs() override;
72
73 API::MatrixWorkspace_uptr doSimulation(const API::MatrixWorkspace &inputWS, const size_t nevents,
74 const bool simulateTracksForEachWavelength, const int seed,
75 const InterpolationOption &interpolateOpt, const bool useSparseInstrument,
76 const size_t maxScatterPtAttempts,
78 API::MatrixWorkspace_uptr createOutputWorkspace(const API::MatrixWorkspace &inputWS) const;
79 void interpolateFromSparse(API::MatrixWorkspace &targetWS, const SparseWorkspace &sparseWS,
81};
82} // namespace Algorithms
83} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
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.
Definition: IBeamProfile.h:26
Defines a base class for objects describing a volume where interactions of Tracks and Objects can tak...
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.
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