BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
GISASSpecularComputation Class Referencefinal
Collaboration diagram for GISASSpecularComputation:

Public Member Functions

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

Private Attributes

const IFresnelMapmp_fresnel_map
 

Detailed Description

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

Used by DWBAComputation.

Definition at line 24 of file GISASSpecularComputation.h.

Constructor & Destructor Documentation

◆ GISASSpecularComputation()

GISASSpecularComputation::GISASSpecularComputation ( const IFresnelMap p_fresnel_map)

Definition at line 20 of file GISASSpecularComputation.cpp.

21  : mp_fresnel_map{p_fresnel_map}
22 {
23 }
const IFresnelMap * mp_fresnel_map

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 = mp_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  sin_alpha_i = 1.0;
33  const double solid_angle = elem.getSolidAngle();
34  if (solid_angle <= 0.0)
35  return;
36  const double intensity = std::norm(R) * sin_alpha_i / solid_angle;
37  elem.setIntensity(intensity);
38 }
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:41
double getSolidAngle() 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::getSolidAngle(), SimulationElement::isSpecular(), mp_fresnel_map, and SimulationElement::setIntensity().

Here is the call graph for this function:

Member Data Documentation

◆ mp_fresnel_map

const IFresnelMap* GISASSpecularComputation::mp_fresnel_map
private

Definition at line 32 of file GISASSpecularComputation.h.

Referenced by compute().


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