BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularSimulationElement.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Slice/SpecularSimulationElement.h
6 //! @brief Declares the class SpecularSimulationElement.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_CORE_MULTILAYER_SPECULARSIMULATIONELEMENT_H
16 #define BORNAGAIN_CORE_MULTILAYER_SPECULARSIMULATIONELEMENT_H
17 
19 #include "Base/Types/Complex.h"
20 #include "Base/Vector/Vectors3D.h"
21 #include <memory>
22 #include <vector>
23 
24 class Slice;
25 
26 //! Data stucture containing both input and output of a single image pixel for specular simulation.
27 //! @ingroup simulation
28 
30 {
31 public:
32  SpecularSimulationElement(double kz, bool computable);
33  SpecularSimulationElement(double wavelength, double alpha, bool computable);
34 
37 
39 
41 
42  //! Assigns PolarizationHandler.
43  void setPolarizationHandler(const PolarizationHandler& handler);
44 
45  //! Returns assigned PolarizationHandler.
47 
48  double getIntensity() const { return m_intensity; }
49  void setIntensity(double intensity) { m_intensity = intensity; }
50 
51  //! Returns calculation flag (if it's false, zero intensity is assigned to the element)
52  bool isCalculated() const { return m_computable; }
53 
54  //! Returns kz values for Abeles computation of reflection/transition coefficients
55  std::vector<complex_t> produceKz(const std::vector<Slice>& slices);
56 
57 private:
59 
61  double m_intensity; //!< simulated intensity for detector cell
62  const bool m_computable;
63  std::function<std::vector<complex_t>(const std::vector<Slice>&)> m_kz_computation;
64 };
65 
66 #endif // BORNAGAIN_CORE_MULTILAYER_SPECULARSIMULATIONELEMENT_H
Defines complex_t, and a few elementary functions.
Defines class PolarizationHandler.
Defines basic vectors in R^3 and C^3.
Convenience class for handling polarization density matrix and polarization analyzer operator.
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:28
Data stucture containing both input and output of a single image pixel for specular simulation.
bool isCalculated() const
Returns calculation flag (if it's false, zero intensity is assigned to the element)
std::vector< complex_t > produceKz(const std::vector< Slice > &slices)
Returns kz values for Abeles computation of reflection/transition coefficients.
SpecularSimulationElement(double kz, bool computable)
SpecularSimulationElement & operator=(const SpecularSimulationElement &other)
void setPolarizationHandler(const PolarizationHandler &handler)
Assigns PolarizationHandler.
void swapContent(SpecularSimulationElement &other)
std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
double m_intensity
simulated intensity for detector cell
void setIntensity(double intensity)
const PolarizationHandler & polarizationHandler() const
Returns assigned PolarizationHandler.