Mantid
Loading...
Searching...
No Matches
RectangularBeamProfile.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#include "MantidKernel/V3D.h"
12
13#include <array>
14
15namespace Mantid {
16namespace Geometry {
17class ReferenceFrame;
18}
19namespace Algorithms {
20
25class MANTID_ALGORITHMS_DLL RectangularBeamProfile final : public IBeamProfile {
26public:
27 RectangularBeamProfile(const Geometry::ReferenceFrame &frame, const Kernel::V3D &center, double width, double height);
28
29 IBeamProfile::Ray generatePoint(Kernel::PseudoRandomNumberGenerator &rng) const override;
31 const Geometry::BoundingBox &bounds) const override;
32 Geometry::BoundingBox defineActiveRegion(const Geometry::BoundingBox &) const override;
34 inline Kernel::V3D minPoint() const { return Kernel::V3D{m_min[0], m_min[1], m_min[2]}; }
36 inline Kernel::V3D maxPoint() const {
37 auto maxPt = minPoint();
38 maxPt[m_horIdx] += m_width;
39 maxPt[m_upIdx] += m_height;
40 return maxPt;
41 }
42
43private:
44 const unsigned short m_upIdx;
45 const unsigned short m_beamIdx;
46 const unsigned short m_horIdx;
47 const double m_width;
48 const double m_height;
51};
52
53} // namespace Algorithms
54} // namespace Mantid
double height
Definition: GetAllEi.cpp:155
specnum_t m_min
Base class for all classes defining a beam profile.
Definition: IBeamProfile.h:26
Defines a flat, rectangular beam profile that has a width, height and center point.
Kernel::V3D minPoint() const
Returns the min point of the profile.
Kernel::V3D maxPoint() const
Returns the max point of the profile.
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Definition: BoundingBox.h:34
ReferenceFrame : Holds reference frame information from the geometry description file.
Defines a 1D pseudo-random number generator, i.e.
Class for 3D vectors.
Definition: V3D.h:34
Helper class which provides the Collimation Length for SANS instruments.