Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Algorithms::RectangularBeamProfile Class Referencefinal

Defines a flat, rectangular beam profile that has a width, height and center point. More...

#include <RectangularBeamProfile.h>

Inheritance diagram for Mantid::Algorithms::RectangularBeamProfile:
Mantid::Algorithms::IBeamProfile

Public Member Functions

Geometry::BoundingBox defineActiveRegion (const Geometry::BoundingBox &) const override
 Compute a region that defines how the beam illuminates the given sample/can. More...
 
IBeamProfile::Ray generatePoint (Kernel::PseudoRandomNumberGenerator &rng) const override
 Generate a random point within the beam profile using the supplied random number source. More...
 
IBeamProfile::Ray generatePoint (Kernel::PseudoRandomNumberGenerator &rng, const Geometry::BoundingBox &bounds) const override
 Generate a random point on the profile that is within the given bounding area. More...
 
Kernel::V3D maxPoint () const
 Returns the max point of the profile. More...
 
Kernel::V3D minPoint () const
 Returns the min point of the profile. More...
 
 RectangularBeamProfile (const Geometry::ReferenceFrame &frame, const Kernel::V3D &center, double width, double height)
 Construct a beam profile. More...
 
- Public Member Functions inherited from Mantid::Algorithms::IBeamProfile
virtual Geometry::BoundingBox defineActiveRegion (const Geometry::BoundingBox &) const =0
 
virtual Ray generatePoint (Kernel::PseudoRandomNumberGenerator &rng) const =0
 
virtual Ray generatePoint (Kernel::PseudoRandomNumberGenerator &rng, const Geometry::BoundingBox &) const =0
 
virtual ~IBeamProfile ()=default
 

Private Attributes

Kernel::V3D m_beamDir
 
const unsigned short m_beamIdx
 
const double m_height
 
const unsigned short m_horIdx
 
Kernel::V3D m_min
 
const unsigned short m_upIdx
 
const double m_width
 

Detailed Description

Defines a flat, rectangular beam profile that has a width, height and center point.

The profile is assumed infinitely thin.

Definition at line 25 of file RectangularBeamProfile.h.

Constructor & Destructor Documentation

◆ RectangularBeamProfile()

Mantid::Algorithms::RectangularBeamProfile::RectangularBeamProfile ( const Geometry::ReferenceFrame frame,
const Kernel::V3D center,
double  width,
double  height 
)

Construct a beam profile.

Parameters
frameDefines the direction of the beam, up and horizontal
centerV3D defining the central point of the rectangle
widthWidth of beam
heightHeight of beam

Definition at line 26 of file RectangularBeamProfile.cpp.

References height, m_beamDir, m_beamIdx, m_horIdx, m_min, and m_upIdx.

Member Function Documentation

◆ defineActiveRegion()

Geometry::BoundingBox Mantid::Algorithms::RectangularBeamProfile::defineActiveRegion ( const Geometry::BoundingBox sampleBox) const
overridevirtual

Compute a region that defines how the beam illuminates the given sample/can.

Parameters
sampleBoxA reference to the bounding box of the sample
Returns
A BoundingBox defining the active region

Implements Mantid::Algorithms::IBeamProfile.

Definition at line 81 of file RectangularBeamProfile.cpp.

References m_beamIdx, m_height, m_horIdx, m_min, m_upIdx, m_width, maxPoint(), Mantid::Geometry::BoundingBox::maxPoint(), minPoint(), Mantid::Geometry::BoundingBox::minPoint(), Mantid::Kernel::V3D::X(), Mantid::Kernel::V3D::Y(), and Mantid::Kernel::V3D::Z().

◆ generatePoint() [1/2]

IBeamProfile::Ray Mantid::Algorithms::RectangularBeamProfile::generatePoint ( Kernel::PseudoRandomNumberGenerator rng) const
overridevirtual

Generate a random point within the beam profile using the supplied random number source.

Parameters
rngA reference to a random number generator
Returns
An IBeamProfile::Ray describing the start and direction

Implements Mantid::Algorithms::IBeamProfile.

Definition at line 42 of file RectangularBeamProfile.cpp.

References m_beamDir, m_beamIdx, m_height, m_horIdx, m_min, m_upIdx, m_width, and Mantid::Kernel::PseudoRandomNumberGenerator::nextValue().

Referenced by generatePoint().

◆ generatePoint() [2/2]

IBeamProfile::Ray Mantid::Algorithms::RectangularBeamProfile::generatePoint ( Kernel::PseudoRandomNumberGenerator rng,
const Geometry::BoundingBox bounds 
) const
overridevirtual

Generate a random point on the profile that is within the given bounding area.

If the point is outside the area then it is pulled to the boundary of the bounding area.

Parameters
rngA reference to a random number generator
boundsA reference to the bounding area that defines the maximum allowed region for the generated point.
Returns
An IBeamProfile::Ray describing the start and direction

Implements Mantid::Algorithms::IBeamProfile.

Definition at line 59 of file RectangularBeamProfile.cpp.

References generatePoint(), m_horIdx, m_upIdx, Mantid::Geometry::BoundingBox::maxPoint(), and Mantid::Geometry::BoundingBox::minPoint().

◆ maxPoint()

Kernel::V3D Mantid::Algorithms::RectangularBeamProfile::maxPoint ( ) const
inline

Returns the max point of the profile.

Definition at line 36 of file RectangularBeamProfile.h.

Referenced by defineActiveRegion().

◆ minPoint()

Kernel::V3D Mantid::Algorithms::RectangularBeamProfile::minPoint ( ) const
inline

Returns the min point of the profile.

Definition at line 34 of file RectangularBeamProfile.h.

References m_min.

Referenced by defineActiveRegion().

Member Data Documentation

◆ m_beamDir

Kernel::V3D Mantid::Algorithms::RectangularBeamProfile::m_beamDir
private

Definition at line 50 of file RectangularBeamProfile.h.

Referenced by generatePoint(), and RectangularBeamProfile().

◆ m_beamIdx

const unsigned short Mantid::Algorithms::RectangularBeamProfile::m_beamIdx
private

◆ m_height

const double Mantid::Algorithms::RectangularBeamProfile::m_height
private

Definition at line 48 of file RectangularBeamProfile.h.

Referenced by defineActiveRegion(), and generatePoint().

◆ m_horIdx

const unsigned short Mantid::Algorithms::RectangularBeamProfile::m_horIdx
private

◆ m_min

Kernel::V3D Mantid::Algorithms::RectangularBeamProfile::m_min
private

◆ m_upIdx

const unsigned short Mantid::Algorithms::RectangularBeamProfile::m_upIdx
private

◆ m_width

const double Mantid::Algorithms::RectangularBeamProfile::m_width
private

Definition at line 47 of file RectangularBeamProfile.h.

Referenced by defineActiveRegion(), and generatePoint().


The documentation for this class was generated from the following files: