BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularSimulationElement.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Element/SpecularSimulationElement.cpp
6 //! @brief Implements 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 
19 
21  bool computable)
22  : m_polarization(instrument.beam().getPolarization(),
23  instrument.detector().detectionProperties().analyzerOperator())
24  , m_intensity(0.0)
25  , m_computable(computable)
26  , m_kz_computation([kz](const std::vector<Slice>& slices) {
27  return KzComputation::computeKzFromSLDs(slices, kz);
28  })
29 {
30 }
31 
33  const Instrument& instrument, bool computable)
34  : m_polarization(instrument.beam().getPolarization(),
35  instrument.detector().detectionProperties().analyzerOperator())
36  , m_intensity(0.0)
37  , m_computable(computable)
38  , m_kz_computation(
39  [k = vecOfLambdaAlphaPhi(wavelength, alpha, 0.0)](const std::vector<Slice>& slices) {
41  })
42 {
43 }
44 
46  : m_polarization(other.m_polarization)
47  , m_intensity(other.m_intensity)
48  , m_computable(other.m_computable)
49  , m_kz_computation(other.m_kz_computation)
50 {
51 }
52 
54  : m_polarization(std::move(other.m_polarization))
55  , m_intensity(other.m_intensity)
56  , m_computable(other.m_computable)
57  , m_kz_computation(std::move(other.m_kz_computation))
58 {
59 }
60 
62 
63 std::vector<complex_t> SpecularSimulationElement::produceKz(const std::vector<Slice>& slices)
64 {
65  return m_kz_computation(slices);
66 }
kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Definition: Direction.cpp:19
Defines common detector interface.
Defines class Instrument.
Declares functions in namespace KzComputation.
Declares the class SpecularSimulationElement.
Assembles beam, detector and their relative positions with respect to the sample.
Definition: Instrument.h:32
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.
std::vector< complex_t > produceKz(const std::vector< Slice > &slices)
Returns kz values for Abeles computation of reflection/transition coefficients.
const std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
SpecularSimulationElement(double kz, const Instrument &instrument, bool computable)
std::vector< complex_t > computeKzFromRefIndices(const std::vector< Slice > &slices, kvector_t k)
std::vector< complex_t > computeKzFromSLDs(const std::vector< Slice > &slices, double kz)
Definition: filesystem.h:81