BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Main class to run an off-specular simulation. More...
Public Member Functions | |
OffSpecularSimulation () | |
OffSpecularSimulation (const Beam &beam, const MultiLayer &sample, const IDetector &detector) | |
~OffSpecularSimulation () override | |
void | accept (INodeVisitor *visitor) const override |
Calls the INodeVisitor's visit method. More... | |
void | addMask (const IShape2D &shape, bool mask_value=true) |
Adds mask of given shape to the stack of detector masks. More... | |
void | addParameterDistribution (const ParameterDistribution &par_distr) |
void | addParameterDistribution (const std::string ¶m_name, const IDistribution1D &distribution, size_t nbr_samples, double sigma_factor=0.0, const RealLimits &limits=RealLimits()) |
const IBackground * | background () const |
Beam & | beam () |
const Beam & | beam () const |
const IAxis * | beamAxis () const |
Returns axis of the beam. More... | |
OffSpecularSimulation * | clone () const override |
SimulationResult | convertData (const OutputData< double > &data, bool put_masked_areas_to_zero=true) |
Convert user data to SimulationResult object for later drawing in various axes units. 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... | |
std::unique_ptr< IUnitConverter > | createUnitConverter () const |
IDetector & | detector () |
const IDetector & | detector () const |
IDetector2D & | detector2D () |
const IDetector2D & | detector2D () const |
std::string | displayName () const |
Returns display name, composed from the name of node and it's copy number. More... | |
std::vector< const INode * > | getChildren () const |
Returns a vector of children. More... | |
IDetector * | getDetector () |
const IDetector * | getDetector () const |
const DistributionHandler & | getDistributionHandler () const |
const std::string & | getName () const |
SimulationOptions & | getOptions () |
const SimulationOptions & | getOptions () const |
Instrument & | instrument () |
const Instrument & | instrument () const |
size_t | intensityMapSize () const override |
Returns the total number of the intensity values in the simulation result. More... | |
void | maskAll () |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis) More... | |
virtual void | onChange () |
Action to be taken in inherited class when a parameter has changed. More... | |
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 |
void | prepareSimulation () override |
Put into a clean state for running a simulation. More... | |
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) |
SimulationResult | result () const override |
Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays. More... | |
void | runMPISimulation () |
Run a simulation in a MPI environment. More... | |
void | runSimulation () |
Run a simulation, possibly averaged over parameter distributions. More... | |
const MultiLayer * | sample () const |
void | setBackground (const IBackground &bg) |
void | setBeamParameters (double wavelength, const IAxis &alpha_axis, double phi_i) |
Sets beam parameters from here (forwarded to Instrument) More... | |
void | setDetector (const IDetector2D &detector) |
Sets the detector (axes can be overwritten later) More... | |
void | setDetectorParameters (size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) |
Sets spherical detector parameters using angle ranges. More... | |
void | setDetectorResolutionFunction (const IResolutionFunction2D &resolution_function) |
void | setInstrument (const Instrument &instrument_) |
void | setName (const std::string &name) |
void | setOptions (const SimulationOptions &options) |
void | setParameterValue (const std::string &name, double value) |
virtual void | setParent (const INode *newParent) |
void | setRegionOfInterest (double xlow, double ylow, double xup, double yup) |
Sets rectangular region of interest with lower left and upper right corners defined. More... | |
void | setSample (const MultiLayer &sample) |
The MultiLayer object will not be owned by the ISimulation object. More... | |
void | setSampleBuilder (const std::shared_ptr< ISampleBuilder > &sample_builder) |
void | setTerminalProgressMonitor () |
Initializes a progress monitor that prints to stdout. More... | |
void | setVectorValue (const std::string &base_name, kvector_t value) |
void | subscribe (ProgressHandler::Callback_t inform) |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
virtual std::string | treeToString () const |
Returns multiline string representing tree structure below the node. More... | |
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 Member Functions | |
void | addBackgroundIntensity (size_t start_ind, size_t n_elements) override |
void | addDataToCache (double weight) override |
std::vector< SimulationElement > | generateSimulationElements (const Beam &beam) |
Generate simulation elements for given beam. More... | |
std::unique_ptr< IComputation > | generateSingleThreadedComputation (size_t start, size_t n_elements) override |
Generate a single threaded computation for a given range of simulation elements. More... | |
virtual void | initUnitConverter () |
void | moveDataFromCache () override |
void | normalize (size_t start_ind, size_t n_elements) override |
Normalize the detector counts to beam intensity, to solid angle, and to exposure angle. More... | |
const SimulationOptions & | options () const |
ProgressHandler & | progress () |
Protected Attributes | |
std::vector< double > | m_cache |
const size_t | m_NP |
std::vector< double > | m_P |
std::vector< SimulationElement > | m_sim_elements |
Private Member Functions | |
OffSpecularSimulation (const OffSpecularSimulation &other) | |
void | checkInitialization () const |
Check correct number of axes. More... | |
void | initialize () |
void | initSimulationElementVector () override |
Initializes the vector of ISimulation elements. More... | |
size_t | numberOfSimulationElements () const override |
Gets the number of elements this simulation needs to calculate. More... | |
std::vector< double > | rawResults () const override |
void | runSingleSimulation (size_t batch_start, size_t batch_size, double weight=1.0) |
Runs a single simulation with fixed parameter values. More... | |
void | setRawResults (const std::vector< double > &raw_data) override |
void | transferDetectorImage (size_t index) |
Normalize, apply detector resolution and transfer detector image corresponding to alpha_i = m_alpha_i_axis->bin(index) More... | |
void | transferResultsToIntensityMap () override |
Creates the appropriate data structure (e.g. More... | |
void | updateIntensityMap () override |
Default implementation only adds the detector axes. More... | |
void | validateParametrization (const ParameterDistribution &par_distr) const override |
Checks the distribution validity for simulation. More... | |
Private Attributes | |
std::unique_ptr< IAxis > | m_alpha_i_axis |
std::unique_ptr< IBackground > | m_background |
std::unique_ptr< DetectorContext > | m_detector_context |
DistributionHandler | m_distribution_handler |
Instrument | m_instrument |
OutputData< double > | m_intensity_map |
std::string | m_name |
SimulationOptions | m_options |
const INode * | m_parent {nullptr} |
std::unique_ptr< ParameterPool > | m_pool |
parameter pool (kind of pointer-to-implementation) More... | |
ProgressHandler | m_progress |
SampleProvider | m_sample_provider |
Main class to run an off-specular simulation.
Definition at line 26 of file OffSpecularSimulation.h.
OffSpecularSimulation::OffSpecularSimulation | ( | const Beam & | beam, |
const MultiLayer & | sample, | ||
const IDetector & | detector | ||
) |
Definition at line 22 of file OffSpecularSimulation.cpp.
OffSpecularSimulation::OffSpecularSimulation | ( | ) |
Definition at line 28 of file OffSpecularSimulation.cpp.
References initialize().
Referenced by clone().
|
inlineoverride |
Definition at line 30 of file OffSpecularSimulation.h.
|
private |
Definition at line 84 of file OffSpecularSimulation.cpp.
References OutputData< T >::copyFrom(), initialize(), m_alpha_i_axis, and m_intensity_map.
|
inlineoverridevirtual |
Calls the INodeVisitor's visit method.
Implements INode.
Definition at line 34 of file OffSpecularSimulation.h.
References INodeVisitor::visit().
|
overrideprotectedvirtualinherited |
Implements ISimulation.
Definition at line 151 of file ISimulation2D.cpp.
References ISimulation::background(), SimulationElement::intensity(), ISimulation2D::m_sim_elements, and SimulationElement::setIntensity().
|
overrideprotectedvirtualinherited |
Implements ISimulation.
Definition at line 161 of file ISimulation2D.cpp.
References ISimulation2D::m_cache, and ISimulation2D::m_sim_elements.
|
inherited |
Adds mask of given shape to the stack of detector masks.
The mask value 'true' means that the channel will be excluded from the simulation. The mask which is added last has priority.
Definition at line 60 of file ISimulation2D.cpp.
References IDetector2D::addMask(), and ISimulation2D::detector2D().
Referenced by StandardSimulations::GISASWithMasks(), StandardSimulations::RectDetWithRoi(), and StandardSimulations::SphericalDetWithRoi().
|
inherited |
Definition at line 272 of file ISimulation.cpp.
References DistributionHandler::addParameterDistribution(), ISimulation::m_distribution_handler, and ISimulation::validateParametrization().
|
inherited |
Definition at line 264 of file ISimulation.cpp.
Referenced by StandardSimulations::MiniGISASBeamDivergence(), and TransformToDomain::setBeamDistribution().
|
inlineinherited |
Definition at line 74 of file ISimulation.h.
References ISimulation::m_background.
Referenced by DepthProbeSimulation::addBackgroundIntensity(), ISimulation2D::addBackgroundIntensity(), SpecularSimulation::addBackgroundIntensity(), and TransformFromDomain::setBackground().
|
inlineinherited |
Definition at line 58 of file ISimulation.h.
References Instrument::beam(), and ISimulation::m_instrument.
Referenced by StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), DepthProbeSimulation::createUnitConverter(), createUnitConverter(), DepthProbeSimulation::generateSimulationElements(), ISimulation2D::generateSimulationElements(), DepthProbeSimulation::initialize(), DepthProbeSimulation::initSimulationElementVector(), GISASSimulation::initSimulationElementVector(), initSimulationElementVector(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), DepthProbeSimulation::normalize(), ISimulation2D::normalize(), SpecularSimulation::normalize(), result(), DepthProbeSimulation::setBeamParameters(), TransformFromDomain::setGISASBeamItem(), TransformFromDomain::setOffSpecularBeamItem(), and TransformFromDomain::setSpecularBeamItem().
|
inlineinherited |
Definition at line 59 of file ISimulation.h.
References Instrument::beam(), and ISimulation::m_instrument.
const IAxis * OffSpecularSimulation::beamAxis | ( | ) | const |
Returns axis of the beam.
Definition at line 64 of file OffSpecularSimulation.cpp.
References m_alpha_i_axis.
Referenced by createUnitConverter().
|
private |
Check correct number of axes.
Definition at line 161 of file OffSpecularSimulation.cpp.
References ISimulation::detector(), and m_alpha_i_axis.
Referenced by intensityMapSize(), numberOfSimulationElements(), prepareSimulation(), and transferResultsToIntensityMap().
|
inlineoverridevirtual |
Implements ISimulation2D.
Definition at line 32 of file OffSpecularSimulation.h.
References OffSpecularSimulation().
|
inherited |
Convert user data to SimulationResult object for later drawing in various axes units.
User data will be cropped to the ROI defined in the simulation, amplitudes in areas corresponding to the masked areas of the detector will be set to zero.
Definition at line 308 of file ISimulation.cpp.
References UnitConverterUtils::createConverter(), UnitConverterUtils::createOutputData(), ISimulation::detector(), SimulationAreaIterator::detectorIndex(), OutputData< T >::getRawDataVector(), IDetector::iterate(), and SimulationAreaIterator::roiIndex().
|
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(), validateParametrization(), and SpecularSimulation::validateParametrization().
std::unique_ptr< IUnitConverter > OffSpecularSimulation::createUnitConverter | ( | ) | const |
Definition at line 69 of file OffSpecularSimulation.cpp.
References ISimulation::beam(), beamAxis(), and ISimulation2D::detector2D().
|
inlineinherited |
Definition at line 63 of file ISimulation.h.
References Instrument::detector(), and ISimulation::m_instrument.
Referenced by SpecularSimulation::SpecularSimulation(), StandardSimulations::BasicGISAS00(), StandardSimulations::BasicPolarizedGISAS(), checkInitialization(), ISimulation::convertData(), ISimulation2D::generateSimulationElements(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), GISASSimulation::intensityMapSize(), intensityMapSize(), StandardSimulations::MaxiGISAS00(), StandardSimulations::MiniGISASPolarizationMM(), StandardSimulations::MiniGISASPolarizationMP(), StandardSimulations::MiniGISASPolarizationPM(), StandardSimulations::MiniGISASPolarizationPP(), GISASSimulation::prepareSimulation(), SpecularSimulation::prepareSimulation(), GISASSimulation::result(), DepthProbeSimulation::setBeamParameters(), ISimulation2D::setDetector(), ISimulation::setDetectorResolutionFunction(), SpecularSimulation::setScan(), transferDetectorImage(), transferResultsToIntensityMap(), and updateIntensityMap().
|
inlineinherited |
Definition at line 64 of file ISimulation.h.
References Instrument::detector(), and ISimulation::m_instrument.
|
inherited |
Definition at line 38 of file ISimulation2D.cpp.
References ASSERT, and ISimulation::getDetector().
Referenced by ISimulation2D::addMask(), createUnitConverter(), ISimulation2D::generateSimulationElements(), ISimulation2D::maskAll(), ISimulation2D::prepareSimulation(), result(), ISimulation2D::setDetectorParameters(), and ISimulation2D::setRegionOfInterest().
|
inherited |
Definition at line 46 of file ISimulation2D.cpp.
References ASSERT, and ISimulation::getDetector().
|
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().
|
protectedinherited |
Generate simulation elements for given beam.
Definition at line 111 of file ISimulation2D.cpp.
References Direction::alpha(), DetectionProperties::analyzerOperator(), ISimulation::beam(), IDetector::detectionProperties(), ISimulation::detector(), ISimulation2D::detector2D(), Beam::direction(), Beam::getPolarization(), ISimulation2D::m_detector_context, Direction::phi(), ISimulation::result(), and Beam::wavelength().
Referenced by GISASSimulation::initSimulationElementVector(), and initSimulationElementVector().
|
overrideprotectedvirtualinherited |
Generate a single threaded computation for a given range of simulation elements.
start | Index of the first element to include into computation |
n_elements | Number of elements to process |
Implements ISimulation.
Definition at line 100 of file ISimulation2D.cpp.
References DetectionProperties::analyzerDirection(), ASSERT, IDetector::detectionProperties(), ISimulation::detector(), ISimulation2D::m_sim_elements, ISimulation::options(), FormFactorPrecompute::polarized(), ISimulation::progress(), and ISimulation::sample().
|
virtualinherited |
Returns a vector of children.
Reimplemented from INode.
Definition at line 254 of file ISimulation.cpp.
References SampleProvider::getChildren(), ISimulation::instrument(), ISimulation::m_background, ISimulation::m_sample_provider, and ISimulation::result().
|
inlineinherited |
Definition at line 61 of file ISimulation.h.
References Instrument::getDetector(), and ISimulation::m_instrument.
Referenced by ISimulation2D::detector2D(), TransformFromDomain::setDetector(), and TransformFromDomain::setDetectorMasks().
|
inlineinherited |
Definition at line 62 of file ISimulation.h.
References Instrument::getDetector(), and ISimulation::m_instrument.
|
inlineinherited |
Definition at line 88 of file ISimulation.h.
References ISimulation::m_distribution_handler.
Referenced by TransformFromDomain::setGISASBeamItem().
|
inlineinherited |
Definition at line 70 of file IParametricComponent.h.
References IParametricComponent::m_name.
Referenced by Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), IDetector::IDetector(), Instrument::Instrument(), IParametricComponent::IParametricComponent(), SampleBuilderNode::SampleBuilderNode(), Layer::clone(), INode::copyNumber(), IParametricComponent::createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), Beam::operator=(), SampleBuilderNode::operator=(), GUIObjectBuilder::populateInstrumentModel(), PyImportAssistant::populateModels(), GUIDomainSampleVisitor::populateSampleModel(), IParametricComponent::registerParameter(), IFormFactor::sliceFormFactor(), and GUIDomainSampleVisitor::visit().
|
inlineinherited |
|
inlineinherited |
Definition at line 91 of file ISimulation.h.
References ISimulation::m_options.
Referenced by StandardSimulations::MiniGISASMonteCarlo(), StandardSimulations::MiniGISASSpecularPeak(), GUIObjectBuilder::populateDocumentModel(), and TransformToDomain::setSimulationOptions().
|
private |
Definition at line 171 of file OffSpecularSimulation.cpp.
References IParametricComponent::setName().
Referenced by OffSpecularSimulation().
|
overrideprivatevirtual |
Initializes the vector of ISimulation elements.
Implements ISimulation.
Definition at line 93 of file OffSpecularSimulation.cpp.
References ISimulation::beam(), ISimulation2D::generateSimulationElements(), m_alpha_i_axis, ISimulation2D::m_cache, ISimulation2D::m_sim_elements, and Beam::setInclination().
|
inlineprotectedvirtualinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 55 of file ISimulation.h.
References ISimulation::m_instrument.
Referenced by SpecularSimulation::SpecularSimulation(), ISimulation::getChildren(), SpecularSimulation::initialize(), SpecularSimulation::initSimulationElementVector(), GUIObjectBuilder::populateInstrumentModel(), GISASSimulation::prepareSimulation(), SpecularSimulation::prepareSimulation(), GISASSimulation::result(), DepthProbeSimulation::setBeamParameters(), setBeamParameters(), GISASSimulation::setBeamParameters(), ISimulation2D::setDetector(), and SpecularSimulation::setScan().
|
overridevirtual |
Returns the total number of the intensity values in the simulation result.
Implements ISimulation.
Definition at line 78 of file OffSpecularSimulation.cpp.
References IDetector::axis(), checkInitialization(), ISimulation::detector(), m_alpha_i_axis, and IAxis::size().
|
inherited |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
Definition at line 65 of file ISimulation2D.cpp.
References ISimulation2D::detector2D(), and IDetector2D::maskAll().
Referenced by StandardSimulations::GISASWithMasks().
|
overrideprotectedvirtualinherited |
Implements ISimulation.
Definition at line 170 of file ISimulation2D.cpp.
References ASSERT, ISimulation2D::m_cache, and ISimulation2D::m_sim_elements.
|
overrideprotectedvirtualinherited |
Normalize the detector counts to beam intensity, to solid angle, and to exposure angle.
start_ind | Index of the first element to operate on |
n_elements | Number of elements to process |
Implements ISimulation.
Definition at line 136 of file ISimulation2D.cpp.
References ISimulation::beam(), SimulationElement::getAlphaI(), SimulationElement::intensity(), Beam::intensity(), ISimulation2D::m_sim_elements, SimulationElement::setIntensity(), and SimulationElement::solidAngle().
|
overrideprivatevirtual |
Gets the number of elements this simulation needs to calculate.
Reimplemented from ISimulation2D.
Definition at line 39 of file OffSpecularSimulation.cpp.
References checkInitialization(), m_alpha_i_axis, and ISimulation2D::numberOfSimulationElements().
|
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().
|
inlineprotectedinherited |
Definition at line 124 of file ISimulation.h.
References ISimulation::m_options.
Referenced by DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), and ISimulation::setOptions().
|
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().
|
overridevirtual |
Put into a clean state for running a simulation.
Reimplemented from ISimulation2D.
Definition at line 33 of file OffSpecularSimulation.cpp.
References checkInitialization(), and ISimulation2D::prepareSimulation().
|
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().
|
inlineprotectedinherited |
Definition at line 125 of file ISimulation.h.
References ISimulation::m_progress.
Referenced by DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), and SpecularSimulation::generateSingleThreadedComputation().
|
overrideprivatevirtualinherited |
Implements ISimulation.
Definition at line 180 of file ISimulation2D.cpp.
References ISimulation2D::m_sim_elements, and ISimulation::result().
|
inherited |
Definition at line 57 of file INode.cpp.
References ASSERT, and INode::setParent().
Referenced by Beam::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(), Beam::operator=(), Instrument::operator=(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), ISimulation::setBackground(), InterferenceFunction1DLattice::setDecayFunction(), InterferenceFunction2DLattice::setDecayFunction(), Instrument::setDetector(), IDetector::setDetectorResolution(), Beam::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::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::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().
|
overridevirtual |
Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays.
Implements ISimulation.
Definition at line 45 of file OffSpecularSimulation.cpp.
References ISimulation::beam(), OutputData< T >::clone(), ISimulation2D::detector2D(), m_alpha_i_axis, and m_intensity_map.
|
inherited |
Run a simulation in a MPI environment.
Definition at line 226 of file ISimulation.cpp.
References MPISimulation::runSimulation().
|
inherited |
Run a simulation, possibly averaged over parameter distributions.
Run simulation with possible averaging over parameter distributions.
Definition at line 193 of file ISimulation.cpp.
References INode::createParameterTree(), SimulationOptions::getCurrentBatch(), SimulationOptions::getNumberOfBatches(), DistributionHandler::getTotalNumberOfSamples(), ISimulation::m_distribution_handler, ISimulation::m_options, ISimulation::m_progress, ISimulation::moveDataFromCache(), ISimulation::numberOfSimulationElements(), ISimulation::prepareSimulation(), ProgressHandler::reset(), ISimulation::runSingleSimulation(), ProgressHandler::setExpectedNTicks(), DistributionHandler::setParameterToMeans(), DistributionHandler::setParameterValues(), and ISimulation::transferResultsToIntensityMap().
Referenced by JobWorker::start().
|
privateinherited |
Runs a single simulation with fixed parameter values.
If desired, the simulation is run in several threads.
Definition at line 280 of file ISimulation.cpp.
References ISimulation::addBackgroundIntensity(), ISimulation::addDataToCache(), ASSERT, ISimulation::generateSingleThreadedComputation(), SimulationOptions::getNumberOfThreads(), ISimulation::initSimulationElementVector(), ISimulation::m_options, and ISimulation::normalize().
Referenced by ISimulation::runSimulation().
|
inherited |
Definition at line 238 of file ISimulation.cpp.
References ISimulation::m_sample_provider, and SampleProvider::sample().
Referenced by ISimulation::ISimulation(), DepthProbeSimulation::generateSingleThreadedComputation(), ISimulation2D::generateSingleThreadedComputation(), SpecularSimulation::generateSingleThreadedComputation(), ISimulation::setSample(), and DepthProbeSimulation::validityCheck().
|
inherited |
Definition at line 248 of file ISimulation.cpp.
References IBackground::clone(), ISimulation::m_background, and INode::registerChild().
Referenced by ISimulation::ISimulation(), and StandardSimulations::ConstantBackgroundGISAS().
void OffSpecularSimulation::setBeamParameters | ( | double | wavelength, |
const IAxis & | alpha_axis, | ||
double | phi_i | ||
) |
Sets beam parameters from here (forwarded to Instrument)
Definition at line 52 of file OffSpecularSimulation.cpp.
References IAxis::clone(), ISimulation::instrument(), IAxis::lowerBound(), m_alpha_i_axis, Instrument::setBeamParameters(), IAxis::size(), and updateIntensityMap().
|
inherited |
Sets the detector (axes can be overwritten later)
Definition at line 94 of file ISimulation2D.cpp.
References ISimulation::detector(), ISimulation2D::initUnitConverter(), ISimulation::instrument(), and Instrument::setDetector().
|
inherited |
Sets spherical detector parameters using angle ranges.
n_phi | number of phi-axis bins |
phi_min | low edge of first phi-bin |
phi_max | upper edge of last phi-bin |
n_alpha | number of alpha-axis bins |
alpha_min | low edge of first alpha-bin |
alpha_max | upper edge of last alpha-bin |
Definition at line 87 of file ISimulation2D.cpp.
References ISimulation2D::detector2D(), IDetector2D::setDetectorParameters(), and ISimulation::updateIntensityMap().
Referenced by StandardSimulations::MiniGISASFit().
|
inherited |
Definition at line 177 of file ISimulation.cpp.
References ISimulation::detector(), and IDetector::setResolutionFunction().
Referenced by StandardSimulations::MiniGISASDetectorResolution().
|
inherited |
Definition at line 158 of file ISimulation.cpp.
References ISimulation::m_instrument, and ISimulation::updateIntensityMap().
|
inlineinherited |
Definition at line 69 of file IParametricComponent.h.
References IParametricComponent::m_name, and RealSpace::Particles::name().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::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(), initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), Beam::operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().
|
inlineinherited |
Definition at line 90 of file ISimulation.h.
References ISimulation::m_options, and ISimulation::options().
|
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().
|
overrideprivatevirtualinherited |
Implements ISimulation.
Definition at line 189 of file ISimulation2D.cpp.
References ISimulation::initSimulationElementVector(), ISimulation2D::m_sim_elements, and ISimulation::transferResultsToIntensityMap().
|
inherited |
Sets rectangular region of interest with lower left and upper right corners defined.
Definition at line 70 of file ISimulation2D.cpp.
References ISimulation2D::detector2D(), and IDetector2D::setRegionOfInterest().
Referenced by StandardSimulations::RectDetWithRoi(), and StandardSimulations::SphericalDetWithRoi().
|
inherited |
The MultiLayer object will not be owned by the ISimulation object.
Definition at line 233 of file ISimulation.cpp.
References ISimulation::m_sample_provider, ISimulation::sample(), and SampleProvider::setSample().
Referenced by ISimulation::ISimulation().
|
inherited |
Definition at line 243 of file ISimulation.cpp.
References ISimulation::m_sample_provider, and SampleProvider::setBuilder().
|
inherited |
Initializes a progress monitor that prints to stdout.
Definition at line 166 of file ISimulation.cpp.
References ISimulation::m_progress, and ProgressHandler::subscribe().
|
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().
|
inlineinherited |
Definition at line 94 of file ISimulation.h.
References ISimulation::m_progress, and ProgressHandler::subscribe().
Referenced by JobWorker::start().
|
private |
Normalize, apply detector resolution and transfer detector image corresponding to alpha_i = m_alpha_i_axis->bin(index)
Definition at line 146 of file OffSpecularSimulation.cpp.
References OutputData< T >::addAxis(), IDetector::applyDetectorResolution(), IDetector::axis(), ISimulation::detector(), IDetector::dimension(), OutputData< T >::getAllocatedSize(), m_intensity_map, ISimulation2D::m_sim_elements, and IAxis::size().
Referenced by transferResultsToIntensityMap().
|
overrideprivatevirtual |
Creates the appropriate data structure (e.g.
2D intensity map) from the calculated SimulationElement objects
Reimplemented from ISimulation.
Definition at line 122 of file OffSpecularSimulation.cpp.
References IDetector::axis(), checkInitialization(), ISimulation::detector(), OutputData< T >::getAllocatedSize(), m_alpha_i_axis, m_intensity_map, ISimulation2D::m_sim_elements, IAxis::size(), and transferDetectorImage().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 34 of file ICloneable.h.
|
virtualinherited |
Returns multiline string representing tree structure below the node.
Definition at line 52 of file INode.cpp.
References NodeUtils::nodeToString().
|
overrideprivatevirtual |
Default implementation only adds the detector axes.
Reimplemented from ISimulation.
Definition at line 135 of file OffSpecularSimulation.cpp.
References OutputData< T >::addAxis(), OutputData< T >::clear(), ISimulation::detector(), IDetector::dimension(), m_alpha_i_axis, m_intensity_map, and OutputData< T >::setAllTo().
Referenced by setBeamParameters().
|
overrideprivatevirtual |
Checks the distribution validity for simulation.
Reimplemented from ISimulation.
Definition at line 107 of file OffSpecularSimulation.cpp.
References INode::createParameterTree(), ParameterDistribution::getDistribution(), ParameterDistribution::getMainParameterName(), and IDistribution1D::getMean().
|
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 84 of file OffSpecularSimulation.h.
Referenced by OffSpecularSimulation(), beamAxis(), checkInitialization(), initSimulationElementVector(), intensityMapSize(), numberOfSimulationElements(), result(), setBeamParameters(), transferResultsToIntensityMap(), and updateIntensityMap().
|
privateinherited |
Definition at line 161 of file ISimulation.h.
Referenced by ISimulation::ISimulation(), ISimulation::background(), ISimulation::getChildren(), and ISimulation::setBackground().
|
protectedinherited |
Definition at line 99 of file ISimulation2D.h.
Referenced by ISimulation2D::addDataToCache(), GISASSimulation::initSimulationElementVector(), initSimulationElementVector(), and ISimulation2D::moveDataFromCache().
|
privateinherited |
Definition at line 104 of file ISimulation2D.h.
Referenced by ISimulation2D::generateSimulationElements(), ISimulation2D::numberOfSimulationElements(), and ISimulation2D::prepareSimulation().
|
privateinherited |
Definition at line 159 of file ISimulation.h.
Referenced by ISimulation::addParameterDistribution(), ISimulation::getDistributionHandler(), and ISimulation::runSimulation().
|
privateinherited |
Definition at line 160 of file ISimulation.h.
Referenced by ISimulation::beam(), ISimulation::detector(), ISimulation::getDetector(), ISimulation::initialize(), ISimulation::instrument(), and ISimulation::setInstrument().
|
private |
Definition at line 85 of file OffSpecularSimulation.h.
Referenced by OffSpecularSimulation(), result(), transferDetectorImage(), transferResultsToIntensityMap(), and updateIntensityMap().
|
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().
|
privateinherited |
Definition at line 156 of file ISimulation.h.
Referenced by ISimulation::getOptions(), ISimulation::options(), ISimulation::runSimulation(), ISimulation::runSingleSimulation(), and ISimulation::setOptions().
|
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().
|
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().
|
privateinherited |
Definition at line 157 of file ISimulation.h.
Referenced by ISimulation::progress(), ISimulation::runSimulation(), ISimulation::setTerminalProgressMonitor(), and ISimulation::subscribe().
|
privateinherited |
Definition at line 158 of file ISimulation.h.
Referenced by ISimulation::getChildren(), ISimulation::initialize(), ISimulation::prepareSimulation(), ISimulation::sample(), ISimulation::setSample(), and ISimulation::setSampleBuilder().
|
protectedinherited |
Definition at line 98 of file ISimulation2D.h.
Referenced by ISimulation2D::addBackgroundIntensity(), ISimulation2D::addDataToCache(), ISimulation2D::generateSingleThreadedComputation(), GISASSimulation::initSimulationElementVector(), initSimulationElementVector(), ISimulation2D::moveDataFromCache(), ISimulation2D::normalize(), ISimulation2D::rawResults(), GISASSimulation::result(), ISimulation2D::setRawResults(), transferDetectorImage(), and transferResultsToIntensityMap().