BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
GISASSpecularComputation Class Referencefinal

Computes the specular signal in the bin where q_parallel = 0. More...

Collaboration diagram for GISASSpecularComputation:
[legend]

Public Member Functions

 GISASSpecularComputation (const IFresnelMap *p_fresnel_map)
 
void compute (SimulationElement &elem) const
 

Private Attributes

const IFresnelMapm_fresnel_map
 

Detailed Description

Computes the specular signal in the bin where q_parallel = 0.

Used by DWBAComputation.

Definition at line 29 of file GISASSpecularComputation.h.

Constructor & Destructor Documentation

◆ GISASSpecularComputation()

GISASSpecularComputation::GISASSpecularComputation ( const IFresnelMap p_fresnel_map)

Definition at line 20 of file GISASSpecularComputation.cpp.

21  : m_fresnel_map{p_fresnel_map}
22 {
23 }

Member Function Documentation

◆ compute()

void GISASSpecularComputation::compute ( SimulationElement elem) const

Definition at line 25 of file GISASSpecularComputation.cpp.

26 {
27  if (!elem.isSpecular())
28  return;
29  complex_t R = m_fresnel_map->getInCoefficients(elem, 0)->getScalarR();
30  double sin_alpha_i = std::abs(std::sin(elem.getAlphaI()));
31  if (sin_alpha_i == 0.0) {
32  elem.setIntensity(0);
33  return;
34  }
35  const double solid_angle = elem.solidAngle();
36  if (solid_angle <= 0.0)
37  return;
38  const double intensity = std::norm(R) * sin_alpha_i / solid_angle;
39  elem.setIntensity(intensity);
40 }
std::complex< double > complex_t
Definition: Complex.h:20
std::unique_ptr< const ILayerRTCoefficients > getInCoefficients(const T &sim_element, size_t layer_index) const
Retrieves the amplitude coefficients for an incoming wavevector.
Definition: IFresnelMap.h:45
double solidAngle() const
double getAlphaI() const
void setIntensity(double intensity)
bool isSpecular() const
Tells if simulation element corresponds to a specular peak.

References SimulationElement::getAlphaI(), IFresnelMap::getInCoefficients(), SimulationElement::isSpecular(), m_fresnel_map, SimulationElement::setIntensity(), and SimulationElement::solidAngle().

Here is the call graph for this function:

Member Data Documentation

◆ m_fresnel_map

const IFresnelMap* GISASSpecularComputation::m_fresnel_map
private

Definition at line 36 of file GISASSpecularComputation.h.

Referenced by compute().


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