15 #ifndef BORNAGAIN_CORE_SIMULATION_SIMULATION2D_H
16 #define BORNAGAIN_CORE_SIMULATION_SIMULATION2D_H
45 double alpha_min,
double alpha_max);
78 size_t n_elements)
override;
86 void normalize(
size_t start_ind,
size_t n_elements)
override;
98 std::vector<double>
rawResults()
const override;
99 void setRawResults(
const std::vector<double>& raw_data)
override;
Defines class Simulation.
Beam defined by wavelength, direction and intensity.
Holds precalculated information for faster SimulationElement generation.
Abstract 2D detector interface.
Basic class for all shapes in 2D.
Pure virtual base class of OffSpecularSimulation and GISASSimulation.
size_t numberOfSimulationElements() const override
Gets the number of elements this simulation needs to calculate.
void setDetector(const IDetector2D &detector)
Sets the detector (axes can be overwritten later)
Simulation2D * clone() const override=0
std::vector< double > m_cache
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.
std::vector< SimulationElement > m_sim_elements
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.
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks.
void addBackgroundIntensity(size_t start_ind, size_t n_elements) 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.
std::vector< SimulationElement > generateSimulationElements(const Beam &beam)
Generate simulation elements for given beam.
void setRawResults(const std::vector< double > &raw_data) override
std::unique_ptr< DetectorContext > m_detector_context
void maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
void removeMasks()
removes all masks from the detector
virtual void initUnitConverter()
void prepareSimulation() override
Put into a clean state for running a simulation.
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.
void addDataToCache(double weight) override
Pure virtual base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.