16 #include "Base/Axis/IAxis.h"
17 #include "Base/Const/Units.h"
18 #include "Device/Beam/Beam.h"
30 RealLimits getLimits(
double max_q)
32 double upper_lim = std::nextafter(4.0 * M_PI / max_q, 0.0);
33 RealLimits result = RealLimits::positive();
34 result.setUpperLimit(upper_lim);
42 m_intensity.init(
"Intensity",
"Beam intensity in neutrons (or gammas) per sec.", 1e+08,
104 std::make_unique<Beam>(intensity(), lambda, Direction(inclination_angle, azimuthal_angle));
109 template <
typename T>
115 template <
typename T>
127 initWavelength<SpecularBeamWavelengthItem>();
135 Serialize::rwBaseClass<BeamItem>(s,
"BeamItem",
this);
136 Serialize::rwSelected<FootprintItemCatalog>(s,
m_footprint);
146 ASSERT(value == 0.0);
183 if (units ==
"nbins") {
198 const auto* axis = pointwiseAxis->axis();
199 if (axis && pointwiseAxis->getUnitsLabel() ==
"q-space")
200 wavelength->setToRange(getLimits(axis->max()));
202 wavelength->setToRange(RealLimits::positive());
210 initInclinationAngle<BeamInclinationAngleItem>();
211 initWavelength<BeamWavelengthItem>();
219 ->inclinationAngle();
Defines class BeamAngleItems.
Defines BeamItem hierarchy.
Defines class BeamWavelengthItem.
Defines pointwise axis item.
The BeamDistributionItem handles wavelength, inclination and azimuthal parameter distribution for Bea...
virtual BeamDistributionItem * inclinationAngleItem() const
std::unique_ptr< Beam > createBeam() const
void initInclinationAngle()
void setWavelength(double value)
std::unique_ptr< BeamDistributionItem > m_inclinationAngleItem
BeamAzimuthalAngleItem * azimuthalAngleItem() const
virtual void serialize(Streamer &s)
std::unique_ptr< BeamWavelengthItem > m_wavelengthItem
virtual void setInclinationAngle(double value)
void setAzimuthalAngle(double value)
double wavelength() const
virtual double getInclinationAngle() const =0
std::unique_ptr< BeamAzimuthalAngleItem > m_azimuthalAngleItem
double getAzimuthalAngle() const
BeamWavelengthItem * wavelengthItem() const
double getInclinationAngle() const override
void setInclinationAngleGetter(std::function< double()> getter)
Explicitly set a getter function for the inclination angle.
std::function< double()> m_inclinationAngleGetter
Abstract base class for instrument-specific item classes.
Item for non-uniform axis with specified coordinates.
Describes a selection (various possibilities and the current one).
void set(T t, bool callInitializer=false)
Directly set the new item.
T get() const
Direct access to the stored pointer.
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...
void initUniformAxis(const IAxis &axis)
void selectPointwiseAxis()
BasicAxisItem * alphaAxis() const
The currently selected axis.
void initPointwiseAxis(const IAxis &axis, QString units)
void setSquareFootprint(double value)
SelectionDescriptor< FootprintItem * > footprintSelection() const
SelectionProperty< FootprintItem * > m_footprint
void setInclinationAngle(double value) override
FootprintItem * footprint() const
BasicAxisItem * inclinationAxis() const
void setGaussianFootprint(double value)
SpecularBeamItem(const InstrumentItem *owningInstrument)
void updateToData(const IAxis &axis, QString units)
SpecularBeamInclinationItem * inclinationAngleItem() const override
double getInclinationAngle() const override
void serialize(Streamer &s) override
Supports serialization to or deserialization from QXmlStream.
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
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&).