BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
An incident neutron or x-ray beam. More...
Public Member Functions | |
Beam (const Beam &other) | |
Beam (double intensity, double wavelength, const Direction &direction) | |
virtual | ~Beam () |
void | accept (INodeVisitor *visitor) const override |
Calls the INodeVisitor's visit method. More... | |
int | copyNumber (const INode *node) const |
Returns copyNumber of child, which takes into account existence of children with same name. More... | |
ParameterPool * | createParameterTree () const |
Creates new parameter pool, with all local parameters and those of its children. More... | |
Direction | direction () const |
std::string | displayName () const |
Returns display name, composed from the name of node and it's copy number. More... | |
const IFootprintFactor * | footprintFactor () const |
Returns footprint factor. More... | |
kvector_t | getBlochVector () const |
kvector_t | getCentralK () const |
Returns the wavevector. More... | |
std::vector< const INode * > | getChildren () const override |
Returns a vector of children. More... | |
const std::string & | getName () const |
Eigen::Matrix2cd | getPolarization () const |
Returns the polarization density matrix (in spin basis along z-axis) More... | |
double | intensity () const |
Returns the beam intensity in neutrons/sec. More... | |
virtual void | onChange () |
Action to be taken in inherited class when a parameter has changed. More... | |
Beam & | operator= (const Beam &other) |
RealParameter * | parameter (const std::string &name) const |
Returns parameter with given 'name'. More... | |
ParameterPool * | parameterPool () const |
Returns pointer to the parameter pool. More... | |
std::string | parametersToString () const |
Returns multiline string representing available parameters. More... | |
INode * | parent () |
const INode * | parent () const |
std::vector< const INode * > | progeny () const |
Returns a vector of all descendants. More... | |
void | registerChild (INode *node) |
RealParameter & | registerParameter (const std::string &name, double *parpointer) |
void | registerVector (const std::string &base_name, kvector_t *p_vec, const std::string &units="nm") |
void | removeParameter (const std::string &name) |
void | removeVector (const std::string &base_name) |
void | setDirection (const Direction &direction) |
void | setFootprintFactor (const IFootprintFactor &shape_factor) |
Sets footprint factor to the beam. More... | |
void | setInclination (const double alpha) |
void | setIntensity (double intensity) |
Sets the beam intensity in neutrons/sec. More... | |
void | setName (const std::string &name) |
void | setParameterValue (const std::string &name, double value) |
virtual void | setParent (const INode *newParent) |
void | setPolarization (const kvector_t bloch_vector) |
Sets the polarization density matrix according to the given Bloch vector. More... | |
void | setVectorValue (const std::string &base_name, kvector_t value) |
void | setWavelength (double wavelength) |
virtual std::string | treeToString () const |
Returns multiline string representing tree structure below the node. More... | |
double | wavelength () const |
Static Public Member Functions | |
static Beam | horizontalBeam () |
static std::string | XComponentName (const std::string &base_name) |
static std::string | YComponentName (const std::string &base_name) |
static std::string | ZComponentName (const std::string &base_name) |
Protected Attributes | |
const size_t | m_NP |
std::vector< double > | m_P |
Private Member Functions | |
Beam () | |
Private Attributes | |
double | m_alpha |
kvector_t | m_bloch_vector |
Bloch vector encoding the beam's polarization. More... | |
double | m_intensity |
beam intensity (neutrons/sec) More... | |
std::string | m_name |
const INode * | m_parent {nullptr} |
double | m_phi |
std::unique_ptr< ParameterPool > | m_pool |
parameter pool (kind of pointer-to-implementation) More... | |
std::unique_ptr< IFootprintFactor > | m_shape_factor |
footprint correction handler More... | |
double | m_wavelength |
Beam::Beam | ( | double | intensity, |
double | wavelength, | ||
const Direction & | direction | ||
) |
Definition at line 24 of file Beam.cpp.
References INCLINATION_LIMIT, m_alpha, m_bloch_vector, m_intensity, m_phi, M_PI_2, m_wavelength, IParametricComponent::registerParameter(), IParametricComponent::registerVector(), RealParameter::setLimited(), IParametricComponent::setName(), RealParameter::setNonnegative(), and RealParameter::setUnit().
Beam::Beam | ( | const Beam & | other | ) |
Definition at line 44 of file Beam.cpp.
References IParametricComponent::getName(), m_bloch_vector, m_shape_factor, INode::registerChild(), and IParametricComponent::setName().
|
virtualdefault |
|
private |
Referenced by horizontalBeam().
|
inlineoverridevirtual |
Calls the INodeVisitor's visit method.
Implements INode.
Definition at line 38 of file Beam.h.
References INodeVisitor::visit().
|
inherited |
Returns copyNumber of child, which takes into account existence of children with same name.
Definition at line 94 of file INode.cpp.
References INode::getChildren(), IParametricComponent::getName(), and INode::parent().
Referenced by INode::displayName().
|
virtualinherited |
Creates new parameter pool, with all local parameters and those of its children.
Reimplemented from IParametricComponent.
Definition at line 126 of file INode.cpp.
References NodeUtils::nodePath(), INode::parent(), and INode::progeny().
Referenced by ISimulation::runSimulation(), DepthProbeSimulation::validateParametrization(), OffSpecularSimulation::validateParametrization(), and SpecularSimulation::validateParametrization().
|
inline |
Definition at line 45 of file Beam.h.
References m_alpha, and m_phi.
Referenced by DepthProbeSimulation::generateSimulationElements(), ISimulation2D::generateSimulationElements(), getCentralK(), RectangularDetector::indexOfSpecular(), SphericalDetector::indexOfSpecular(), RectangularDetector::init(), setDirection(), TransformFromDomain::setGISASBeamItem(), and TransformFromDomain::setOffSpecularBeamItem().
|
inherited |
Returns display name, composed from the name of node and it's copy number.
Definition at line 115 of file INode.cpp.
References INode::copyNumber(), IParametricComponent::getName(), and INode::m_parent.
Referenced by NodeUtils::nodePath().
const IFootprintFactor * Beam::footprintFactor | ( | ) | const |
Returns footprint factor.
Definition at line 101 of file Beam.cpp.
References m_shape_factor.
Referenced by DepthProbeSimulation::normalize().
kvector_t Beam::getBlochVector | ( | ) | const |
Definition at line 122 of file Beam.cpp.
References m_bloch_vector.
Referenced by TransformFromDomain::setGISASBeamItem().
kvector_t Beam::getCentralK | ( | ) | const |
Returns the wavevector.
Definition at line 73 of file Beam.cpp.
References direction(), M_TWOPI, m_wavelength, and Direction::vector().
Referenced by RectangularDetector::init().
|
overridevirtual |
Returns a vector of children.
Reimplemented from INode.
Definition at line 140 of file Beam.cpp.
References m_shape_factor.
|
inlineinherited |
Definition at line 70 of file IParametricComponent.h.
References IParametricComponent::m_name.
Referenced by Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), IDetector::IDetector(), Instrument::Instrument(), IParametricComponent::IParametricComponent(), SampleBuilderNode::SampleBuilderNode(), Layer::clone(), INode::copyNumber(), IParametricComponent::createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), operator=(), SampleBuilderNode::operator=(), GUIObjectBuilder::populateInstrumentModel(), PyImportAssistant::populateModels(), GUIDomainSampleVisitor::populateSampleModel(), IParametricComponent::registerParameter(), IFormFactor::sliceFormFactor(), and GUIDomainSampleVisitor::visit().
Eigen::Matrix2cd Beam::getPolarization | ( | ) | const |
Returns the polarization density matrix (in spin basis along z-axis)
Definition at line 127 of file Beam.cpp.
References m_bloch_vector, BasicVector3D< T >::x(), BasicVector3D< T >::y(), and BasicVector3D< T >::z().
Referenced by ISimulation2D::generateSimulationElements().
|
static |
|
inline |
Returns the beam intensity in neutrons/sec.
Definition at line 42 of file Beam.h.
References m_intensity.
Referenced by DepthProbeSimulation::normalize(), ISimulation2D::normalize(), SpecularSimulation::normalize(), TransformFromDomain::setGISASBeamItem(), setIntensity(), TransformFromDomain::setOffSpecularBeamItem(), and TransformFromDomain::setSpecularBeamItem().
|
inlinevirtualinherited |
Action to be taken in inherited class when a parameter has changed.
Reimplemented in IProfileRipple, Lattice3D, InterferenceFunction3DLattice, InterferenceFunction2DLattice, FormFactorSphereLogNormalRadius, FormFactorSphereGaussianRadius, FormFactorGaussSphere, ISawtoothRipple, ICosineRipple, IProfileRectangularRipple, FormFactorTruncatedSpheroid, FormFactorTruncatedSphere, FormFactorTruncatedCube, FormFactorTetrahedron, FormFactorPyramid, FormFactorPrism6, FormFactorPrism3, FormFactorLongBoxLorentz, FormFactorLongBoxGauss, FormFactorIcosahedron, FormFactorHollowSphere, FormFactorHemiEllipsoid, FormFactorFullSpheroid, FormFactorFullSphere, FormFactorEllipsoidalCylinder, FormFactorDodecahedron, FormFactorCylinder, FormFactorCuboctahedron, FormFactorCone6, FormFactorCone, FormFactorCantellatedCube, FormFactorBox, FormFactorAnisoPyramid, and Lattice2D.
Definition at line 59 of file IParametricComponent.h.
Referenced by Lattice2D::onChange(), and IParametricComponent::registerParameter().
Definition at line 54 of file Beam.cpp.
References IParametricComponent::getName(), m_alpha, m_bloch_vector, m_intensity, m_phi, m_shape_factor, m_wavelength, INode::registerChild(), and IParametricComponent::setName().
|
inherited |
Returns parameter with given 'name'.
Definition at line 86 of file IParametricComponent.cpp.
References IParametricComponent::m_pool, and RealSpace::Particles::name().
Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), Lattice3D::initialize(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and DistributionLogNormal::setUnits().
|
inlineinherited |
Returns pointer to the parameter pool.
Definition at line 39 of file IParametricComponent.h.
References IParametricComponent::m_pool.
Referenced by INode::INode(), IParametricComponent::IParametricComponent(), pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().
|
inherited |
Returns multiline string representing available parameters.
Definition at line 43 of file IParametricComponent.cpp.
References IParametricComponent::createParameterTree().
|
inherited |
Definition at line 89 of file INode.cpp.
References INode::m_parent.
|
inherited |
Definition at line 84 of file INode.cpp.
References INode::m_parent.
Referenced by INode::copyNumber(), INode::createParameterTree(), ParticleDistribution::generateParticles(), NodeUtils::nodePath(), Lattice2D::onChange(), SampleProvider::setBuilder(), SampleProvider::setParent(), and SampleProvider::setSample().
|
inherited |
Returns a vector of all descendants.
Definition at line 68 of file INode.cpp.
References INode::getChildren().
Referenced by INode::createParameterTree(), and ParticleDistribution::generateParticles().
|
inherited |
Definition at line 57 of file INode.cpp.
References ASSERT, and INode::setParent().
Referenced by Beam(), Crystal::Crystal(), IDetector::IDetector(), Instrument::Instrument(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), Particle::Particle(), ParticleDistribution::ParticleDistribution(), ParticleLayout::addAndRegisterAbstractParticle(), ParticleCoreShell::addAndRegisterCore(), MultiLayer::addAndRegisterInterface(), MultiLayer::addAndRegisterLayer(), ParticleCoreShell::addAndRegisterShell(), Layer::addLayout(), ParticleComposition::addParticlePointer(), ISimulation::initialize(), MesoCrystal::initialize(), operator=(), Instrument::operator=(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), ISimulation::setBackground(), InterferenceFunction1DLattice::setDecayFunction(), InterferenceFunction2DLattice::setDecayFunction(), Instrument::setDetector(), IDetector::setDetectorResolution(), setFootprintFactor(), Particle::setFormFactor(), InterferenceFunctionFinite3DLattice::setLattice(), InterferenceFunctionRadialParaCrystal::setProbabilityDistribution(), InterferenceFunction2DParaCrystal::setProbabilityDistributions(), ConvolutionDetectorResolution::setResolutionFunction(), IParticle::setRotation(), LayerInterface::setRoughness(), and InterferenceFunction2DSuperLattice::setSubstructureIFF().
|
inherited |
Definition at line 51 of file IParametricComponent.cpp.
References IParametricComponent::getName(), IParametricComponent::m_pool, RealSpace::Particles::name(), and IParametricComponent::onChange().
Referenced by BasicLattice2D::BasicLattice2D(), Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice2D::HexagonalLattice2D(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), SquareLattice2D::SquareLattice2D(), TriangularRippleBuilder::TriangularRippleBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::registerVector(), ParticleLayout::registerWeight(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 57 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::registerParameter(), RealParameter::setUnit(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().
Referenced by Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), Lattice3D::initialize(), and IParticle::registerPosition().
|
inherited |
Definition at line 91 of file IParametricComponent.cpp.
References IParametricComponent::m_pool, and RealSpace::Particles::name().
Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::removeVector(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 96 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::removeParameter(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().
Referenced by IParticle::registerPosition().
void Beam::setDirection | ( | const Direction & | direction | ) |
Definition at line 86 of file Beam.cpp.
References Direction::alpha(), direction(), m_alpha, m_phi, and Direction::phi().
Referenced by Instrument::setBeamParameters().
void Beam::setFootprintFactor | ( | const IFootprintFactor & | shape_factor | ) |
Sets footprint factor to the beam.
Definition at line 106 of file Beam.cpp.
References IFootprintFactor::clone(), m_shape_factor, and INode::registerChild().
Referenced by DepthProbeSimulation::setBeamParameters().
void Beam::setInclination | ( | const double | alpha | ) |
Definition at line 96 of file Beam.cpp.
References m_alpha.
Referenced by OffSpecularSimulation::initSimulationElementVector().
|
inline |
Sets the beam intensity in neutrons/sec.
Definition at line 61 of file Beam.h.
References intensity(), and m_intensity.
|
inlineinherited |
Definition at line 69 of file IParametricComponent.h.
References IParametricComponent::m_name, and RealSpace::Particles::name().
Referenced by BasicLattice2D::BasicLattice2D(), Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice2D::HexagonalLattice2D(), IDetector::IDetector(), INode::INode(), Instrument::Instrument(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunction3DLattice::InterferenceFunction3DLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), InterferenceFunctionFinite3DLattice::InterferenceFunctionFinite3DLattice(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionNone::InterferenceFunctionNone(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), ISampleBuilder::ISampleBuilder(), IsGISAXSDetector::IsGISAXSDetector(), Lattice3D::Lattice3D(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SphericalDetector::SphericalDetector(), SquareLattice2D::SquareLattice2D(), Layer::clone(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), DepthProbeSimulation::initialize(), GISASSimulation::initialize(), OffSpecularSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().
|
inherited |
Definition at line 65 of file IParametricComponent.cpp.
References IParametricComponent::createParameterTree(), IParametricComponent::m_pool, RealSpace::Particles::name(), and ParameterPool::setMatchedParametersValue().
Referenced by AsymRippleBuilder::buildSample(), and IParametricComponent::setVectorValue().
|
virtualinherited |
Reimplemented in SampleProvider.
Definition at line 79 of file INode.cpp.
References INode::m_parent.
Referenced by INode::registerChild(), SampleProvider::setBuilder(), and SampleProvider::setParent().
void Beam::setPolarization | ( | const kvector_t | bloch_vector | ) |
Sets the polarization density matrix according to the given Bloch vector.
Definition at line 112 of file Beam.cpp.
References m_bloch_vector, and BasicVector3D< T >::mag().
Referenced by StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), and StandardSimulations::MiniGISASPolarizationPP().
|
inherited |
Definition at line 78 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::setParameterValue(), BasicVector3D< T >::x(), IParametricComponent::XComponentName(), BasicVector3D< T >::y(), IParametricComponent::YComponentName(), BasicVector3D< T >::z(), and IParametricComponent::ZComponentName().
void Beam::setWavelength | ( | double | wavelength | ) |
Definition at line 78 of file Beam.cpp.
References m_wavelength, and wavelength().
Referenced by Instrument::setBeamParameters().
|
virtualinherited |
Returns multiline string representing tree structure below the node.
Definition at line 52 of file INode.cpp.
References NodeUtils::nodeToString().
|
inline |
Definition at line 43 of file Beam.h.
References m_wavelength.
Referenced by DepthProbeSimulation::generateSimulationElements(), ISimulation2D::generateSimulationElements(), RectangularDetector::indexOfSpecular(), TransformFromDomain::setGISASBeamItem(), TransformFromDomain::setOffSpecularBeamItem(), TransformFromDomain::setSpecularBeamItem(), and setWavelength().
|
staticinherited |
Definition at line 103 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by Lattice3D::initialize(), IParticle::registerPosition(), IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
staticinherited |
Definition at line 108 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
staticinherited |
Definition at line 113 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
private |
Definition at line 72 of file Beam.h.
Referenced by Beam(), direction(), operator=(), setDirection(), and setInclination().
|
private |
Bloch vector encoding the beam's polarization.
Definition at line 75 of file Beam.h.
Referenced by Beam(), getBlochVector(), getPolarization(), operator=(), and setPolarization().
|
private |
beam intensity (neutrons/sec)
Definition at line 69 of file Beam.h.
Referenced by Beam(), intensity(), operator=(), and setIntensity().
|
privateinherited |
Definition at line 73 of file IParametricComponent.h.
Referenced by IParametricComponent::getName(), and IParametricComponent::setName().
|
protectedinherited |
Definition at line 88 of file INode.h.
Referenced by INode::INode().
|
protectedinherited |
Definition at line 89 of file INode.h.
Referenced by INode::INode(), and IFootprintFactor::setWidthRatio().
|
privateinherited |
Definition at line 83 of file INode.h.
Referenced by INode::displayName(), INode::parent(), and INode::setParent().
|
private |
Definition at line 73 of file Beam.h.
Referenced by Beam(), direction(), operator=(), and setDirection().
|
privateinherited |
parameter pool (kind of pointer-to-implementation)
Definition at line 74 of file IParametricComponent.h.
Referenced by IParametricComponent::createParameterTree(), IParametricComponent::parameter(), IParametricComponent::parameterPool(), IParametricComponent::registerParameter(), IParametricComponent::removeParameter(), and IParametricComponent::setParameterValue().
|
private |
footprint correction handler
Definition at line 74 of file Beam.h.
Referenced by Beam(), footprintFactor(), getChildren(), operator=(), and setFootprintFactor().
|
private |
Definition at line 70 of file Beam.h.
Referenced by Beam(), getCentralK(), operator=(), setWavelength(), and wavelength().