Mantid
Loading...
Searching...
No Matches
MCInteractionVolume.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
9#include "MantidAlgorithms/DllConfig.h"
11
12namespace Mantid {
13namespace API {
14class Sample;
15}
16namespace Geometry {
17class SampleEnvironment;
18} // namespace Geometry
19
20namespace Algorithms {
21class IBeamProfile;
22
28class MANTID_ALGORITHMS_DLL MCInteractionVolume : public IMCInteractionVolume {
29public:
30 enum class ScatteringPointVicinity { SAMPLEANDENVIRONMENT, SAMPLEONLY, ENVIRONMENTONLY };
31 MCInteractionVolume(const API::Sample &sample, const size_t maxScatterAttempts = 5000,
32 const ScatteringPointVicinity pointsIn = ScatteringPointVicinity::SAMPLEANDENVIRONMENT);
33
34 const Geometry::BoundingBox getFullBoundingBox() const override;
35 virtual TrackPair calculateBeforeAfterTrack(Kernel::PseudoRandomNumberGenerator &rng, const Kernel::V3D &startPos,
36 const Kernel::V3D &endPos, MCInteractionStatistics &stats) const override;
38 void setActiveRegion(const Geometry::BoundingBox &region) override;
39
40private:
41 int getComponentIndex(Kernel::PseudoRandomNumberGenerator &rng) const;
42 boost::optional<Kernel::V3D> generatePointInObjectByIndex(int componentIndex,
44 const std::shared_ptr<Geometry::IObject> m_sample;
49};
50
51} // namespace Algorithms
52} // namespace Mantid
This class stores information about the sample used in particular run.
Definition: Sample.h:33
Defines a base class for objects describing a volume where interactions of Tracks and Objects can tak...
Stores statistics relating to the tracks generated in MCInteractionVolume for a specific detector.
Defines a volume where interactions of Tracks and Objects can take place.
const ScatteringPointVicinity m_pointsIn
const Geometry::SampleEnvironment * m_env
const std::shared_ptr< Geometry::IObject > m_sample
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Definition: BoundingBox.h:34
Defines a single instance of a SampleEnvironment.
Defines a 1D pseudo-random number generator, i.e.
Class for 3D vectors.
Definition: V3D.h:34
std::tuple< bool, std::shared_ptr< Geometry::Track >, std::shared_ptr< Geometry::Track > > TrackPair
Helper class which provides the Collimation Length for SANS instruments.