15 #ifndef BORNAGAIN_SIM_SIMULATION_OFFSPECSIMULATION_H
16 #define BORNAGAIN_SIM_SIMULATION_OFFSPECSIMULATION_H
36 std::string
className() const final {
return "OffspecSimulation"; }
Defines interface ISimulation2D.
An incident neutron or x-ray beam.
Stores radiation power per bin.
Abstract base class for one-dimensional axes.
Interface to provide axis translations to different units for simulation output.
Abstract detector interface.
Abstract base class of simulations that generate 2D patterns.
const MultiLayer * sample() const
Our sample model: a stack of layers one below the other.
Off-specular scattering simulation.
const IAxis * beamAxis() const
Returns axis of the beam.
std::unique_ptr< Datafield > m_intensity_map
void updateIntensityMap() override
Default implementation only adds the detector axes.
void transferDetectorImage(size_t index)
Normalize, apply detector resolution and transfer detector image corresponding to alpha_i = m_alpha_i...
OffspecSimulation(const Beam &beam, const MultiLayer &sample, const IDetector &detector)
size_t numberOfElements() const override
Gets the number of elements this simulation needs to calculate.
size_t intensityMapSize() const override
Returns the total number of the intensity values in the simulation result.
SimulationResult pack_result() override
Sets m_result.
void prepareSimulation() override
Put into a clean state for running a simulation.
ICoordSystem * createCoordSystem() const override
void validateParametrization(const ParameterDistribution &par_distr) const override
Checks the distribution validity for simulation.
std::unique_ptr< IAxis > m_alpha_i_axis
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
void setBeamParameters(double wavelength, const IAxis &alpha_axis, double phi_i)
Sets beam parameters from here (forwarded to Instrument)
void checkInitialization() const
Check correct number of axes.
~OffspecSimulation() override=default
void initElementVector() override
Initializes the vector of ISimulation elements.
A parametric distribution function, for use with any model parameter.
Wrapper around Datafield that also provides unit conversions.