BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
Instrument () | |
Instrument (const Instrument &other) | |
Instrument & | operator= (const Instrument &other) |
virtual | ~Instrument () |
void | accept (INodeVisitor *visitor) const final |
Beam & | getBeam () |
const Beam & | getBeam () const |
void | setBeam (const Beam &beam) |
void | setBeamParameters (double wavelength, double alpha_i, double phi_i) |
void | setBeamIntensity (double intensity) |
void | setBeamPolarization (const kvector_t bloch_vector) |
double | getBeamIntensity () const |
const IDetector * | getDetector () const |
IDetector & | detector () |
const IDetector & | detector () const |
IDetector2D & | detector2D () |
const IDetector2D & | detector2D () const |
const DetectorMask * | getDetectorMask () const |
const IAxis & | getDetectorAxis (size_t index) const |
size_t | getDetectorDimension () const |
void | setDetector (const IDetector &detector) |
void | setDetectorResolutionFunction (const IResolutionFunction2D &p_resolution_function) |
void | removeDetectorResolution () |
void | setAnalyzerProperties (const kvector_t direction, double efficiency, double total_transmission) |
void | applyDetectorResolution (OutputData< double > *p_intensity_map) const |
void | initDetector () |
std::vector< const INode * > | getChildren () const |
virtual std::string | treeToString () const |
void | registerChild (INode *node) |
virtual void | setParent (const INode *newParent) |
const INode * | parent () const |
INode * | parent () |
int | copyNumber (const INode *node) const |
std::string | displayName () const |
ParameterPool * | createParameterTree () const |
ParameterPool * | parameterPool () const |
std::string | parametersToString () const |
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 | setParameterValue (const std::string &name, double value) |
void | setVectorValue (const std::string &base_name, kvector_t value) |
RealParameter * | parameter (const std::string &name) const |
virtual void | onChange () |
void | removeParameter (const std::string &name) |
void | removeVector (const std::string &base_name) |
void | setName (const std::string &name) |
const std::string & | getName () const |
Static Public Member Functions | |
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 | |
std::unique_ptr< IDetector > | m_detector |
Beam | m_beam |
const size_t | m_NP |
std::vector< double > | m_P |
Private Attributes | |
const INode * | m_parent {nullptr} |
std::string | m_name |
std::unique_ptr< ParameterPool > | m_pool |
Assembles beam, detector and their relative positions with respect to the sample.
Definition at line 33 of file Instrument.h.
Instrument::Instrument | ( | ) |
Definition at line 20 of file Instrument.cpp.
References m_beam, m_detector, INode::registerChild(), and IParameterized::setName().
Instrument::Instrument | ( | const Instrument & | other | ) |
Definition at line 27 of file Instrument.cpp.
References IParameterized::getName(), m_beam, m_detector, INode::registerChild(), setDetector(), and IParameterized::setName().
|
virtualdefault |
Instrument & Instrument::operator= | ( | const Instrument & | other | ) |
Definition at line 37 of file Instrument.cpp.
References m_beam, m_detector, INode::registerChild(), and setDetector().
|
inlinefinalvirtual |
Calls the INodeVisitor's visit method.
Implements INode.
Definition at line 42 of file Instrument.h.
|
inline |
Definition at line 44 of file Instrument.h.
References m_beam.
Referenced by UnitConverterUtils::createConverterForGISAS(), SimulationToPython::defineGISASBeam(), SimulationToPython::defineOffSpecBeam(), SimulationToPython::defineSpecularScan(), anonymous_namespace{SpecularSimulation.cpp}::generateSimulationElements(), initDetector(), DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), DepthProbeSimulation::initSimulationElementVector(), GISASSimulation::initSimulationElementVector(), OffSpecSimulation::initSimulationElementVector(), DepthProbeSimulation::normalize(), and DepthProbeSimulation::setBeamParameters().
|
inline |
void Instrument::setBeam | ( | const Beam & | beam | ) |
Definition at line 99 of file Instrument.cpp.
References initDetector(), m_beam, and m_detector.
void Instrument::setBeamParameters | ( | double | wavelength, |
double | alpha_i, | ||
double | phi_i | ||
) |
Sets the beam wavelength and incoming angles.
Definition at line 87 of file Instrument.cpp.
References initDetector(), m_beam, m_detector, Beam::setCentralK(), and anonymous_namespace{SlicedCylindersBuilder.cpp}::wavelength().
Referenced by DepthProbeSimulation::setBeamParameters(), OffSpecSimulation::setBeamParameters(), GISASSimulation::setBeamParameters(), and SpecularSimulation::setScan().
void Instrument::setBeamIntensity | ( | double | intensity | ) |
Definition at line 106 of file Instrument.cpp.
References m_beam, and Beam::setIntensity().
Referenced by Simulation::setBeamIntensity().
void Instrument::setBeamPolarization | ( | const kvector_t | bloch_vector | ) |
Sets the beam's polarization according to the given Bloch vector.
Definition at line 111 of file Instrument.cpp.
References m_beam, and Beam::setPolarization().
Referenced by Simulation::setBeamPolarization().
double Instrument::getBeamIntensity | ( | ) | const |
Definition at line 116 of file Instrument.cpp.
References Beam::getIntensity(), and m_beam.
Referenced by Simulation::getBeamIntensity().
const IDetector * Instrument::getDetector | ( | ) | const |
Definition at line 121 of file Instrument.cpp.
References ASSERT, and m_detector.
Referenced by UnitConverterUtils::createConverterForGISAS(), SimulationToPython::defineDetector(), SimulationToPython::defineDetectorPolarizationAnalysis(), SimulationToPython::defineDetectorResolutionFunction(), and SimulationToPython::defineMasks().
IDetector & Instrument::detector | ( | ) |
Definition at line 133 of file Instrument.cpp.
References ASSERT, and m_detector.
Referenced by Simulation::convertData(), anonymous_namespace{SpecularSimulation.cpp}::generateSimulationElements(), GISASSimulation::intensityMapSize(), and setDetector().
const IDetector & Instrument::detector | ( | ) | const |
Definition at line 127 of file Instrument.cpp.
References ASSERT, and m_detector.
IDetector2D & Instrument::detector2D | ( | ) |
Definition at line 139 of file Instrument.cpp.
References ASSERT, m_detector, and anonymous_namespace{InterferenceFunctionHardDisk.cpp}::p.
Referenced by Simulation2D::addMask(), Simulation2D::generateSimulationElements(), Simulation2D::maskAll(), Simulation2D::prepareSimulation(), Simulation2D::removeMasks(), Simulation2D::setDetectorParameters(), and Simulation2D::setRegionOfInterest().
const IDetector2D & Instrument::detector2D | ( | ) | const |
Definition at line 148 of file Instrument.cpp.
References ASSERT, m_detector, and anonymous_namespace{InterferenceFunctionHardDisk.cpp}::p.
const DetectorMask * Instrument::getDetectorMask | ( | ) | const |
Definition at line 94 of file Instrument.cpp.
References m_detector.
const IAxis & Instrument::getDetectorAxis | ( | size_t | index | ) | const |
Definition at line 157 of file Instrument.cpp.
References m_detector.
Referenced by OffSpecSimulation::intensityMapSize(), OffSpecSimulation::transferDetectorImage(), and OffSpecSimulation::transferResultsToIntensityMap().
size_t Instrument::getDetectorDimension | ( | ) | const |
Definition at line 162 of file Instrument.cpp.
References m_detector.
Referenced by OffSpecSimulation::transferDetectorImage(), and OffSpecSimulation::updateIntensityMap().
void Instrument::setDetector | ( | const IDetector & | detector | ) |
Sets the detector (axes can be overwritten later)
Definition at line 48 of file Instrument.cpp.
References IDetector::clone(), detector(), initDetector(), m_detector, and INode::registerChild().
Referenced by Instrument(), operator=(), DepthProbeSimulation::setBeamParameters(), Simulation2D::setDetector(), and SpecularSimulation::setScan().
void Instrument::setDetectorResolutionFunction | ( | const IResolutionFunction2D & | p_resolution_function | ) |
Sets detector resolution function.
Definition at line 72 of file Instrument.cpp.
References m_detector.
Referenced by Simulation::setDetectorResolutionFunction().
void Instrument::removeDetectorResolution | ( | ) |
Removes detector resolution function.
Definition at line 77 of file Instrument.cpp.
References m_detector.
Referenced by Simulation::removeDetectorResolutionFunction().
void Instrument::setAnalyzerProperties | ( | const kvector_t | direction, |
double | efficiency, | ||
double | total_transmission | ||
) |
Sets the polarization analyzer characteristics of the detector.
Definition at line 167 of file Instrument.cpp.
References m_detector.
Referenced by Simulation::setAnalyzerProperties().
void Instrument::applyDetectorResolution | ( | OutputData< double > * | p_intensity_map | ) | const |
apply the detector resolution to the given intensity map
Definition at line 82 of file Instrument.cpp.
References m_detector.
Referenced by OffSpecSimulation::transferDetectorImage().
void Instrument::initDetector | ( | ) |
init detector with beam settings
Definition at line 55 of file Instrument.cpp.
References getBeam(), and m_detector.
Referenced by GISASSimulation::prepareSimulation(), SpecularSimulation::prepareSimulation(), setBeam(), setBeamParameters(), and setDetector().
|
virtual |
Returns a vector of children (const).
Reimplemented from INode.
Definition at line 63 of file Instrument.cpp.
References m_beam, and m_detector.
|
virtualinherited |
Returns multiline string representing tree structure below the node.
Definition at line 53 of file INode.cpp.
References NodeUtils::nodeToString().
|
inherited |
Definition at line 58 of file INode.cpp.
References ASSERT, and INode::setParent().
Referenced by ParticleLayout::addAndRegisterAbstractParticle(), ParticleCoreShell::addAndRegisterCore(), MultiLayer::addAndRegisterInterface(), MultiLayer::addAndRegisterLayer(), ParticleCoreShell::addAndRegisterShell(), Layer::addLayout(), ParticleComposition::addParticlePointer(), Beam::Beam(), Crystal::Crystal(), IDetector::IDetector(), Simulation::initialize(), MesoCrystal::initialize(), Instrument(), Beam::operator=(), operator=(), Particle::Particle(), ParticleDistribution::ParticleDistribution(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), Simulation::setBackground(), InterferenceFunction1DLattice::setDecayFunction(), InterferenceFunction2DLattice::setDecayFunction(), setDetector(), IDetector::setDetectorResolution(), Beam::setFootprintFactor(), Particle::setFormFactor(), InterferenceFunctionFinite3DLattice::setLattice(), InterferenceFunction2DLattice::setLattice(), InterferenceFunction2DParaCrystal::setLattice(), InterferenceFunction2DSuperLattice::setLattice(), InterferenceFunctionFinite2DLattice::setLattice(), InterferenceFunctionRadialParaCrystal::setProbabilityDistribution(), InterferenceFunction2DParaCrystal::setProbabilityDistributions(), ConvolutionDetectorResolution::setResolutionFunction(), IParticle::setRotation(), LayerInterface::setRoughness(), and InterferenceFunction2DSuperLattice::setSubstructureIFF().
|
virtualinherited |
Reimplemented in SampleProvider.
Definition at line 69 of file INode.cpp.
References INode::m_parent.
Referenced by INode::registerChild(), SampleProvider::setBuilder(), and SampleProvider::setParent().
|
inherited |
Definition at line 74 of file INode.cpp.
References INode::m_parent.
Referenced by INode::copyNumber(), INode::createParameterTree(), NodeUtils::nodePath(), Lattice2D::onChange(), SampleProvider::setBuilder(), SampleProvider::setParent(), and SampleProvider::setSample().
|
inherited |
|
inherited |
Returns copyNumber of child, which takes into account existence of children with same name.
Definition at line 84 of file INode.cpp.
References INode::getChildren(), IParameterized::getName(), and INode::parent().
Referenced by INode::displayName().
|
inherited |
Returns display name, composed from the name of node and it's copy number.
Definition at line 105 of file INode.cpp.
References INode::copyNumber(), IParameterized::getName(), and INode::m_parent.
Referenced by NodeUtils::nodePath(), and anonymous_namespace{NodeUtils.cpp}::nodeString().
|
virtualinherited |
Creates new parameter pool, with all local parameters and those of its children.
Reimplemented from IParameterized.
Definition at line 116 of file INode.cpp.
References ParameterPool::copyToExternalPool(), NodeIterator< Strategy >::first(), NodeIterator< Strategy >::getCurrent(), NodeIterator< Strategy >::isDone(), NodeIterator< Strategy >::next(), NodeUtils::nodePath(), IParameterized::parameterPool(), and INode::parent().
Referenced by ParticleDistribution::generateParticles(), Simulation::runSimulation(), DepthProbeSimulation::validateParametrization(), OffSpecSimulation::validateParametrization(), and SpecularSimulation::validateParametrization().
|
inlineinherited |
Returns pointer to the parameter pool.
Definition at line 38 of file IParameterized.h.
References IParameterized::m_pool.
Referenced by pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), INode::createParameterTree(), INode::INode(), IParameterized::IParameterized(), anonymous_namespace{NodeUtils.cpp}::poolToString(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().
|
inherited |
Returns multiline string representing available parameters.
Definition at line 40 of file IParameterized.cpp.
References IParameterized::createParameterTree().
|
inherited |
Definition at line 48 of file IParameterized.cpp.
References IParameterized::getName(), IParameterized::m_pool, and IParameterized::onChange().
Referenced by BasicLattice::BasicLattice(), Beam::Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice::HexagonalLattice(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParameterized::registerVector(), ParticleLayout::registerWeight(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), Lattice2D::setRotationEnabled(), SquareLattice::SquareLattice(), and TriangularRippleBuilder::TriangularRippleBuilder().
|
inherited |
Definition at line 54 of file IParameterized.cpp.
References IParameterized::registerParameter(), RealParameter::setUnit(), IParameterized::XComponentName(), IParameterized::YComponentName(), and IParameterized::ZComponentName().
Referenced by Beam::Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), Lattice::registerBasisVectors(), and IParticle::registerPosition().
|
inherited |
Definition at line 62 of file IParameterized.cpp.
References IParameterized::createParameterTree(), IParameterized::m_pool, and ParameterPool::setMatchedParametersValue().
Referenced by AsymRippleBuilder::buildSample(), and IParameterized::setVectorValue().
|
inherited |
Definition at line 75 of file IParameterized.cpp.
References IParameterized::setParameterValue(), BasicVector3D< T >::x(), IParameterized::XComponentName(), BasicVector3D< T >::y(), IParameterized::YComponentName(), BasicVector3D< T >::z(), and IParameterized::ZComponentName().
|
inherited |
Returns parameter with given 'name'.
Definition at line 83 of file IParameterized.cpp.
References IParameterized::m_pool.
Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), IParticle::registerAbundance(), Lattice::registerBasisVectors(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and DistributionLogNormal::setUnits().
|
inlinevirtualinherited |
Action to be taken in inherited class when a parameter has changed.
Reimplemented in IProfileRipple, 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, InterferenceFunction3DLattice, InterferenceFunction2DLattice, Lattice, and Lattice2D.
Definition at line 58 of file IParameterized.h.
Referenced by Lattice2D::onChange(), and IParameterized::registerParameter().
|
inherited |
Definition at line 88 of file IParameterized.cpp.
References IParameterized::m_pool.
Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParameterized::removeVector(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 93 of file IParameterized.cpp.
References IParameterized::removeParameter(), IParameterized::XComponentName(), IParameterized::YComponentName(), and IParameterized::ZComponentName().
Referenced by IParticle::registerPosition().
|
staticinherited |
Definition at line 100 of file IParameterized.cpp.
Referenced by Lattice::registerBasisVectors(), IParticle::registerPosition(), IParameterized::registerVector(), IParameterized::removeVector(), and IParameterized::setVectorValue().
|
staticinherited |
Definition at line 105 of file IParameterized.cpp.
Referenced by IParameterized::registerVector(), IParameterized::removeVector(), and IParameterized::setVectorValue().
|
staticinherited |
Definition at line 110 of file IParameterized.cpp.
Referenced by IParameterized::registerVector(), IParameterized::removeVector(), and IParameterized::setVectorValue().
|
inlineinherited |
Definition at line 68 of file IParameterized.h.
References IParameterized::m_name.
Referenced by BasicLattice::BasicLattice(), Beam::Beam(), Layer::clone(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorBAPol::FormFactorBAPol(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorDWBA::FormFactorDWBA(), FormFactorDWBAPol::FormFactorDWBAPol(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice::HexagonalLattice(), IDetector::IDetector(), DepthProbeSimulation::initialize(), GISASSimulation::initialize(), OffSpecSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), INode::INode(), 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(), Lattice::Lattice(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), Beam::operator=(), SampleBuilderNode::operator=(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), SampleBuilderNode::reset(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SampleBuilderNode::setSBN(), SphericalDetector::SphericalDetector(), and SquareLattice::SquareLattice().
|
inlineinherited |
Definition at line 69 of file IParameterized.h.
References IParameterized::m_name.
Referenced by Beam::Beam(), Layer::clone(), IFormFactorBorn::computeSlicingEffects(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), INode::copyNumber(), IParameterized::createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineFormFactors(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), IDetector::IDetector(), Instrument(), IParameterized::IParameterized(), Beam::operator=(), SampleBuilderNode::operator=(), anonymous_namespace{ParticleLayout.cpp}::particleDensityIsProvidedByInterference(), IParameterized::registerParameter(), SampleBuilderNode::SampleBuilderNode(), and IFormFactor::sliceFormFactor().
|
protected |
Definition at line 93 of file Instrument.h.
Referenced by applyDetectorResolution(), detector(), detector2D(), getChildren(), getDetector(), getDetectorAxis(), getDetectorDimension(), getDetectorMask(), initDetector(), Instrument(), operator=(), removeDetectorResolution(), setAnalyzerProperties(), setBeam(), setBeamParameters(), setDetector(), and setDetectorResolutionFunction().
|
protected |
Definition at line 94 of file Instrument.h.
Referenced by getBeam(), getBeamIntensity(), getChildren(), Instrument(), operator=(), setBeam(), setBeamIntensity(), setBeamParameters(), and setBeamPolarization().
|
privateinherited |
Definition at line 81 of file INode.h.
Referenced by INode::displayName(), INode::parent(), and INode::setParent().
|
protectedinherited |
Definition at line 86 of file INode.h.
Referenced by INode::INode().
|
protectedinherited |
Definition at line 87 of file INode.h.
Referenced by INode::INode(), and IFootprintFactor::setWidthRatio().
|
privateinherited |
Definition at line 72 of file IParameterized.h.
Referenced by IParameterized::getName(), and IParameterized::setName().
|
privateinherited |
parameter pool (kind of pointer-to-implementation)
Definition at line 73 of file IParameterized.h.
Referenced by IParameterized::createParameterTree(), IParameterized::parameter(), IParameterized::parameterPool(), IParameterized::registerParameter(), IParameterized::removeParameter(), and IParameterized::setParameterValue().