15 #ifndef BORNAGAIN_CORE_SIMULATION_SIMULATION2D_H
16 #define BORNAGAIN_CORE_SIMULATION_SIMULATION2D_H
45 double alpha_min,
double alpha_max);
69 virtual void initUnitConverter() {}
78 size_t n_elements)
override;
86 void normalize(
size_t start_ind,
size_t n_elements)
override;
88 void addBackgroundIntensity(
size_t start_ind,
size_t n_elements)
override;
90 void addDataToCache(
double weight)
override;
92 void moveDataFromCache()
override;
94 std::vector<SimulationElement> m_sim_elements;
95 std::vector<double> m_cache;
98 std::vector<double> rawResults()
const override;
99 void setRawResults(
const std::vector<double>& raw_data)
override;
100 std::unique_ptr<DetectorContext> m_detector_context;
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)
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.
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 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 maskAll()
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
void removeMasks()
removes all masks from the detector
void prepareSimulation() override
Put into a clean state for running a simulation.
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
Pure virtual base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.