BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GISASBeamItem Class Reference

Description

Definition at line 94 of file BeamItems.h.

Inheritance diagram for GISASBeamItem:
[legend]
Collaboration diagram for GISASBeamItem:
[legend]

Public Member Functions

 GISASBeamItem ()
 
BeamAzimuthalAngleItemazimuthalAngleItem () const
 
std::unique_ptr< Beam > createBeam () const
 
 DOUBLE_PROPERTY (intensity, Intensity)
 
double getAzimuthalAngle () const
 
double getInclinationAngle () const override
 
virtual BeamDistributionIteminclinationAngleItem () const
 
virtual void serialize (Streamer &s)
 
void setAzimuthalAngle (double value)
 
virtual void setInclinationAngle (double value)
 
void setInclinationAngleGetter (std::function< double()> getter)
 Explicitly set a getter function for the inclination angle. More...
 
void setWavelength (double value)
 
double wavelength () const
 
BeamWavelengthItemwavelengthItem () const
 

Public Attributes

std::function< double()> m_inclinationAngleGetter
 

Protected Member Functions

template<typename T >
void initInclinationAngle ()
 
template<typename T >
void initWavelength ()
 

Protected Attributes

std::unique_ptr< BeamAzimuthalAngleItemm_azimuthalAngleItem
 
std::unique_ptr< BeamDistributionItemm_inclinationAngleItem
 
std::unique_ptr< BeamWavelengthItemm_wavelengthItem
 

Constructor & Destructor Documentation

◆ GISASBeamItem()

GISASBeamItem::GISASBeamItem ( )

Definition at line 208 of file BeamItems.cpp.

209 {
210  initInclinationAngle<BeamInclinationAngleItem>();
211  initWavelength<BeamWavelengthItem>();
212 }

Member Function Documentation

◆ azimuthalAngleItem()

BeamAzimuthalAngleItem * BeamItem::azimuthalAngleItem ( ) const
inherited

Definition at line 92 of file BeamItems.cpp.

93 {
94  return m_azimuthalAngleItem.get();
95 }
std::unique_ptr< BeamAzimuthalAngleItem > m_azimuthalAngleItem
Definition: BeamItems.h:65

References BeamItem::m_azimuthalAngleItem.

Referenced by GISASBeamEditor::GISASBeamEditor().

◆ createBeam()

std::unique_ptr< Beam > BeamItem::createBeam ( ) const
inherited

Definition at line 97 of file BeamItems.cpp.

98 {
99  double lambda = wavelength();
100  double inclination_angle = Units::deg2rad(getInclinationAngle());
101  double azimuthal_angle = Units::deg2rad(getAzimuthalAngle());
102 
103  auto result =
104  std::make_unique<Beam>(intensity(), lambda, Direction(inclination_angle, azimuthal_angle));
105 
106  return result;
107 }
double wavelength() const
Definition: BeamItems.cpp:57
virtual double getInclinationAngle() const =0
double getAzimuthalAngle() const
Definition: BeamItems.cpp:82

References BeamItem::getAzimuthalAngle(), BeamItem::getInclinationAngle(), and BeamItem::wavelength().

Referenced by SpecularInstrumentItem::createCoordSystem(), Instrument2DItem::createInstrument(), Instrument2DItem::createOffspecSimulation(), and Instrument2DItem::createScatteringSimulation().

Here is the call graph for this function:

◆ DOUBLE_PROPERTY()

BeamItem::DOUBLE_PROPERTY ( intensity  ,
Intensity   
)
inherited

◆ getAzimuthalAngle()

double BeamItem::getAzimuthalAngle ( ) const
inherited

Definition at line 82 of file BeamItems.cpp.

83 {
84  return m_azimuthalAngleItem->azimuthalAngle();
85 }

References BeamItem::m_azimuthalAngleItem.

Referenced by BeamItem::createBeam().

◆ getInclinationAngle()

double GISASBeamItem::getInclinationAngle ( ) const
overridevirtual

Implements BeamItem.

Definition at line 214 of file BeamItems.cpp.

215 {
219  ->inclinationAngle();
220 }
virtual BeamDistributionItem * inclinationAngleItem() const
Definition: BeamItems.cpp:77
std::function< double()> m_inclinationAngleGetter
Definition: BeamItems.h:107

References BeamItem::inclinationAngleItem(), and m_inclinationAngleGetter.

Here is the call graph for this function:

◆ inclinationAngleItem()

BeamDistributionItem * BeamItem::inclinationAngleItem ( ) const
virtualinherited

Reimplemented in SpecularBeamItem.

Definition at line 77 of file BeamItems.cpp.

78 {
79  return m_inclinationAngleItem.get();
80 }
std::unique_ptr< BeamDistributionItem > m_inclinationAngleItem
Definition: BeamItems.h:66

References BeamItem::m_inclinationAngleItem.

Referenced by GISASBeamEditor::GISASBeamEditor(), getInclinationAngle(), and SpecularBeamItem::inclinationAngleItem().

◆ initInclinationAngle()

template<typename T >
void BeamItem::initInclinationAngle
protectedinherited

Definition at line 116 of file BeamItems.cpp.

117 {
118  m_inclinationAngleItem.reset(new T());
119 }

References BeamItem::m_inclinationAngleItem.

◆ initWavelength()

template<typename T >
void BeamItem::initWavelength
protectedinherited

Definition at line 110 of file BeamItems.cpp.

111 {
112  m_wavelengthItem.reset(new T());
113 }
std::unique_ptr< BeamWavelengthItem > m_wavelengthItem
Definition: BeamItems.h:64

References BeamItem::m_wavelengthItem.

◆ serialize()

void BeamItem::serialize ( Streamer s)
virtualinherited

Reimplemented in SpecularBeamItem.

Definition at line 48 of file BeamItems.cpp.

49 {
50  s.assertVersion(0);
51  Serialize::rwProperty(s, m_intensity);
52  Serialize::rwClass(s, "wavelength", *m_wavelengthItem);
54  Serialize::rwClass(s, "inclination", *m_inclinationAngleItem);
55 }
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
Definition: Streamer.cpp:26
void rwProperty(Streamer &s, DoubleProperty &d)
void rwClass(Streamer &s, const QString &tag, T &t)
Serializes an item from a class that provides the function void serialize(Streamer&).
Definition: Serialize.h:77

References Streamer::assertVersion(), BeamItem::m_azimuthalAngleItem, BeamItem::m_inclinationAngleItem, BeamItem::m_wavelengthItem, Serialize::rwClass(), and Serialize::rwProperty().

Here is the call graph for this function:

◆ setAzimuthalAngle()

void BeamItem::setAzimuthalAngle ( double  value)
inherited

Definition at line 87 of file BeamItems.cpp.

88 {
89  m_azimuthalAngleItem->resetToValue(value);
90 }

References BeamItem::m_azimuthalAngleItem.

◆ setInclinationAngle()

void BeamItem::setInclinationAngle ( double  value)
virtualinherited

Reimplemented in SpecularBeamItem.

Definition at line 72 of file BeamItems.cpp.

73 {
74  m_inclinationAngleItem->resetToValue(value);
75 }

References BeamItem::m_inclinationAngleItem.

Referenced by SpecularBeamItem::setInclinationAngle().

◆ setInclinationAngleGetter()

void GISASBeamItem::setInclinationAngleGetter ( std::function< double()>  getter)

Explicitly set a getter function for the inclination angle.

If a getter is set, it overrides the behavior in getInclinationAngle(). Helpful if the angle can't be determined from the internal beam parameters, but from external information.

Definition at line 222 of file BeamItems.cpp.

223 {
224  m_inclinationAngleGetter = getter;
225 }

References m_inclinationAngleGetter.

Referenced by OffspecInstrumentItem::OffspecInstrumentItem().

◆ setWavelength()

void BeamItem::setWavelength ( double  value)
inherited

Definition at line 62 of file BeamItems.cpp.

63 {
64  m_wavelengthItem->resetToValue(value);
65 }

References BeamItem::m_wavelengthItem.

◆ wavelength()

double BeamItem::wavelength ( ) const
inherited

Definition at line 57 of file BeamItems.cpp.

58 {
59  return m_wavelengthItem->wavelength();
60 }

References BeamItem::m_wavelengthItem.

Referenced by BeamItem::createBeam(), and SpecularBeamItem::updateWavelength().

◆ wavelengthItem()

BeamWavelengthItem * BeamItem::wavelengthItem ( ) const
inherited

Member Data Documentation

◆ m_azimuthalAngleItem

std::unique_ptr<BeamAzimuthalAngleItem> BeamItem::m_azimuthalAngleItem
protectedinherited

◆ m_inclinationAngleGetter

std::function<double()> GISASBeamItem::m_inclinationAngleGetter

Definition at line 107 of file BeamItems.h.

Referenced by getInclinationAngle(), and setInclinationAngleGetter().

◆ m_inclinationAngleItem

std::unique_ptr<BeamDistributionItem> BeamItem::m_inclinationAngleItem
protectedinherited

◆ m_wavelengthItem

std::unique_ptr<BeamWavelengthItem> BeamItem::m_wavelengthItem
protectedinherited

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