BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Public Member Functions | |
Beam (const Beam &other) | |
Beam (double intensity, double wavelength, const Direction &direction) | |
~Beam () override | |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
std::string | className () const final |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
Beam * | clone () const |
Direction | direction () const |
const IFootprintFactor * | footprintFactor () const |
Returns footprint factor. More... | |
double | intensity () const |
Returns the beam intensity in neutrons/sec. More... | |
std::vector< const INode * > | nodeChildren () const override |
Returns all children. More... | |
std::vector< const INode * > | nodeOffspring () const |
Returns all descendants. More... | |
Beam & | operator= (const Beam &other) |
virtual std::vector< ParaMeta > | parDefs () const |
Returns the parameter definitions, to be hard-coded in each leaf class. More... | |
SpinMatrix | polMatrix () const |
Returns the polarization density matrix (in spin basis along z-axis) More... | |
R3 | polVector () const |
Returns polarization density as Bloch vector. More... | |
void | setAzimuthalAngleGuarded (double value) |
Check for limits, set the value if within limits. Throws if limits are violated. More... | |
void | setDirection (const Direction &direction) |
void | setFootprintFactor (const IFootprintFactor &shape_factor) |
Sets footprint factor to the beam. More... | |
void | setInclination (double alpha) |
void | setInclinationAngleGuarded (double value) |
Check for limits, set the value if within limits. Throws if limits are violated. More... | |
void | setInclinationLimits (const RealLimits &limits) |
void | setIntensity (double intensity) |
Sets the beam intensity in neutrons/sec. More... | |
void | setPolarization (R3 bloch_vector) |
Sets the polarization density matrix according to the given Bloch vector. More... | |
void | setWavelength (double wavelength) |
void | setWavelengthGuarded (double value) |
Check for limits, set the value if within limits. Throws if limits are violated. More... | |
double | wavelength () const |
Static Public Member Functions | |
static Beam | horizontalBeam () |
Protected Attributes | |
std::vector< double > | m_P |
Private Member Functions | |
Beam () | |
Private Attributes | |
double | m_alpha |
RealLimits | m_alphaLimits |
R3 | m_beamPolarization |
Bloch vector encoding the beam's polarization. More... | |
double | m_intensity |
beam intensity (neutrons/sec) More... | |
double | m_phi |
std::unique_ptr< IFootprintFactor > | m_shape_factor |
footprint correction handler More... | |
double | m_wavelength |
Friends | |
class | DepthProbeSimulationTest |
Beam::Beam | ( | double | intensity, |
double | wavelength, | ||
const Direction & | direction | ||
) |
Definition at line 33 of file Beam.cpp.
References RealLimits::check(), m_alpha, m_alphaLimits, m_intensity, m_phi, m_wavelength, and RealLimits::nonnegative().
Beam::Beam | ( | const Beam & | other | ) |
Definition at line 53 of file Beam.cpp.
References m_beamPolarization, and m_shape_factor.
|
overridedefault |
|
private |
Referenced by clone(), and horizontalBeam().
|
inherited |
Raises exception if a parameter value is invalid.
Definition at line 27 of file INode.cpp.
References ASSERT, RealLimits::check(), INode::className(), INF, RealLimits::limited(), RealLimits::limitless(), INode::m_P, ParaMeta::name, RealLimits::nonnegative(), INode::parDefs(), ParaMeta::vMax, and ParaMeta::vMin.
Referenced by BarGauss::BarGauss(), BarLorentz::BarLorentz(), Bipyramid4::Bipyramid4(), Box::Box(), CantellatedCube::CantellatedCube(), Cone::Cone(), ConstantBackground::ConstantBackground(), CosineRippleBox::CosineRippleBox(), CosineRippleGauss::CosineRippleGauss(), CosineRippleLorentz::CosineRippleLorentz(), Cylinder::Cylinder(), DistributionCosine::DistributionCosine(), DistributionGate::DistributionGate(), DistributionGaussian::DistributionGaussian(), DistributionLogNormal::DistributionLogNormal(), DistributionLorentz::DistributionLorentz(), DistributionTrapezoid::DistributionTrapezoid(), Dodecahedron::Dodecahedron(), EllipsoidalCylinder::EllipsoidalCylinder(), FootprintGauss::FootprintGauss(), FootprintSquare::FootprintSquare(), FuzzySphere::FuzzySphere(), GaussSphere::GaussSphere(), HemiEllipsoid::HemiEllipsoid(), HollowSphere::HollowSphere(), HorizontalCylinder::HorizontalCylinder(), Icosahedron::Icosahedron(), LongBoxGauss::LongBoxGauss(), LongBoxLorentz::LongBoxLorentz(), PlatonicOctahedron::PlatonicOctahedron(), PlatonicTetrahedron::PlatonicTetrahedron(), Prism3::Prism3(), Prism6::Prism6(), Profile1DCauchy::Profile1DCauchy(), Profile1DCosine::Profile1DCosine(), Profile1DGate::Profile1DGate(), Profile1DGauss::Profile1DGauss(), Profile1DTriangle::Profile1DTriangle(), Profile1DVoigt::Profile1DVoigt(), Profile2DCauchy::Profile2DCauchy(), Profile2DCone::Profile2DCone(), Profile2DGate::Profile2DGate(), Profile2DGauss::Profile2DGauss(), Profile2DVoigt::Profile2DVoigt(), Pyramid2::Pyramid2(), Pyramid3::Pyramid3(), Pyramid4::Pyramid4(), Pyramid6::Pyramid6(), RotationEuler::RotationEuler(), RotationX::RotationX(), RotationY::RotationY(), RotationZ::RotationZ(), SawtoothRippleBox::SawtoothRippleBox(), SawtoothRippleGauss::SawtoothRippleGauss(), SawtoothRippleLorentz::SawtoothRippleLorentz(), Sphere::Sphere(), Spheroid::Spheroid(), TruncatedCube::TruncatedCube(), TruncatedSphere::TruncatedSphere(), and TruncatedSpheroid::TruncatedSpheroid().
|
inlinefinalvirtual |
Beam * Beam::clone | ( | ) | const |
|
inline |
Definition at line 46 of file Beam.h.
References m_alpha, and m_phi.
Referenced by DepthProbeSimulation::generateElements(), ISimulation2D::generateElements(), RectangularDetector::indexOfSpecular(), SphericalDetector::indexOfSpecular(), RectangularDetector::scatteringCoords(), SphericalDetector::scatteringCoords(), and setDirection().
const IFootprintFactor * Beam::footprintFactor | ( | ) | const |
Returns footprint factor.
Definition at line 112 of file Beam.cpp.
References m_shape_factor.
Referenced by DepthProbeSimulation::normalize().
|
static |
|
inline |
Returns the beam intensity in neutrons/sec.
Definition at line 43 of file Beam.h.
References m_intensity.
Referenced by DepthProbeSimulation::normalize(), ISimulation2D::normalize(), and setIntensity().
|
overridevirtual |
Returns all children.
Reimplemented from INode.
Definition at line 160 of file Beam.cpp.
References m_shape_factor.
|
inherited |
Returns all descendants.
Definition at line 61 of file INode.cpp.
References INode::nodeChildren().
Definition at line 61 of file Beam.cpp.
References m_alpha, m_beamPolarization, m_intensity, m_phi, m_shape_factor, and m_wavelength.
|
inlinevirtualinherited |
Returns the parameter definitions, to be hard-coded in each leaf class.
Reimplemented in ConstantBackground, GaussSphere, FuzzySphere, RotationEuler, RotationZ, RotationY, RotationX, Crystal, Layer, HexagonalLattice2D, SquareLattice2D, BasicLattice2D, LayerRoughness, TruncatedSpheroid, TruncatedSphere, TruncatedCube, Spheroid, Sphere, SawtoothRippleLorentz, SawtoothRippleGauss, SawtoothRippleBox, Pyramid6, Pyramid4, Pyramid3, Pyramid2, Prism6, Prism3, PlatonicTetrahedron, PlatonicOctahedron, LongBoxLorentz, LongBoxGauss, Icosahedron, HorizontalCylinder, HollowSphere, HemiEllipsoid, EllipsoidalCylinder, Dodecahedron, Cylinder, CosineRippleLorentz, CosineRippleGauss, CosineRippleBox, Cone, CantellatedCube, Box, Bipyramid4, BarLorentz, BarGauss, Profile2DVoigt, Profile2DCone, Profile2DGate, Profile2DGauss, Profile2DCauchy, Profile1DVoigt, Profile1DCosine, Profile1DTriangle, Profile1DGate, Profile1DGauss, Profile1DCauchy, MisesGaussPeakShape, MisesFisherGaussPeakShape, LorentzFisherPeakShape, GaussFisherPeakShape, IsotropicLorentzPeakShape, IsotropicGaussPeakShape, ParticleLayout, InterferenceTwin, InterferenceRadialParaCrystal, InterferenceHardDisk, Interference2DSuperLattice, Interference2DParaCrystal, Interference1DLattice, DistributionTrapezoid, DistributionCosine, DistributionLogNormal, DistributionGaussian, DistributionLorentz, DistributionGate, ResolutionFunction2DGaussian, PolFilter, FootprintSquare, and FootprintGauss.
Definition at line 51 of file INode.h.
Referenced by INode::checkNodeArgs(), and IFormFactor::pythonConstructor().
SpinMatrix Beam::polMatrix | ( | ) | const |
Returns the polarization density matrix (in spin basis along z-axis)
Definition at line 155 of file Beam.cpp.
References SpinMatrix::FromBlochVector(), and m_beamPolarization.
Referenced by ISimulation2D::generateElements().
R3 Beam::polVector | ( | ) | const |
Returns polarization density as Bloch vector.
Definition at line 150 of file Beam.cpp.
References m_beamPolarization.
void Beam::setAzimuthalAngleGuarded | ( | double | value | ) |
Check for limits, set the value if within limits. Throws if limits are violated.
Definition at line 123 of file Beam.cpp.
References m_phi.
Referenced by ISimulation2D::initDistributionHandler().
void Beam::setDirection | ( | const Direction & | direction | ) |
Definition at line 92 of file Beam.cpp.
References Direction::alpha(), direction(), m_alpha, m_phi, and Direction::phi().
Referenced by DepthProbeSimulation::setBeamParameters(), and OffspecSimulation::setBeamParameters().
void Beam::setFootprintFactor | ( | const IFootprintFactor & | shape_factor | ) |
Sets footprint factor to the beam.
Definition at line 135 of file Beam.cpp.
References IFootprintFactor::clone(), and m_shape_factor.
Referenced by DepthProbeSimulation::setBeamParameters().
void Beam::setInclination | ( | double | alpha | ) |
Definition at line 102 of file Beam.cpp.
References m_alpha.
Referenced by OffspecSimulation::initElementVector().
void Beam::setInclinationAngleGuarded | ( | double | value | ) |
Check for limits, set the value if within limits. Throws if limits are violated.
Definition at line 117 of file Beam.cpp.
References RealLimits::check(), m_alpha, and m_alphaLimits.
Referenced by ISimulation2D::initDistributionHandler().
void Beam::setInclinationLimits | ( | const RealLimits & | limits | ) |
Definition at line 107 of file Beam.cpp.
References m_alphaLimits.
Referenced by DepthProbeSimulation::DepthProbeSimulation().
|
inline |
Sets the beam intensity in neutrons/sec.
Definition at line 74 of file Beam.h.
References intensity(), and m_intensity.
void Beam::setPolarization | ( | R3 | bloch_vector | ) |
Sets the polarization density matrix according to the given Bloch vector.
Definition at line 140 of file Beam.cpp.
References m_beamPolarization.
void Beam::setWavelength | ( | double | wavelength | ) |
Definition at line 85 of file Beam.cpp.
References m_wavelength, and wavelength().
Referenced by DepthProbeSimulation::setBeamParameters(), and OffspecSimulation::setBeamParameters().
void Beam::setWavelengthGuarded | ( | double | value | ) |
Check for limits, set the value if within limits. Throws if limits are violated.
Definition at line 129 of file Beam.cpp.
References m_wavelength.
Referenced by ISimulation2D::initDistributionHandler().
|
inline |
Definition at line 44 of file Beam.h.
References m_wavelength.
Referenced by DepthProbeSimulation::generateElements(), ISimulation2D::generateElements(), RectangularDetector::indexOfSpecular(), RectangularDetector::scatteringCoords(), SphericalDetector::scatteringCoords(), and setWavelength().
|
private |
Definition at line 85 of file Beam.h.
Referenced by Beam(), direction(), operator=(), setDirection(), setInclination(), and setInclinationAngleGuarded().
|
private |
Definition at line 90 of file Beam.h.
Referenced by Beam(), setInclinationAngleGuarded(), and setInclinationLimits().
|
private |
Bloch vector encoding the beam's polarization.
Definition at line 88 of file Beam.h.
Referenced by Beam(), operator=(), polMatrix(), polVector(), and setPolarization().
|
private |
beam intensity (neutrons/sec)
Definition at line 82 of file Beam.h.
Referenced by Beam(), intensity(), operator=(), and setIntensity().
|
protectedinherited |
Definition at line 63 of file INode.h.
Referenced by IFootprintFactor::IFootprintFactor(), INode::checkNodeArgs(), IProfile1D::pythonConstructor(), IProfile2D::pythonConstructor(), IFormFactor::pythonConstructor(), Profile1DVoigt::pythonConstructor(), and Profile2DVoigt::pythonConstructor().
|
private |
Definition at line 86 of file Beam.h.
Referenced by Beam(), direction(), operator=(), setAzimuthalAngleGuarded(), and setDirection().
|
private |
footprint correction handler
Definition at line 87 of file Beam.h.
Referenced by Beam(), footprintFactor(), nodeChildren(), operator=(), and setFootprintFactor().
|
private |
Definition at line 83 of file Beam.h.
Referenced by Beam(), operator=(), setWavelength(), setWavelengthGuarded(), and wavelength().