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

Description

Definition at line 69 of file BeamItems.h.

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

Public Member Functions

 SpecularBeamItem (const InstrumentItem *owningInstrument)
 
BeamAzimuthalAngleItemazimuthalAngleItem () const
 
std::unique_ptr< Beam > createBeam () const
 
 DOUBLE_PROPERTY (intensity, Intensity)
 
FootprintItemfootprint () const
 
SessionItemfootprintGroupItem () const
 
SelectionDescriptor< FootprintItem * > footprintSelection () const
 
double getAzimuthalAngle () const
 
double getInclinationAngle () const override
 
SpecularBeamInclinationIteminclinationAngleItem () const override
 
BasicAxisIteminclinationAxis () const
 
void serialize (Streamer &s) override
 
void setAzimuthalAngle (double value)
 
template<typename T >
T * setFootprintType ()
 
void setGaussianFootprint (double value)
 
void setInclinationAngle (double value) override
 
void setSquareFootprint (double value)
 
void setWavelength (double value)
 
void updateToData (const IAxis &axis, QString units)
 
void updateWavelength ()
 
double wavelength () const
 
BeamWavelengthItemwavelengthItem () const
 

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
 

Private Attributes

SelectionProperty< FootprintItem * > m_footprint
 

Constructor & Destructor Documentation

◆ SpecularBeamItem()

SpecularBeamItem::SpecularBeamItem ( const InstrumentItem owningInstrument)
explicit

Definition at line 124 of file BeamItems.cpp.

125 {
126  m_inclinationAngleItem.reset(new SpecularBeamInclinationItem(owningInstrument));
127  initWavelength<SpecularBeamWavelengthItem>();
128 
129  m_footprint.init<FootprintItemCatalog>("Type", "Footprint type", "footprint");
130 }
std::unique_ptr< BeamDistributionItem > m_inclinationAngleItem
Definition: BeamItems.h:66
void init(const QString &label, const QString &tooltip, const QString &persistentTag, ArgsForCreation... argsForCreation)
Initialize by means of a catalog class and optional creation arguments.
BeamInclinationAxisItem contains inclination angle axis for specular/off-specular simulations and als...
SelectionProperty< FootprintItem * > m_footprint
Definition: BeamItems.h:91

References SelectionProperty< T >::init(), m_footprint, and BeamItem::m_inclinationAngleItem.

Here is the call graph for this function:

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

◆ footprint()

FootprintItem * SpecularBeamItem::footprint ( ) const

Definition at line 161 of file BeamItems.cpp.

162 {
163  return m_footprint.get();
164 }
T get() const
Direct access to the stored pointer.

References SelectionProperty< T >::get(), and m_footprint.

Here is the call graph for this function:

◆ footprintGroupItem()

SessionItem* SpecularBeamItem::footprintGroupItem ( ) const

◆ footprintSelection()

SelectionDescriptor< FootprintItem * > SpecularBeamItem::footprintSelection ( ) const

◆ 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 SpecularBeamItem::getInclinationAngle ( ) const
overridevirtual

Implements BeamItem.

Definition at line 139 of file BeamItems.cpp.

140 {
141  return 0.0;
142 }

◆ inclinationAngleItem()

SpecularBeamInclinationItem * SpecularBeamItem::inclinationAngleItem ( ) const
overridevirtual

Reimplemented from BeamItem.

Definition at line 151 of file BeamItems.cpp.

152 {
154 }
virtual BeamDistributionItem * inclinationAngleItem() const
Definition: BeamItems.cpp:77

References BeamItem::inclinationAngleItem().

Referenced by DepthProbeInstrumentEditor::DepthProbeInstrumentEditor(), SpecularBeamEditor::SpecularBeamEditor(), SpecularInstrumentItem::alignedWith(), inclinationAxis(), updateToData(), and updateWavelength().

Here is the call graph for this function:

◆ inclinationAxis()

BasicAxisItem * SpecularBeamItem::inclinationAxis ( ) const

Definition at line 156 of file BeamItems.cpp.

157 {
158  return inclinationAngleItem()->alphaAxis();
159 }
BasicAxisItem * alphaAxis() const
The currently selected axis.
SpecularBeamInclinationItem * inclinationAngleItem() const override
Definition: BeamItems.cpp:151

References SpecularBeamInclinationItem::alphaAxis(), and inclinationAngleItem().

Referenced by DepthProbeInstrumentItem::DepthProbeInstrumentItem(), SpecularInstrumentItem::createCoordSystem(), DepthProbeInstrumentItem::createSimulation(), and SpecularInstrumentItem::shape().

Here is the call graph for this function:

◆ 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 SpecularBeamItem::serialize ( Streamer s)
overridevirtual

Reimplemented from BeamItem.

Definition at line 132 of file BeamItems.cpp.

133 {
134  s.assertVersion(0);
135  Serialize::rwBaseClass<BeamItem>(s, "BeamItem", this);
136  Serialize::rwSelected<FootprintItemCatalog>(s, m_footprint);
137 }
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
Definition: Streamer.cpp:26

References Streamer::assertVersion(), and m_footprint.

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.

◆ setFootprintType()

template<typename T >
T* SpecularBeamItem::setFootprintType ( )

◆ setGaussianFootprint()

void SpecularBeamItem::setGaussianFootprint ( double  value)

Definition at line 171 of file BeamItems.cpp.

172 {
174 }
void set(T t, bool callInitializer=false)
Directly set the new item.

References m_footprint, and SelectionProperty< T >::set().

Here is the call graph for this function:

◆ setInclinationAngle()

void SpecularBeamItem::setInclinationAngle ( double  value)
overridevirtual

Reimplemented from BeamItem.

Definition at line 144 of file BeamItems.cpp.

145 {
146  ASSERT(value == 0.0);
147  value = 0.0;
149 }
virtual void setInclinationAngle(double value)
Definition: BeamItems.cpp:72

References BeamItem::setInclinationAngle().

Here is the call graph for this function:

◆ setSquareFootprint()

void SpecularBeamItem::setSquareFootprint ( double  value)

Definition at line 176 of file BeamItems.cpp.

177 {
178  m_footprint.set(new FootprintSquareItem(value));
179 }

References m_footprint, and SelectionProperty< T >::set().

Here is the call graph for this function:

◆ 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.

◆ updateToData()

void SpecularBeamItem::updateToData ( const IAxis &  axis,
QString  units 
)

Definition at line 181 of file BeamItems.cpp.

182 {
183  if (units == "nbins") {
186  } else {
187  inclinationAngleItem()->initPointwiseAxis(axis, units);
189  }
191 }
void initPointwiseAxis(const IAxis &axis, QString units)
void updateWavelength()
Definition: BeamItems.cpp:193

References inclinationAngleItem(), SpecularBeamInclinationItem::initPointwiseAxis(), SpecularBeamInclinationItem::initUniformAxis(), SpecularBeamInclinationItem::selectPointwiseAxis(), SpecularBeamInclinationItem::selectUniformAxis(), and updateWavelength().

Referenced by SpecularInstrumentItem::updateToRealData().

Here is the call graph for this function:

◆ updateWavelength()

void SpecularBeamItem::updateWavelength ( )

Definition at line 193 of file BeamItems.cpp.

194 {
195  auto* item = inclinationAngleItem()->alphaAxis();
196  auto* wavelength = dynamic_cast<SpecularBeamWavelengthItem*>(wavelengthItem());
197  if (auto* pointwiseAxis = dynamic_cast<PointwiseAxisItem*>(item)) {
198  const auto* axis = pointwiseAxis->axis();
199  if (axis && pointwiseAxis->getUnitsLabel() == "q-space")
200  wavelength->setToRange(getLimits(axis->max()));
201  } else
202  wavelength->setToRange(RealLimits::positive());
203 }
BeamWavelengthItem * wavelengthItem() const
Definition: BeamItems.cpp:67
Item for non-uniform axis with specified coordinates.

References SpecularBeamInclinationItem::alphaAxis(), inclinationAngleItem(), BeamItem::wavelength(), and BeamItem::wavelengthItem().

Referenced by updateToData().

Here is the call graph for this function:

◆ 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 updateWavelength().

◆ wavelengthItem()

BeamWavelengthItem * BeamItem::wavelengthItem ( ) const
inherited

Definition at line 67 of file BeamItems.cpp.

68 {
69  return m_wavelengthItem.get();
70 }

References BeamItem::m_wavelengthItem.

Referenced by GISASBeamEditor::GISASBeamEditor(), SpecularBeamEditor::SpecularBeamEditor(), and updateWavelength().

Member Data Documentation

◆ m_azimuthalAngleItem

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

◆ m_footprint

SelectionProperty<FootprintItem*> SpecularBeamItem::m_footprint
private

◆ 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: