BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularSimulationElement Class Reference

Data stucture containing both input and output of a single image pixel for specular simulation. More...

Collaboration diagram for SpecularSimulationElement:
[legend]

Public Member Functions

 SpecularSimulationElement (const SpecularSimulationElement &other)
 
 SpecularSimulationElement (double kz, const Instrument &instrument, bool computable)
 
 SpecularSimulationElement (double wavelength, double alpha, const Instrument &instrument, bool computable)
 
 SpecularSimulationElement (SpecularSimulationElement &&other) noexcept
 
 ~SpecularSimulationElement ()
 
double intensity () const
 
bool isCalculated () const
 Returns calculation flag (if it's false, zero intensity is assigned to the element) More...
 
SpecularSimulationElementoperator= (const SpecularSimulationElement &other)=delete
 
const PolarizationHandlerpolarizationHandler () const
 Returns assigned PolarizationHandler. More...
 
std::vector< complex_tproduceKz (const std::vector< Slice > &slices)
 Returns kz values for Abeles computation of reflection/transition coefficients. More...
 
void setIntensity (double intensity)
 

Private Attributes

const bool m_computable
 
double m_intensity
 simulated intensity for detector cell More...
 
const std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
 
const PolarizationHandler m_polarization
 

Detailed Description

Data stucture containing both input and output of a single image pixel for specular simulation.

Definition at line 34 of file SpecularSimulationElement.h.

Constructor & Destructor Documentation

◆ SpecularSimulationElement() [1/4]

SpecularSimulationElement::SpecularSimulationElement ( double  kz,
const Instrument instrument,
bool  computable 
)

Definition at line 20 of file SpecularSimulationElement.cpp.

22  : m_polarization(instrument.beam().getPolarization(),
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 }
Eigen::Matrix2cd getPolarization() const
Returns the polarization density matrix (in spin basis along z-axis)
Definition: Beam.cpp:127
Eigen::Matrix2cd analyzerOperator() const
Return the polarization density matrix (in spin basis along z-axis)
const DetectionProperties & detectionProperties() const
Returns detection properties.
Definition: IDetector.h:82
IDetector & detector()
Definition: Instrument.cpp:107
Beam & beam()
Definition: Instrument.h:43
const PolarizationHandler m_polarization
const std::function< std::vector< complex_t >const std::vector< Slice > &)> m_kz_computation
double m_intensity
simulated intensity for detector cell
std::vector< complex_t > computeKzFromSLDs(const std::vector< Slice > &slices, double kz)

References KzComputation::computeKzFromSLDs().

Here is the call graph for this function:

◆ SpecularSimulationElement() [2/4]

SpecularSimulationElement::SpecularSimulationElement ( double  wavelength,
double  alpha,
const Instrument instrument,
bool  computable 
)

Definition at line 32 of file SpecularSimulationElement.cpp.

34  : m_polarization(instrument.beam().getPolarization(),
36  , m_intensity(0.0)
37  , m_computable(computable)
39  [k = vecOfLambdaAlphaPhi(wavelength, alpha, 0.0)](const std::vector<Slice>& slices) {
41  })
42 {
43 }
kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Definition: Direction.cpp:19
std::vector< complex_t > computeKzFromRefIndices(const std::vector< Slice > &slices, kvector_t k)

References KzComputation::computeKzFromRefIndices().

Here is the call graph for this function:

◆ SpecularSimulationElement() [3/4]

SpecularSimulationElement::SpecularSimulationElement ( const SpecularSimulationElement other)

Definition at line 45 of file SpecularSimulationElement.cpp.

47  , m_intensity(other.m_intensity)
48  , m_computable(other.m_computable)
50 {
51 }

◆ SpecularSimulationElement() [4/4]

SpecularSimulationElement::SpecularSimulationElement ( SpecularSimulationElement &&  other)
noexcept

Definition at line 53 of file SpecularSimulationElement.cpp.

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 }

◆ ~SpecularSimulationElement()

SpecularSimulationElement::~SpecularSimulationElement ( )
default

Member Function Documentation

◆ intensity()

double SpecularSimulationElement::intensity ( ) const
inline

Definition at line 50 of file SpecularSimulationElement.h.

50 { return m_intensity; }

References m_intensity.

Referenced by setIntensity().

◆ isCalculated()

bool SpecularSimulationElement::isCalculated ( ) const
inline

Returns calculation flag (if it's false, zero intensity is assigned to the element)

Definition at line 54 of file SpecularSimulationElement.h.

54 { return m_computable; }

References m_computable.

Referenced by SpecularComputationTerm::computeIntensity().

◆ operator=()

SpecularSimulationElement& SpecularSimulationElement::operator= ( const SpecularSimulationElement other)
delete

◆ polarizationHandler()

const PolarizationHandler& SpecularSimulationElement::polarizationHandler ( ) const
inline

Returns assigned PolarizationHandler.

Definition at line 48 of file SpecularSimulationElement.h.

48 { return m_polarization; }

References m_polarization.

◆ produceKz()

std::vector< complex_t > SpecularSimulationElement::produceKz ( const std::vector< Slice > &  slices)

Returns kz values for Abeles computation of reflection/transition coefficients.

Definition at line 63 of file SpecularSimulationElement.cpp.

64 {
65  return m_kz_computation(slices);
66 }

References m_kz_computation.

Referenced by SpecularScalarTerm::eval(), and SpecularMatrixTerm::eval().

◆ setIntensity()

void SpecularSimulationElement::setIntensity ( double  intensity)
inline

Definition at line 51 of file SpecularSimulationElement.h.

References intensity(), and m_intensity.

Referenced by SpecularScalarTerm::eval(), and SpecularMatrixTerm::eval().

Here is the call graph for this function:

Member Data Documentation

◆ m_computable

const bool SpecularSimulationElement::m_computable
private

Definition at line 62 of file SpecularSimulationElement.h.

Referenced by isCalculated().

◆ m_intensity

double SpecularSimulationElement::m_intensity
private

simulated intensity for detector cell

Definition at line 61 of file SpecularSimulationElement.h.

Referenced by intensity(), and setIntensity().

◆ m_kz_computation

const std::function<std::vector<complex_t>const std::vector<Slice>&)> SpecularSimulationElement::m_kz_computation
private

Definition at line 63 of file SpecularSimulationElement.h.

Referenced by produceKz().

◆ m_polarization

const PolarizationHandler SpecularSimulationElement::m_polarization
private

Definition at line 60 of file SpecularSimulationElement.h.

Referenced by polarizationHandler().


The documentation for this class was generated from the following files: