16 #ifndef BORNAGAIN_CORE_SIMULATION_ISIMULATION2D_H
17 #define BORNAGAIN_CORE_SIMULATION_ISIMULATION2D_H
52 double alpha_min,
double alpha_max);
82 size_t n_elements)
override;
90 void normalize(
size_t start_ind,
size_t n_elements)
override;
102 std::vector<double>
rawResults()
const override;
103 void setRawResults(
const std::vector<double>& raw_data)
override;
Defines interface ISimulation.
An incident neutron or x-ray beam.
Holds precalculated information for faster SimulationElement generation.
Abstract 2D detector interface.
Abstract detector interface.
Basic class for all shapes in 2D.
Abstract base class of OffSpecularSimulation and GISASSimulation.
std::unique_ptr< DetectorContext > m_detector_context
void setDetector(const IDetector2D &detector)
Sets the detector (axes can be overwritten later)
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.
size_t numberOfSimulationElements() const override
Gets the number of elements this simulation needs to calculate.
void setRawResults(const std::vector< double > &raw_data) override
ISimulation2D * clone() const override=0
void moveDataFromCache() override
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.
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::vector< SimulationElement > generateSimulationElements(const Beam &beam)
Generate simulation elements for given beam.
std::vector< double > rawResults() const override
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
IDetector2D & detector2D()
std::vector< SimulationElement > m_sim_elements
~ISimulation2D() override
virtual void initUnitConverter()
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
void prepareSimulation() override
Put into a clean state for running a simulation.
std::vector< double > m_cache
void addBackgroundIntensity(size_t start_ind, size_t n_elements) override
void addDataToCache(double weight) override
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks.
Abstract base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.
const MultiLayer * sample() const
Our sample model: a stack of layers one below the other.