BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DepthProbeElement Class Reference
Collaboration diagram for DepthProbeElement:
[legend]

Public Member Functions

 DepthProbeElement (const DepthProbeElement &other)
 
 DepthProbeElement (DepthProbeElement &&other) noexcept
 
 DepthProbeElement (double wavelength, double alpha_i, const IAxis *z_positions)
 
 ~DepthProbeElement ()
 
double getAlphaI () const
 
const std::valarray< double > & getIntensities () const
 
kvector_t getKi () const
 
const IAxisgetZPositions () const
 
bool isCalculated () const
 
DepthProbeElementoperator= (const DepthProbeElement &other)
 
void setCalculationFlag (bool calculation_flag)
 Set calculation flag (if it's false, zero intensity is assigned to the element) More...
 
template<typename T >
void setIntensities (T &&intensities)
 
void setZPositions (const IAxis *z_positions)
 
size_t size () const
 
double wavelength () const
 

Private Member Functions

void swapContent (DepthProbeElement &other)
 

Private Attributes

double m_alpha_i
 the wavelength and the incident angle of the beam More...
 
bool m_calculation_flag
 
std::valarray< double > m_intensities
 simulated intensity for the set of z positions More...
 
double m_wavelength
 
const IAxism_z_positions
 positions (lower z corresponds to a greater depth) More...
 

Detailed Description

Definition at line 29 of file DepthProbeElement.h.

Constructor & Destructor Documentation

◆ DepthProbeElement() [1/3]

DepthProbeElement::DepthProbeElement ( double  wavelength,
double  alpha_i,
const IAxis z_positions 
)

Definition at line 21 of file DepthProbeElement.cpp.

23  , m_alpha_i(alpha_i)
24  , m_z_positions(z_positions)
25  , m_calculation_flag(true)
26 {
27  if (!z_positions)
28  throw std::runtime_error(
29  "Error in DepthProbeElement::DepthProbeElement: z positions are not specified");
30  m_intensities.resize(z_positions->size(), 0.0);
31 }
const IAxis * m_z_positions
positions (lower z corresponds to a greater depth)
double m_alpha_i
the wavelength and the incident angle of the beam
double wavelength() const
std::valarray< double > m_intensities
simulated intensity for the set of z positions
virtual size_t size() const =0
retrieve the number of bins

References m_intensities, and IAxis::size().

Here is the call graph for this function:

◆ DepthProbeElement() [2/3]

DepthProbeElement::DepthProbeElement ( const DepthProbeElement other)

Definition at line 33 of file DepthProbeElement.cpp.

34  : m_wavelength(other.m_wavelength)
35  , m_alpha_i(other.m_alpha_i)
39 {
40 }

◆ DepthProbeElement() [3/3]

DepthProbeElement::DepthProbeElement ( DepthProbeElement &&  other)
noexcept

Definition at line 42 of file DepthProbeElement.cpp.

43  : m_wavelength(other.m_wavelength)
44  , m_alpha_i(other.m_alpha_i)
45  , m_intensities(std::move(other.m_intensities))
48 {
49 }

◆ ~DepthProbeElement()

DepthProbeElement::~DepthProbeElement ( )
default

Member Function Documentation

◆ getAlphaI()

double DepthProbeElement::getAlphaI ( ) const
inline

Definition at line 40 of file DepthProbeElement.h.

40 { return m_alpha_i; }

References m_alpha_i.

◆ getIntensities()

const std::valarray<double>& DepthProbeElement::getIntensities ( ) const
inline

Definition at line 51 of file DepthProbeElement.h.

51 { return m_intensities; }

References m_intensities.

◆ getKi()

kvector_t DepthProbeElement::getKi ( ) const

Definition at line 62 of file DepthProbeElement.cpp.

63 {
65 }
const double phi_i_0
kvector_t vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Definition: Direction.cpp:19

References m_alpha_i, m_wavelength, phi_i_0, and vecOfLambdaAlphaPhi().

Here is the call graph for this function:

◆ getZPositions()

const IAxis* DepthProbeElement::getZPositions ( ) const
inline

Definition at line 54 of file DepthProbeElement.h.

54 { return m_z_positions; }

References m_z_positions.

Referenced by DepthProbeComputationTerm::compute().

◆ isCalculated()

bool DepthProbeElement::isCalculated ( ) const
inline

Definition at line 60 of file DepthProbeElement.h.

60 { return m_calculation_flag; }

References m_calculation_flag.

Referenced by DepthProbeComputationTerm::compute().

◆ operator=()

DepthProbeElement & DepthProbeElement::operator= ( const DepthProbeElement other)

Definition at line 53 of file DepthProbeElement.cpp.

54 {
55  if (this != &other) {
56  DepthProbeElement tmp(other);
57  tmp.swapContent(*this);
58  }
59  return *this;
60 }

References swapContent().

Here is the call graph for this function:

◆ setCalculationFlag()

void DepthProbeElement::setCalculationFlag ( bool  calculation_flag)
inline

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

Definition at line 59 of file DepthProbeElement.h.

59 { m_calculation_flag = calculation_flag; }

References m_calculation_flag.

◆ setIntensities()

template<typename T >
void DepthProbeElement::setIntensities ( T &&  intensities)
inline

Definition at line 43 of file DepthProbeElement.h.

44  {
45  static_assert(
46  std::is_assignable<std::valarray<double>, typename std::decay<T>::type>::value,
47  "Error in DepthProbeElement::setIntensities: wrong type of input data.");
48  m_intensities = std::forward<T>(intensities);
49  }

References m_intensities.

Referenced by DepthProbeComputationTerm::compute().

◆ setZPositions()

void DepthProbeElement::setZPositions ( const IAxis z_positions)
inline

Definition at line 53 of file DepthProbeElement.h.

53 { m_z_positions = z_positions; }

References m_z_positions.

◆ size()

size_t DepthProbeElement::size ( ) const
inline

Definition at line 56 of file DepthProbeElement.h.

56 { return m_intensities.size(); }

References m_intensities.

◆ swapContent()

void DepthProbeElement::swapContent ( DepthProbeElement other)
private

Definition at line 67 of file DepthProbeElement.cpp.

68 {
71  m_intensities.swap(other.m_intensities);
74 }
void swap(OutputDataIterator< TValue, TContainer > &left, OutputDataIterator< TValue, TContainer > &right)
make Swappable

References m_alpha_i, m_calculation_flag, m_intensities, m_wavelength, m_z_positions, and swap().

Referenced by operator=().

Here is the call graph for this function:

◆ wavelength()

double DepthProbeElement::wavelength ( ) const
inline

Definition at line 39 of file DepthProbeElement.h.

39 { return m_wavelength; }

References m_wavelength.

Member Data Documentation

◆ m_alpha_i

double DepthProbeElement::m_alpha_i
private

the wavelength and the incident angle of the beam

Definition at line 65 of file DepthProbeElement.h.

Referenced by getAlphaI(), getKi(), and swapContent().

◆ m_calculation_flag

bool DepthProbeElement::m_calculation_flag
private

Definition at line 68 of file DepthProbeElement.h.

Referenced by isCalculated(), setCalculationFlag(), and swapContent().

◆ m_intensities

std::valarray<double> DepthProbeElement::m_intensities
private

simulated intensity for the set of z positions

Definition at line 66 of file DepthProbeElement.h.

Referenced by DepthProbeElement(), getIntensities(), setIntensities(), size(), and swapContent().

◆ m_wavelength

double DepthProbeElement::m_wavelength
private

Definition at line 65 of file DepthProbeElement.h.

Referenced by getKi(), swapContent(), and wavelength().

◆ m_z_positions

const IAxis* DepthProbeElement::m_z_positions
private

positions (lower z corresponds to a greater depth)

Definition at line 67 of file DepthProbeElement.h.

Referenced by getZPositions(), setZPositions(), and swapContent().


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