BornAgain  1.19.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 reflection and scattering
4 //
5 //! @file Core/Element/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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_CORE_ELEMENT_SPECULARSIMULATIONELEMENT_H
21 #define BORNAGAIN_CORE_ELEMENT_SPECULARSIMULATIONELEMENT_H
22 
24 #include "Base/Vector/Vectors3D.h"
25 #include <memory>
26 #include <vector>
27 
28 class Instrument;
29 class Slice;
30 
31 //! Data stucture containing both input and output of a single image pixel for specular simulation.
32 //! @ingroup simulation
33 
35 public:
36  SpecularSimulationElement(double kz, const Instrument& instrument, bool computable);
37  SpecularSimulationElement(double wavelength, double alpha, const Instrument& instrument,
38  bool computable);
39 
42 
44 
46 
47  //! Returns assigned PolarizationHandler.
49 
50  double intensity() const { return m_intensity; }
52 
53  //! Returns calculation flag (if it's false, zero intensity is assigned to the element)
54  bool isCalculated() const { return m_computable; }
55 
56  //! Returns kz values for Abeles computation of reflection/transition coefficients
57  std::vector<complex_t> produceKz(const std::vector<Slice>& slices);
58 
59 private:
61  double m_intensity; //!< simulated intensity for detector cell
62  const bool m_computable;
63  const std::function<std::vector<complex_t>(const std::vector<Slice>&)> m_kz_computation;
64 };
65 
66 #endif // BORNAGAIN_CORE_ELEMENT_SPECULARSIMULATIONELEMENT_H
67 #endif // USER_API
Defines class PolarizationHandler.
Defines basic vectors in Z^3, R^3, C^3.
Assembles beam, detector and their relative positions with respect to the sample.
Definition: Instrument.h:32
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:32
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.
const PolarizationHandler m_polarization
SpecularSimulationElement & operator=(const SpecularSimulationElement &other)=delete
const std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
SpecularSimulationElement(double kz, const Instrument &instrument, bool computable)
double m_intensity
simulated intensity for detector cell
void setIntensity(double intensity)
const PolarizationHandler & polarizationHandler() const
Returns assigned PolarizationHandler.