15 #ifndef BORNAGAIN_SIM_SIMULATION_DEPTHPROBESIMULATION_H
16 #define BORNAGAIN_SIM_SIMULATION_DEPTHPROBESIMULATION_H
42 std::string
className() const final {
return "DepthProbeSimulation"; }
45 void setBeamParameters(
double lambda,
int nbins,
double alpha_i_min,
double alpha_i_max,
50 void setZSpan(
size_t n_bins,
double z_min,
double z_max);
89 size_t n_elements)
override;
102 void normalize(
size_t start_ind,
size_t n_elements)
override;
Defines and implements templated class Datafield.
Defines class DepthProbeElement.
Defines interface ISimulation2D.
An incident neutron or x-ray beam.
Simulation of radiation depth profile.
std::vector< DepthProbeElement > m_eles
bool force_polarized() const override
Force polarized computation even in absence of sample magnetization or external fields.
std::unique_ptr< IAxis > m_z_axis
void setBeamParameters(double lambda, int nbins, double alpha_i_min, double alpha_i_max, const IFootprintFactor *beam_shape=nullptr)
Sets beam parameters with alpha_i of the beam defined in the range.
void moveDataFromCache() override
void addDataToCache(double weight) override
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
void setZSpan(size_t n_bins, double z_min, double z_max)
Set z positions for intensity calculations. Negative z's correspond to the area under sample surface....
DepthProbeSimulation(const MultiLayer &sample)
void addBackgroundIntensity(size_t start_ind, size_t n_elements) override
std::unique_ptr< Datafield > createIntensityData() const
Creates intensity data from simulation elements.
~DepthProbeSimulation() override
double incidentAngle(size_t index) const
void initElementVector() override
Initializes the vector of ISimulation elements.
std::vector< DepthProbeElement > generateElements(const Beam &beam)
Generate simulation elements for given beam.
const IAxis * alphaAxis() const
Returns a pointer to incident angle axis.
ICoordSystem * createCoordSystem() const override
std::unique_ptr< IComputation > createComputation(const reSample &re_sample, size_t start, size_t n_elements) override
Generate a single threaded computation for a given range of simulation elements.
void validateParametrization(const ParameterDistribution &par_distr) const override
Checks the distribution validity for simulation.
void validityCheck() const
Checks if simulation data is ready for retrieval.
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.
size_t numberOfElements() const override
Gets the number of elements this simulation needs to calculate.
std::vector< std::valarray< double > > m_cache
std::unique_ptr< IAxis > m_alpha_axis
void prepareSimulation() override
Put into a clean state for running a simulation.
const IAxis * zAxis() const
Returns a pointer to z-position axis.
SimulationResult pack_result() override
Sets m_result.
size_t intensityMapSize() const override
Returns the total number of the intensity values in the simulation result.
Abstract base class for one-dimensional axes.
Interface for a single-threaded computation with given range of DiffuseElements and ProgressHandler.
Interface to provide axis translations to different units for simulation output.
Abstract base class of simulations that generate 2D patterns.
const MultiLayer * sample() const
Our sample model: a stack of layers one below the other.
A parametric distribution function, for use with any model parameter.
Wrapper around Datafield that also provides unit conversions.
Data structure that contains all the necessary data for scattering calculations.