15 #ifndef BORNAGAIN_SIM_SIMULATION_ISIMULATION2D_H
16 #define BORNAGAIN_SIM_SIMULATION_ISIMULATION2D_H
82 size_t n_elements)
override;
90 void normalize(
size_t start_ind,
size_t n_elements)
override;
100 std::vector<std::unique_ptr<DiffuseElement>>
m_eles;
Defines interface ISimulation.
An incident neutron or x-ray beam.
Holds precalculated information for faster DiffuseElement generation.
Data stucture containing both input and output of a single detector cell.
Abstract detector interface.
Basic class for all shapes in 2D.
Abstract base class of simulations that generate 2D patterns.
std::unique_ptr< DetectorContext > m_detector_context
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.
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 setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
std::vector< const INode * > nodeChildren() const override
Returns all children.
bool force_polarized() const override
Force polarized computation even in absence of sample magnetization or external fields.
virtual void initCoordSystem()
std::vector< std::unique_ptr< DiffuseElement > > generateElements(const Beam &beam)
Generate simulation elements for given beam.
~ISimulation2D() override
std::unique_ptr< IDetector > m_detector
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
const Beam & beam() const
void prepareSimulation() override
Put into a clean state for running a simulation.
std::unique_ptr< Beam > m_beam
std::vector< double > m_cache
size_t numberOfElements() const override
Gets the number of elements this simulation needs to calculate.
std::vector< std::unique_ptr< DiffuseElement > > m_eles
void addBackgroundIntensity(size_t start_ind, size_t n_elements) override
void addDataToCache(double weight) override
const IDetector * getDetector() const
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks. The mask value 'true' means that the channel...
ISimulation2D(const Beam &beam, const MultiLayer &sample, const IDetector &detector)
const IDetector & detector() const
void initDistributionHandler() override
init callbacks for setting the parameter values
Abstract base class, holds the infrastructure to run a simulation.
const MultiLayer * sample() const
Our sample model: a stack of layers one below the other.
Data structure that contains all the necessary data for scattering calculations.